-
Notifications
You must be signed in to change notification settings - Fork 3.7k
GH-46123: [C++] Undefined behavior in compare_internal.cc
and light_array_internal.cc
#46124
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
Conversation
|
@github-actions crossbow submit test-r-m1-san |
Revision: 07d7582 Submitted crossbow builds: ursacomputing/crossbow @ actions-798e0f8cd9
|
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.
LGTM.
Thank you @jonkeane for setting up the m1 sanitizer CI job. I think I can take good use of it to further figure out why the misalignment is originated and fixed.
@github-actions crossbow submit -g r |
Revision: 07d7582 Submitted crossbow builds: ursacomputing/crossbow @ actions-bccc2b44c0 |
OK, I did some experiments that can further justify this fix. This experiment proves that merely changing the pointer type passed into For function (64-bit pointer)
The compiler generates an alignment checking stub:
If the check failed (unaligned to 8-byte), it invokes UBSAN reporting routine Whereas for function (8-bit pointer)
No alignment checking stub so everything is fine. Hope this could help people to understand better. |
Co-authored-by: Rossi Sun <zanmato1984@gmail.com>
@assignUser any chance we could get this pulled into the 20 release branch? We still have enough runway with CRAN (5/10 is our deadline) that we might not need to do a special R-only release just for this if we do. Or at least, I think it's ok for us to wait and see if 20 makes it out before then. |
@jonkeane No problem, we need to do another RC anyway 👍 |
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit c54b039. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
I was a little worried this casting was going to hit us, but it looks like no! |
…t_array_internal.cc` (#46124) ### Rationale for this change Removing undefined behaviors, adding a CI job for the M1-mac sanitizer now being run. ### What changes are included in this PR? The fixes + a sanitizer job that confirms they are fixed. ### Are these changes tested? Yup! ### Are there any user-facing changes? Fewer undefined behaviors. * GitHub Issue: #46123 Lead-authored-by: Jonathan Keane <jkeane@gmail.com> Co-authored-by: Rossi Sun <zanmato1984@gmail.com> Signed-off-by: Jonathan Keane <jkeane@gmail.com>
Rationale for this change
Removing undefined behaviors, adding a CI job for the M1-mac sanitizer now being run.
What changes are included in this PR?
The fixes + a sanitizer job that confirms they are fixed.
Are these changes tested?
Yup!
Are there any user-facing changes?
Fewer undefined behaviors.
compare_internal.cc
andlight_array_internal.cc
#46123