-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
gh-128421: make exception group methods thread safe #129298
Conversation
kumaraditya303
commented
Jan 25, 2025
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: data races in frame inspection and tracebacks #128421
Objects/exceptions.c
Outdated
return eg; | ||
PyObject *stack[] = {self->msg, excs}; | ||
size_t nargsf = 2 | PY_VECTORCALL_ARGUMENTS_OFFSET; | ||
return PyObject_Vectorcall(PyExc_BaseExceptionGroup, stack, nargsf, NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it thread safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it was an unrelated optimization merged accidently into this, removed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What here makes it thread safe then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What here makes it thread safe then?
Adding @critical_section
using argument clinic makes it use critical section around function call which makes it thread safe.