-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
CI: Add UBSAN CI jobs for macOS arm64 and Linux x86-64 #29487
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
Merged
ngoldbaum
merged 40 commits into
numpy:main
from
m-clare:undefined-behavior-ubsan-suppressions
Aug 6, 2025
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
3cc3aa2
feat: create suppressions file with grouping
m-clare 9a38098
feat: isolate macOS ubsan errors in sep task/supp
m-clare d657dc3
chore: briefly enable workflow dispatch control
m-clare ff3bc29
fix: specific version
m-clare 6468c8f
fix: env root for suppressions file
m-clare fe13708
fix: meson flag and path
m-clare 11f79ad
fix: try relative path
m-clare f92456c
fix: additional failure in CI
m-clare fc8fb25
chore: disable temporarily to capture addt errors
m-clare cb560a0
fix: github workspace for explicit path...
m-clare bec1588
fix: function runtime errors, halt_on_error enable
m-clare 354a36c
fix: try to capture fatal error in CI
m-clare ecdb77f
fix: remove manual dispatch + halt_on_error
m-clare d4b93b8
fix: function dispact on bit_generator
m-clare 88b5141
fix: uncaught pointer issue
m-clare 3568347
fix: generalize random ignore
m-clare 86e5b50
fix: missing convert datatype
m-clare b4e9a91
fix: another missing multiarray flagged
m-clare 86b959c
fix: another multiarray test
m-clare 6e6d262
fix: generalize to ignore multiarray functions
m-clare 5d49912
fix: flush umath as well
m-clare b9071f6
chore: ignore all function errors for now
m-clare 8b47eba
feat: test against ubuntu
m-clare 603fef8
fix: add linux suppressions file
m-clare 7e15fa7
chore: simplify ubuntu ubsan
m-clare 56756ff
Merge branch 'main' into undefined-behavior-ubsan-suppressions
m-clare 1acbbb5
chore: bump python version
m-clare f9ec386
fix: avoid rerunning clang ubsan for now
m-clare d34662f
fix: os tag
m-clare 1cd752d
chore: rename supp file, rename steps
m-clare c186d57
fix: remove outdated supp file
m-clare 2844d0a
feat: combine clang asan/ubsan jobs
m-clare 78af625
fix: comment out for workflow test
m-clare 53fa6ba
chore: remove fork trigger
m-clare 69ed7f8
chore: remove autoindent for clarity
m-clare 8107dd6
fix: remove other formatting changes
m-clare 3eb6e75
fix: add in address sanitizer for ubuntu
m-clare 9f65c1a
fix: add configure opts for asan
m-clare d1f1e00
fix: set asan options
m-clare dffec52
fix: address comments, clarifying supp file lang
m-clare File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# This file contains suppressions for the default (with GIL) build to prevent runtime errors | ||
# when numpy is built with -Db_sanitize=undefined for arm64 architecture | ||
# | ||
# reference: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#available-checks | ||
|
||
# Per this prior discussion, integer overflow is not a concern | ||
# https://github.com/numpy/numpy/issues/24209#issuecomment-2160154181 | ||
signed-integer-overflow:* | ||
|
||
# all alignment runtime errors ignored in favor of this being tracked via TypeSanitizer | ||
# otherwise ubsan may detect system file alignment errors outside numpy | ||
alignment:* | ||
|
||
# suggested fix for runtime error: use INT_MIN constant | ||
shift-base:_core/src/umath/_rational_tests.c | ||
# suggested fix for runtime error: check for overflow if signed | ||
shift-base:_core/src/npymath/npy_math_internal.h | ||
|
||
# suggested fix for runtime error: null check before loop | ||
pointer-overflow:_core/src/common/simd/neon/memory.h | ||
pointer-overflow:_core/src/multiarray/datetime_busdaycal.c | ||
pointer-overflow:_core/src/multiarray/nditer_templ.c | ||
pointer-overflow:_core/src/multiarray/nditer_constr.c | ||
pointer-overflow:_core/src/umath/loops_arithm_fp.dispatch.c.src | ||
pointer-overflow:_core/src/umath/loops_unary.dispatch.c.src | ||
pointer-overflow:_core/src/umath/loops_unary_complex.dispatch.c.src | ||
pointer-overflow:_core/src/umath/loops_unary_fp_le.dispatch.c.src | ||
pointer-overflow:_core/src/umath/string_buffer.h | ||
pointer-overflow:linalg/umath_linalg.cpp | ||
pointer-overflow:numpy/random/bit_generator.pyx.c | ||
|
||
float-cast-overflow:_core/src/multiarray/lowlevel_strided_loops.c.src | ||
|
||
# flagged in CI - call to function through pointer to incorrect function type | ||
# Many functions in the modules/files listed below cause undefined behavior in CI | ||
# general disable this check until further investigation, but keep the specific files | ||
# as a starting point for resolving the checks later | ||
function:_core/src/* | ||
function:numpy/random/* | ||
# function:_core/src/common/cblasfunc.c | ||
# function:_core/src/common/npy_argparse.c | ||
# function:_core/src/multiarray/number.c | ||
# function:_core/src/multiarray/ctors.c | ||
# function:_core/src/multiarray/convert_datatype.c | ||
# function:_core/src/multiarray/dtype_transfer.c | ||
# function:_core/src/multiarray/dtype_traversal.c | ||
# function:_core/src/multiarray/getset.c | ||
# function:_core/src/multiarray/scalarapi.c | ||
# function:_core/src/multiarray/scalartypes.c.src | ||
# function:_core/src/umath/* | ||
# function:numpy/random/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This file contains suppressions for the default (with GIL) build to prevent runtime errors | ||
# when numpy is built with -Db_sanitize=undefined for x86_64 architecture | ||
# | ||
# reference: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#available-checks | ||
|
||
# Per this prior discussion, integer overflow is not a concern | ||
# https://github.com/numpy/numpy/issues/24209#issuecomment-2160154181 | ||
signed-integer-overflow:* | ||
|
||
# all alignment runtime errors ignored in favor of this being tracked via TypeSanitizer | ||
# otherwise ubsan may detect system file alignment errors outside numpy | ||
alignment:* | ||
|
||
# suggested fix for runtime error: replace left bit shift with LLONG_MIN constant | ||
shift-base:_core/src/common/simd/sse/arithmetic.h | ||
shift-base:_core/src/common/simd/avx2/arithmetic.h | ||
# suggested fix for runtime error: use INT_MIN constant | ||
shift-base:_core/src/umath/_rational_tests.c | ||
# suggested fix for runtime error: check for overflow if signed | ||
shift-base:_core/src/npymath/npy_math_internal.h | ||
|
||
|
||
# suggested fix for runtime error: check that pointer is not null before calling function | ||
nonnull-attribute:_core/src/multiarray/array_coercion.c | ||
nonnull-attribute:_core/src/multiarray/ctors.c | ||
nonnull-attribute:_core/src/multiarray/datetime_busdaycal.c | ||
nonnull-attribute:_core/src/multiarray/scalarapi.c | ||
nonnull-attribute:_core/src/multiarray/calculation.c | ||
|
||
# suggested fix for runtime error: null check before loop | ||
pointer-overflow:_core/src/multiarray/nditer_templ.c |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.