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
PyThreadState_SetAsyncExc segfault #41192
Comments
PyThreadState_SetAsyncExc() crawls over the list of A common cause is that PyThreadState_DeleteCurrent() Of course this is rare and can be virtually impossible to |
Logged In: YES Changed Category to Threads. |
Logged In: YES I guess that the patch you have in mind is just to protect the loop with HEAD_LOCK/HEAD_UNLOCK. I cannot test this patch (attached), though, as I don't have any code that uses this function. I can only tell that it also looks like a reasonable thing to do to me. |
Logged In: YES Yup, that patch is all I had in mind. It's a shame that nobody BTW, I have no idea why this function warns about return |
Logged In: YES But it was Just's idea, so assigning to him. Q for Just: (Q. for Tim: hoes does the head_mutex in this file relate to |
Logged In: YES It's already documented that PyThreadState_SetAsyncExc() It would be good to have a clue about "I have no idea why if (p->thread_id == id) {
PyObject *temp = p->async_exc;
Py_XINCREF(exc);
p->async_exc = exc;
HEAD_UNLOCK();
Py_XDECREF(temp);
return 1;
} Then deadlock couldn't occur. I should note that PyInterpreterState_Clear() is prone to the |
Logged In: YES I'm not able to judge the patch. I'm only the one who had the feature |
Logged In: YES I didn't worry too much about ZAP deadlocks precisely because this |
Logged In: YES Just, this function isn't called anywhere in the Python The presumption here is that you do have code that uses this |
Logged In: YES To be honest: I don't yet have any code that relies on the feature, so I did a quick test (through ctypes), and the function works well with and |
Logged In: YES I've checked the current codebase of the client for whom I originally |
Logged In: YES So we're peeing away time on a Mystery Function with no |
Logged In: YES OK, to prevent further waste of time I've checked in the I have no idea what the count>1 comment was referring to any |
Logged In: YES Should the head lock's be backported to Py2.4? |
Logged In: YES Backport: sure, why not. Just don't ask anyone to test it |
Logged In: YES For Python 2.5 (rev 51195), I changed the code as suggested |
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: