Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Apr 2021 16:18:59 +0000
From:      bugzilla-noreply@freebsd.org
To:        python@FreeBSD.org
Subject:   [Bug 255445] lang/python 3.8/3.9 SIGSEV core dumps in libthr TrueNAS
Message-ID:  <bug-255445-21822-GAVeRBLna4@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-255445-21822@https.bugs.freebsd.org/bugzilla/>
References:  <bug-255445-21822@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D255445

--- Comment #16 from Victor Stinner <victor.stinner@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 avo=
ided
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.ht=
ml
* 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 relia=
ble.
My notes on that topic:
https://pythondev.readthedocs.io/finalization.html

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-255445-21822-GAVeRBLna4>