{"action":"created","issue":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/795","labels_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/795/labels{/name}","comments_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/795/comments","events_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/795/events","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/795","id":119331739,"number":795,"title":"Spontaneous reset around concat and number to string conversions","user":{"login":"pjsg","id":1508813,"avatar_url":"https://avatars.githubusercontent.com/u/1508813?v=3","gravatar_id":"","url":"https://api.github.com/users/pjsg","html_url":"https://github.com/pjsg","followers_url":"https://api.github.com/users/pjsg/followers","following_url":"https://api.github.com/users/pjsg/following{/other_user}","gists_url":"https://api.github.com/users/pjsg/gists{/gist_id}","starred_url":"https://api.github.com/users/pjsg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjsg/subscriptions","organizations_url":"https://api.github.com/users/pjsg/orgs","repos_url":"https://api.github.com/users/pjsg/repos","events_url":"https://api.github.com/users/pjsg/events{/privacy}","received_events_url":"https://api.github.com/users/pjsg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-11-29T02:35:50Z","updated_at":"2015-11-29T22:24:38Z","closed_at":null,"body":"I am tearing my hair out -- the following code (when executed) causes the system to restart:\r\n\r\n```lua\r\nlocal function sendAttr(connection, attr, val)\r\nend\r\n\r\nreturn function (connection, req, args)\r\n    collectgarbage()\r\n    print(node.heap())\r\n    local x = (1)..\".\"..44\r\n   sendAttr(1, (1)..\".\"..44)\r\nend\r\n```\r\n\r\nThe print of `node.heap()` shows 16816 -- so plenty of space left.\r\n\r\nThis code does not cause a restart:\r\n\r\n```lua\r\nlocal function sendAttr(connection, attr, val)\r\nend\r\n\r\nreturn function (connection, req, args)\r\n    collectgarbage()\r\n    print(node.heap())\r\n    -- local x = (1)..\".\"..44\r\n   sendAttr(1, (1)..\".\"..44)\r\nend\r\n```\r\nThis file ends up being invoked by nodemcu-httpserver which ends up running this in a coroutine.\r\n\r\nI'm running version:\r\n```\r\nNodeMCU custom build by frightanic.com\r\n\tbranch: dev\r\n\tcommit: b216e6a809edd035d70536a691c4a07ac4b256a9\r\n\tSSL: false\r\n\tmodules: node,file,gpio,wifi,net,i2c,tmr,uart,bit,u8g,dht,rtctime,sntp\r\n build \tbuilt on: 2015-11-21 19:09\r\n powered by Lua 5.1.4 on SDK 1.4.0\r\n```\r\n\r\nI don't expect anybody to solve my problem, but I would appreciate some hints on how to track this down. Is there a way to build the nodemcu firmware on a linux box so that I could attach a debugger or similar to it?"},"comment":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/comments/160476332","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/795#issuecomment-160476332","issue_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/795","id":160476332,"user":{"login":"pjsg","id":1508813,"avatar_url":"https://avatars.githubusercontent.com/u/1508813?v=3","gravatar_id":"","url":"https://api.github.com/users/pjsg","html_url":"https://github.com/pjsg","followers_url":"https://api.github.com/users/pjsg/followers","following_url":"https://api.github.com/users/pjsg/following{/other_user}","gists_url":"https://api.github.com/users/pjsg/gists{/gist_id}","starred_url":"https://api.github.com/users/pjsg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjsg/subscriptions","organizations_url":"https://api.github.com/users/pjsg/orgs","repos_url":"https://api.github.com/users/pjsg/repos","events_url":"https://api.github.com/users/pjsg/events{/privacy}","received_events_url":"https://api.github.com/users/pjsg/received_events","type":"User","site_admin":false},"created_at":"2015-11-29T22:24:38Z","updated_at":"2015-11-29T22:24:38Z","body":"The assert is hidden inside tsvalue(top-1) -- I just filed a PR to fix the problem -- it turns out that the value of top must _NOT_ be cached across a call to tostring() which returns != 0 as it may have triggered a GC."}}