Open devdanzin opened 2 hours ago
Confirmed on the main branch and 3.13. Interestingly, this doesn't seem to happen on any other objects passed to is_finalized
, and not even objects of the same type--only lambdas cause this. I did see that the reference count of a lambda is significantly high, but I'm guessing that's just a result of the DRC bits. I'm investigating to see what's going on.
Crash report
What happened?
In debug no-gil builds with
PYTHON_GIL=0
, it's possible to trigger the three assertions here with simple code: https://github.com/python/cpython/blob/c84a136511c673f495f466887716b55c13b7e3ac/Python/gc_free_threading.c#L550-L558For this code:
We get:
For this code:
We get:
Lastly, for code I haven't minimized yet (but can, if it helps), we get:
Found using fusil by @vstinner.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.14.0a1+ experimental free-threading build (heads/main:d467d9246c, Nov 1 2024, 09:05:56) [GCC 11.4.0]