{"action":"closed","issue":{"url":"https://api.github.com/repos/loboris/ESP32_TFT_library/issues/61","repository_url":"https://api.github.com/repos/loboris/ESP32_TFT_library","labels_url":"https://api.github.com/repos/loboris/ESP32_TFT_library/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/loboris/ESP32_TFT_library/issues/61/comments","events_url":"https://api.github.com/repos/loboris/ESP32_TFT_library/issues/61/events","html_url":"https://github.com/loboris/ESP32_TFT_library/issues/61","id":380646043,"node_id":"MDU6SXNzdWUzODA2NDYwNDM=","number":61,"title":"multithread + garbage collection + socket causes CPU halt","user":{"login":"taitix","id":3492160,"node_id":"MDQ6VXNlcjM0OTIxNjA=","avatar_url":"https://avatars3.githubusercontent.com/u/3492160?v=4","gravatar_id":"","url":"https://api.github.com/users/taitix","html_url":"https://github.com/taitix","followers_url":"https://api.github.com/users/taitix/followers","following_url":"https://api.github.com/users/taitix/following{/other_user}","gists_url":"https://api.github.com/users/taitix/gists{/gist_id}","starred_url":"https://api.github.com/users/taitix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taitix/subscriptions","organizations_url":"https://api.github.com/users/taitix/orgs","repos_url":"https://api.github.com/users/taitix/repos","events_url":"https://api.github.com/users/taitix/events{/privacy}","received_events_url":"https://api.github.com/users/taitix/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-14T11:02:17Z","updated_at":"2018-11-14T11:09:18Z","closed_at":"2018-11-14T11:09:18Z","author_association":"NONE","body":"When I use microWebSrv+microWebSocket,  Guru Meditation (LoadProhibited) occurs when automatic GC runs or manually run gc.collect().\r\nI wrote a minimal code to reproduce the issue which ended up in assertion failure which\r\nhappend only in try statement within a function. (I'm not sure if this is causing the  Guru Meditaion (LoadProhibited) though...)\r\n\r\n```\r\nfrom time import sleep_ms\r\nimport machine, socket, gc, _thread\r\nfrom network import WLAN, STA_IF\r\n\r\nwlan = WLAN(STA_IF)\r\nwlan.active(True)\r\nwlan.connect('SSID', 'PASSWORD')\r\nwhile not wlan.isconnected():\r\n  sleep_ms(100)\r\n  print('.', end='')\r\n\r\ndef gc_thread():\r\n  while True:\r\n    sleep_ms(10)\r\n    gc.collect()\r\n\r\n_thread.start_new_thread('GUI', gc_thread, ())\r\n\r\ns = socket.socket(socket.AF_INET,\r\n                         socket.SOCK_STREAM,\r\n                         socket.IPPROTO_TCP)\r\ns.bind(('0.0.0.0', 80))\r\ns.listen(1)\r\ns.settimeout(0.1)\r\n\r\n# This block runs fine\r\ntry:\r\n  client, cliAddr = s.accepted()\r\nexcept Exception as e:\r\n  print(e)\r\n\r\ndef f1(s):\r\n  client, cliAddr = s.accepted()\r\n\r\ndef f2(s):\r\n  try:\r\n    client, cliAddr = s.accepted()\r\n  except Exception as e:\r\n    print(e)\r\n\r\nf1(s) # this is fine\r\nprint(\"i'm still alive!\")\r\nf2(s) # <- calling this causes following:\r\n# assertion \"ATB_GET_KIND(block) == AT_HEAD\" failed: file \"/home/LoBo2_Razno/ESP32/MicroPython/MicroPython_ESP32_psRAM_LoBo/MicroPython_BUILD/components/micropython/py/gc.c\", line 596, function: gc_free\r\n# abort() was called at PC 0x4012bb07 on core 1\r\n#\r\n# Backtrace: 0x40095bcc:0x3ffc60d0 0x40095d93:0x3ffc60f0 0x4012bb07:0x3ffc6110 0x400ed38e:0x3ffc6140 0x400ecb55:0x3ffc6160 0x400fa919:0x3ffc6180 0x400f5acd:0x3ffc61b0 0x40103e07:0x3ffc61d0 0x400fa8da:0x3ffc6270 0x400f5acd:0x3ffc62a0 0x400f5afa:0x3ffc62c0 0x400e56e3:0x3ffc62e0 0x400e5999:0x3ffc6390 0x400d7f42:0x3ffc63b0\r\n# CPU halted.\r\n\r\n```"}}
{"actor":{"display_login":"taitix"}}