{"action":"created","issue":{"url":"https://api.github.com/repos/micropython/micropython/issues/1787","labels_url":"https://api.github.com/repos/micropython/micropython/issues/1787/labels{/name}","comments_url":"https://api.github.com/repos/micropython/micropython/issues/1787/comments","events_url":"https://api.github.com/repos/micropython/micropython/issues/1787/events","html_url":"https://github.com/micropython/micropython/issues/1787","id":127188072,"number":1787,"title":"unix: the GC does not scan all relevant parts of the stack","user":{"login":"stinos","id":1902997,"avatar_url":"https://avatars.githubusercontent.com/u/1902997?v=3","gravatar_id":"","url":"https://api.github.com/users/stinos","html_url":"https://github.com/stinos","followers_url":"https://api.github.com/users/stinos/followers","following_url":"https://api.github.com/users/stinos/following{/other_user}","gists_url":"https://api.github.com/users/stinos/gists{/gist_id}","starred_url":"https://api.github.com/users/stinos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stinos/subscriptions","organizations_url":"https://api.github.com/users/stinos/orgs","repos_url":"https://api.github.com/users/stinos/repos","events_url":"https://api.github.com/users/stinos/events{/privacy}","received_events_url":"https://api.github.com/users/stinos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/micropython/micropython/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-18T09:41:07Z","updated_at":"2016-01-18T11:49:35Z","closed_at":null,"body":"````\r\nMicroPython v1.4.3-1119-gac16cc9 on 2016-01-18; linux version\r\nUse Ctrl-D to exit, Ctrl-E for paste mode\r\n>>> import gc\r\n>>> gc.collect()\r\n5\r\n>>> gc.collect()\r\n3\r\nSegmentation fault (core dumped)\r\n````\r\n\r\nI'll have to investigate this further to find the actual cause, but from what I can see now (on Windows, where it segfaults in another place) it looks as if ```mp_state_ctx_t.vm.mp_module_builtins_override_dict``` gets sweeped in the first call to gc_collect(), so on the second execution the lookup in mp_load_global() segfaults because mp_module_builtins_override_dict doesn't contain a valid dict anymore."},"comment":{"url":"https://api.github.com/repos/micropython/micropython/issues/comments/172507134","html_url":"https://github.com/micropython/micropython/issues/1787#issuecomment-172507134","issue_url":"https://api.github.com/repos/micropython/micropython/issues/1787","id":172507134,"user":{"login":"pfalcon","id":500451,"avatar_url":"https://avatars.githubusercontent.com/u/500451?v=3","gravatar_id":"","url":"https://api.github.com/users/pfalcon","html_url":"https://github.com/pfalcon","followers_url":"https://api.github.com/users/pfalcon/followers","following_url":"https://api.github.com/users/pfalcon/following{/other_user}","gists_url":"https://api.github.com/users/pfalcon/gists{/gist_id}","starred_url":"https://api.github.com/users/pfalcon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfalcon/subscriptions","organizations_url":"https://api.github.com/users/pfalcon/orgs","repos_url":"https://api.github.com/users/pfalcon/repos","events_url":"https://api.github.com/users/pfalcon/events{/privacy}","received_events_url":"https://api.github.com/users/pfalcon/received_events","type":"User","site_admin":false},"created_at":"2016-01-18T11:49:35Z","updated_at":"2016-01-18T11:49:35Z","body":"> We need to set the stack top to truly the stack top.\r\n\r\nShould be reverted then: 8a96ebea75158987c1136f1a618d98cf387445fd"}}