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
Coverage Plugin causes segfault #2879
Comments
Thanks for the report. Looking through the generated code, I could apply a tiny fix to the error handling in the nogil tracing code, although it's unlikely that this was causing your crash since it should only apply to errors raised by the trace function itself. In general, tracing inside of nogil blocks is rather heavy since it needs to acquire and release the GIL around each trace call, which, in the worst case, might also have a behavioural impact. Again, not likely in the given code. Also, it looks like you are not using the I don't see anything else that might be wrong here, so stripping down the example to a self-contained reproducer would help to understand the problem. |
I'll give this a go. |
OK, I've got a partially stripped-down example and a decent guess as to where the problem lies. TL;DR: several functions in period.pyx that should be marked as Breaking down
and to trigger the segfault we just need
is this something we would expect cython to have noticed? Or should this be considered purely user (me) error? |
Thanks for your investigations. Then it's the cast of a function that requires the GIL into a `nogil' function. That is obviously a user error, but Cython should at least warn about it. I'm not sure if it should be an error, because a cast is the intended way for users to say "I know better", however unlikely that is in this case. So, I've made it a visible warning for now, with the perspective of making it an error in the future. |
Just compiled pandas with cython coverage enabled to test #2871 and got a segfault during the test suite. This occurs in both master and in 0.29.1, so is not unique to #2871.
The test that segfaults is tests/arithmetic/test_datetime64.py TestDatetime64DateOffsetArithmetictest_dt64arr_add_sub_DateOffsets[Index-0-True-BusinessDay]. I'll see if I can track down a smaller piece of code that causes the segfault. I can reproduce it with
period_to_dt64arr
is mostly a for-loop callingperiod_ordinal_to_dt64
, but the latter does not segfault when called on its own:The offending function:
The text was updated successfully, but these errors were encountered: