Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Closed
Description
The test_concurrency() of test_import fails randomly on sys.settrace(). Example:
$ ./python -m test test_import -m test_concurrency -v -j30 -F --fail-env-changed (...)0:00:13 load avg: 12.46 [ 97/1] test_import failed (env changed)test_concurrency (test.test_import.ImportTests) ... ok----------------------------------------------------------------------Ran 1 test in 0.487sOKWarning -- Uncaught thread exception: RuntimeErrorException in thread Thread-13 (run):Traceback (most recent call last): File "/home/vstinner/python/3.10/Lib/threading.py", line 1016, in _bootstrap_inner self.run() File "/home/vstinner/python/3.10/Lib/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/home/vstinner/python/3.10/Lib/test/test_import/__init__.py", line 457, in run sys.settrace(None)RuntimeError: Cannot install a trace function while another trace function is being installed(...)
The problem is that the _PyEval_SetTrace() function fails with RuntimeError("Cannot install a trace function while another trace function is being installed") onPy_XDECREF(traceobj);
indirectly callssys.settrace()
.
IMOPy_XDECREF(traceobj);
should be calledafterreentrant = 0;
, at the end of the function.