classification
Title: Fatal Python error: Py_EndInterpreter: not the last thread
Type: Stage: resolved
Components: Versions: Python 3.9
process
Status: closed Resolution: duplicate
Dependencies: Superseder: fix for bpo-36402 (threading._shutdown() race condition) causes reference leak
View: 37788
Assigned To: Nosy List: pablogsal, vstinner
Priority: normal Keywords:

Created on 2019-08-19 23:16 by pablogsal, last changed 2019-08-19 23:30 by vstinner. This issue is now closed.

Messages (3)
msg349974 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-08-19 23:16
The x86-64 High Sierra 3.x buildbot and AMD64 FreeBSD CURRENT Shared 3.x are failing with:

Fatal Python error: Py_EndInterpreter: not the last thread

https://buildbot.python.org/all/#/builders/145/builds/2233
https://buildbot.python.org/all/#/builders/168/builds/1295

Fatal Python error: Py_EndInterpreter: not the last thread
Current thread 0x00007fff8e587380 (most recent call first):
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/support/__init__.py", line 2911 in run_in_subinterp
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_threading.py", line 1006 in test_threads_join_2
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/unittest/case.py", line 611 in _callTestMethod
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/unittest/case.py", line 654 in run
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/unittest/case.py", line 714 in __call__
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/unittest/suite.py", line 122 in run
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/unittest/suite.py", line 84 in __call__
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/unittest/suite.py", line 122 in run
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/unittest/suite.py", line 84 in __call__
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/unittest/suite.py", line 122 in run
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/unittest/suite.py", line 84 in __call__
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/unittest/runner.py", line 176 in run
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/support/__init__.py", line 1996 in _run_suite
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/support/__init__.py", line 2092 in run_unittest
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/libregrtest/runtest.py", line 209 in _test_module
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/libregrtest/runtest.py", line 153 in _runtest
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/libregrtest/runtest.py", line 193 in runtest
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/libregrtest/main.py", line 310 in rerun_failed_tests
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/libregrtest/main.py", line 678 in _main
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/libregrtest/main.py", line 628 in main
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/libregrtest/main.py", line 695 in main
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/__main__.py", line 2 in <module>
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/runpy.py", line 85 in _run_code
  File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/runpy.py", line 192 in _run_module_as_main
make: *** [buildbottest] Abort trap: 6
program finished with exit code 2
elapsedTime=1799.062811
test_threads_join_2 (test.test_threading.SubinterpThreadingTests) ... 

https://buildbot.python.org/all/#/builders/145/builds/2233
msg349976 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-08-19 23:22
See also https://bugs.python.org/issue37788
msg349978 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-08-19 23:30
It's a regression caused by bpo-37788. I created PR 15338 to revert my change.
History
Date User Action Args
2019-08-19 23:30:53vstinnersetstatus: open -> closed
superseder: fix for bpo-36402 (threading._shutdown() race condition) causes reference leak
messages: + msg349978

resolution: duplicate
stage: resolved
2019-08-19 23:23:18pablogsalsettitle: "Fatal Python error: Py_EndInterpreter: not the last thread" that's bad -> Fatal Python error: Py_EndInterpreter: not the last thread
2019-08-19 23:22:38pablogsalsetmessages: + msg349976
2019-08-19 23:16:33pablogsalcreate