-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Fortify cython functions against segfaults (without killing perf) #3028
Comments
i'll add the comment here that i added at #2892: this can probably be done within the outer loop but outside the inner most loops, instead of before the entire thing, so we avoid double-iteration |
In at least some cases, a single len() assertion before any loop is all that's required. Slightly punting by just opening an issue, but the next segfault will kick |
oh actually, hah, i forgot that i actually already did this in a work-in-progress branch somewhere, i'll just isolate it, test it again, and submit a PR; also, I'm not sure how to avoid a loop in |
AFAICT |
@jreback can't be sure, but i'm going to guess there's more cases than that, actually; anyway, the performance hit should not be that bad, if the checks are written to avoid redundancy |
@stephenwlin maybe put in a debug print (temporarily) to SEE where any of the test cases hit it with neg indicies.... |
I had a specific case in mind which is the Other cases are probably not that simple, and up to your proven good judgment. in any case - measure first, then decide. |
@jreback negative indices are somewhat of a different issue though; the bounds checking is necessary unless we're sure we're not passing user-supplied indices to |
yes....suppose if it doesn't hurt perf then should check (rather than seg fault) |
#3031 closes all the gaps I've seen in groupby_x and agg functions, and wes |
Hi again. #3168 |
I can't repro this...is it still an issue? |
Not sure what exactly you can't repro. A number of segfaults have been fixed, I repopened I guess this won't happen after all. |
Tried to repro #3168. Raised an indexerror which seems reasonable. |
yeah, the issue page cites #3191 |
Following discussion in #2892, and segfaults in #3011, #2775, #2778 and others.
manually insert needed checks before inner loop, leaving @cython.boundscheck(False)
inplace.
The text was updated successfully, but these errors were encountered: