New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cell object cleared too early? #66360
Comments
This is a tricky issue I'm sometimes seeing when running Numba's test suite, and I can't seem to write a reproducer. Somtimes I'm seeing the following messages: Exception ignored in: <function _OverloadedBase._make_finalizer.<locals>.finalizer at 0x7f1466487c80>
Traceback (most recent call last):
File "/home/antoine/numba/numba/dispatcher.py", line 59, in finalizer
if shutting_down():
NameError: free variable 'shutting_down' referenced before assignment in enclosing scope So what does it correspond to? The code is here: Basically, there's no way 'shutting_down' can be referenced before assignment... except if it has been cleared. And the only thing which can clear it here is the GC (namely, cell objects' tp_clear() method). I'm not sure what the exact trigger for reproduction is. It does have to feature a reference cycle involving the closure; perhaps the trashcan mechanism comes into play as well. Also, the closure must be invoked on collection of something in the cycle, so a weakref callback could be nice. |
The issue is 8 years old, has no reproducer and the linked repo does not has |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: