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
[BUG] Refnanny + aiohttp + Fedora 36 = Segmentation fault #5495
Comments
I think installing a podman+fedora in a language I don't know is probably more debugging that I'm personally able to do. It'd be useful if you could show what's in lines 1670-1730 of _helpers.c just so we can get a little context. My guess (from compiling https://github.com/aio-libs/aiohttp/blob/master/aiohttp/_helpers.pyx myself) is that |
@da-woods, No problem: |
Could you try the same thing with Cython 3.0b3 or the master branch? We're not applying major changes in the legacy 0.29.x branch any more, so this is not guaranteed to get fixed there.
|
@scoder I can. But , seems someone (Cython or Python) does not honour contract exception handling case. I think the problem will be the same. I need some time because I need to recompile the package with custom Cython version. I don't think this place was changed in newer Cython. |
|
https://docs.python.org/3/c-api/exceptions.html#c.PyException_GetTraceback Seems it's the case when NULL is returned, but Cython code thinks it can not be NULL |
Next, if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_10) < 0) __PYX_ERR(0, 25, __pyx_L11_except_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_10);
|
I don't know how to fix, I'm not familiar with Cython structures |
Seems, other return values for |
I had a quick look at the code you sent this morning and that was basically my conclusion too. The reason we're assuming the traceback isn't null is because we set the traceback. However that can fail so we shouldn't assume the traceback is null. The other two values are definitely set in this case though so aren't an issue. |
I'm sure I worked on this at some point. Let me see if I find the branch or changes somewhere. |
… ok, I failed to find it. But this seems a simple fix. |
Describe the bug
Segmentation fault in code generated by Cython
Code to reproduce the behaviour:
Make request to http://localhost:1234 - and it will die with segmentation fault.
-DCYTHON_REFNANNY
gives:And according to GDB, yes, it fails on
__Pyx_DECREF(__pyx_t_10)
(null pointer dereference)It is not reproduced in Fedora 37. Yes. But I need to know if the bug was fixed.
Possibly Python does not return NULL on broken locale, who knows. But I think Cython does not check for NULL where it should. What I mean, another error may appear again in this place under different conditions (not broken locale)
Expected behaviour
No response
OS
Linux
Python version
Python 3.10.7
Cython version
0.29.26
Additional context
No response
The text was updated successfully, but these errors were encountered: