-
Notifications
You must be signed in to change notification settings - Fork 86
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
possible issue (sigsegv) with cached_context #340
Comments
IIRC, there have been some changes in handling thread_state in recent versions (3.9 or 3.10 ??). What version of Python are you using? Is it reproducible enough to justify the effort in testing with an older version, say 3.7? |
This is with 3.8 - I haven't had time to work on a reproducer yet but that's my next step, certainly. |
I found a simple way to reproduce the issue without involving any other libraries. It is a reference counting bug. Don't know where it is yet but I can trigger it within a few seconds. Interestingly, I can trigger with Python 3.7 but not any later versions. |
TL;DR I'm fairly certain I've solved the issue. We've recently made some changes and are starting to work on the next major release - version 2.2. The minimum supported version of Python is now 3.7. Contextvars were introduced in Python 3.7 as a replacement for using thread local storage to manage application contexts (such as gmpy2). I converted to using contextvars and my intermittent crashes have stopped. Can you test your application compiling from the latest source? Case |
@tjb900, now there are binary wheels for 2.2.0a1. Can you reproduce the issue? |
Hi!
I've been tracking down a very rare crash in our application, and I think I've reached a point where I can see a problem in gmpy2 - would very much appreciate if you could either tell me I'm dreaming or not!
I believe we are crashing at this line:
gdb dump showing instruction where fault occurred
Is it possible that the
cached_context
could point to a thread-local state for a thread that has since exited?Thanks and Kind Regards,
Tim
This is the traceback from the crash - gmpy2 is being used via sympy:
py-bt:
The text was updated successfully, but these errors were encountered: