[Bug 255445] lang/python 3.8/3.9 SIGSEV core dumps in libthr TrueNAS
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Fri Apr 30 16:18:59 UTC 2021
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255445
--- Comment #16 from Victor Stinner <victor.stinner at gmail.com> ---
I can reproduce the issue with Python 3.8 on Linux.
Well, first, don't rely on implicit resource management: don't rely on
__del__() destructor.
You should use "with pool:" and then call pool.join().
--
I'm not sure if it's related, but daemon threads are evil and should be avoided
if possible. It's another variant of "implicit resource management" (don't join
the thread, expect it to disappear magically at exit). I fixed many race
conditions in daemon threads:
* https://vstinner.github.io/daemon-threads-python-finalization-python32.html
* https://vstinner.github.io/threading-shutdown-race-condition.html
* https://vstinner.github.io/gil-bugfixes-daemon-threads-python39.html
Python 3.9 avoids daemon threads in concurrent.futures:
https://bugs.python.org/issue39812
But multiprocessing still uses daemon threads.
--
I also fixed multiple bugs in the Python finalization to make it more reliable.
My notes on that topic:
https://pythondev.readthedocs.io/finalization.html
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-python
mailing list