{"action":"created","issue":{"url":"https://api.github.com/repos/gevent/gevent/issues/1098","repository_url":"https://api.github.com/repos/gevent/gevent","labels_url":"https://api.github.com/repos/gevent/gevent/issues/1098/labels{/name}","comments_url":"https://api.github.com/repos/gevent/gevent/issues/1098/comments","events_url":"https://api.github.com/repos/gevent/gevent/issues/1098/events","html_url":"https://github.com/gevent/gevent/issues/1098","id":296865587,"number":1098,"title":"Destroying the default loop in corecext causes the interpreter to crash","user":{"login":"jamadden","id":1256082,"avatar_url":"https://avatars3.githubusercontent.com/u/1256082?v=4","gravatar_id":"","url":"https://api.github.com/users/jamadden","html_url":"https://github.com/jamadden","followers_url":"https://api.github.com/users/jamadden/followers","following_url":"https://api.github.com/users/jamadden/following{/other_user}","gists_url":"https://api.github.com/users/jamadden/gists{/gist_id}","starred_url":"https://api.github.com/users/jamadden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamadden/subscriptions","organizations_url":"https://api.github.com/users/jamadden/orgs","repos_url":"https://api.github.com/users/jamadden/repos","events_url":"https://api.github.com/users/jamadden/events{/privacy}","received_events_url":"https://api.github.com/users/jamadden/received_events","type":"User","site_admin":false},"labels":[{"id":13923699,"url":"https://api.github.com/repos/gevent/gevent/labels/bug","name":"bug","color":"fc2929","default":true},{"id":13923701,"url":"https://api.github.com/repos/gevent/gevent/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":773429644,"url":"https://api.github.com/repos/gevent/gevent/labels/libev","name":"libev","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-13T19:57:13Z","updated_at":"2018-02-14T15:35:21Z","closed_at":null,"author_association":"OWNER","body":"* gevent version: master\r\n* Python version: Seen in CPython 3.4, 3.5 and sometimes 3.6 and 3.7\r\n* Operating System: Seen on Linux, OS X, and Appveyor\r\n\r\n```pycon\r\n>>> import gevent\r\n>>> gevent.get_hub()\r\n<Hub at 0x10cb74768 select default pending=0 ref=0>\r\n>>> loop = gevent.config.loop(default=True)\r\n>>> loop.destroy()\r\nNone\r\n>>> del loop\r\n>>> ^D\r\nSegmentation fault: 11\r\n```\r\n\r\nI've seen this backtrace from that example:\r\n```\r\nThread 0 Crashed:: Dispatch queue: com.apple.main-thread\r\n0   corecext.cpython-35m-darwin.so\t0x000000010cba05e0 __pyx_pw_6gevent_5libev_8corecext_4loop_5_stop_watchers + 112\r\n1   corecext.cpython-35m-darwin.so\t0x000000010cb92ba5 __Pyx_PyObject_CallMethO + 85\r\n2   greenlet.cpython-35m-darwin.so\t0x000000010cbeb123 green_dealloc + 691\r\n3   org.python.python             \t0x000000010ae21ee4 subtype_dealloc + 849\r\n4   org.python.python             \t0x000000010ae0aff2 free_keys_object + 67\r\n5   org.python.python             \t0x000000010ae0ca15 dict_dealloc + 183\r\n6   org.python.python             \t0x000000010ae0aff2 free_keys_object + 67\r\n7   org.python.python             \t0x000000010ae0ca15 dict_dealloc + 183\r\n8   org.python.python             \t0x000000010aea70d8 local_clear + 97\r\n9   org.python.python             \t0x000000010aea6edf local_dealloc + 40\r\n10  org.python.python             \t0x000000010ae21ee4 subtype_dealloc + 849\r\n11  org.python.python             \t0x000000010ae0aff2 free_keys_object + 67\r\n12  org.python.python             \t0x000000010ae0ce17 dict_tp_clear + 9\r\n13  org.python.python             \t0x000000010aea5e0c collect + 1824\r\n14  org.python.python             \t0x000000010aea56e3 _PyGC_CollectNoFail + 43\r\n15  org.python.python             \t0x000000010ae861d4 PyImport_Cleanup + 968\r\n16  org.python.python             \t0x000000010ae8fb49 Py_Finalize + 92\r\n17  org.python.python             \t0x000000010aea4d2f Py_Main + 2615\r\n```\r\n\r\nI've also seen this backtrace from a test script:\r\n```\r\n 0   libsystem_kernel.dylib        \t0x00007fff66455e3e __pthread_kill + 10\r\n 1   libsystem_pthread.dylib       \t0x00007fff66594150 pthread_kill + 333\r\n 2   libsystem_c.dylib             \t0x00007fff663648fe raise + 26\r\n 3   libsystem_platform.dylib      \t0x00007fff66587f5a _sigtramp + 26\r\n 4   ???                           \t000000000000000000 0 + 0\r\n 5   greenlet.cpython-35m-darwin.so\t0x000000010d76b297 green_clear + 183\r\n 6   org.python.python             \t0x000000010c707e0c collect + 1824\r\n 7   org.python.python             \t0x000000010c7076e3 _PyGC_CollectNoFail + 43\r\n 8   org.python.python             \t0x000000010c6e81d4 PyImport_Cleanup + 968\r\n 9   org.python.python             \t0x000000010c6f1b49 Py_Finalize + 92\r\n 10  org.python.python             \t0x000000010c6f20d5 Py_Exit + 13\r\n 11  org.python.python             \t0x000000010c6f4631 handle_system_exit + 320\r\n 12  org.python.python             \t0x000000010c6f42a1 PyErr_PrintEx + 42\r\n```\r\n\r\nWe should try to do better than crash."},"comment":{"url":"https://api.github.com/repos/gevent/gevent/issues/comments/365644532","html_url":"https://github.com/gevent/gevent/issues/1098#issuecomment-365644532","issue_url":"https://api.github.com/repos/gevent/gevent/issues/1098","id":365644532,"user":{"login":"jamadden","id":1256082,"avatar_url":"https://avatars3.githubusercontent.com/u/1256082?v=4","gravatar_id":"","url":"https://api.github.com/users/jamadden","html_url":"https://github.com/jamadden","followers_url":"https://api.github.com/users/jamadden/followers","following_url":"https://api.github.com/users/jamadden/following{/other_user}","gists_url":"https://api.github.com/users/jamadden/gists{/gist_id}","starred_url":"https://api.github.com/users/jamadden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamadden/subscriptions","organizations_url":"https://api.github.com/users/jamadden/orgs","repos_url":"https://api.github.com/users/jamadden/repos","events_url":"https://api.github.com/users/jamadden/events{/privacy}","received_events_url":"https://api.github.com/users/jamadden/received_events","type":"User","site_admin":false},"created_at":"2018-02-14T15:35:21Z","updated_at":"2018-02-14T15:35:21Z","author_association":"OWNER","body":"This can also happen in the CFFI implementations, you just have to work at it because they don't have a `__del__` that attempts to destroy the loop. This will crash the process (segfault with libev, abort() with libuv):\r\n```python\r\nloop1 = gevent.config.loop(default=True)\r\nloop2 = gevent.config.loop(default=True)\r\nloop1.destroy()\r\nloop2.destroy() # bang!\r\n```"}}
{"actor":{"display_login":"jamadden"}}