-
Notifications
You must be signed in to change notification settings - Fork 9
PR for llvm/llvm-project#64388 #656
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
Merged
Conversation
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
f5b2574
to
a0a4a2c
Compare
LGTM |
`_MSC_VER>=1800` (Visual Studio 2013) supports atoll/strtoll. Remove the obsoleted workaround ASAN_INTERCEPT_ATOLL_AND_STRTOLL. test/asan/TestCases/atoll_strict.c passes but test/asan/TestCases/strtoll_strict.c doesn't. (cherry picked from commit 8033231240f223dc7c718d1d27ece2dbcc8057c6)
`strtol("0b1", 0, 0)` can be (pre-C23) 0 or (C23) 1. `sscanf("0b10", "%i", &x)` is similar. glibc 2.38 introduced `__isoc23_strtol` and `__isoc23_scanf` family functions for binary compatibility. When `_ISOC2X_SOURCE` is defined (implied by `_GNU_SOURCE`) or `__STDC_VERSION__ > 201710L`, `__GLIBC_USE_ISOC2X` is defined to 1 and these `__isoc23_*` symbols are used. Add `__isoc23_` versions for the following interceptors: * sanitizer_common_interceptors.inc implements strtoimax/strtoumax. Remove incorrect FIXME about google/sanitizers#321 * asan_interceptors.cpp implements just strtol and strtoll. The default `replace_str` mode checks `nptr` is readable and `endptr` is writable. atoi reuses the existing strtol interceptor. * msan_interceptors.cpp implements strtol family functions and their `_l` versions. Tested by lib/msan/tests/msan_test.cpp * sanitizer_common_interceptors.inc implements scanf family functions. The strtol family functions are spreaded, which is not great, but the patch (intended for release/17.x) does not attempt to address the issue. Add symbols to lib/sanitizer_common/symbolizer/scripts/global_symbols.txt to support both glibc pre-2.38 and 2.38. When build bots migrate to glibc 2.38+, we will lose test coverage for non-isoc23 versions since the existing C++ unittests imply `_GNU_SOURCE`. Add test/sanitizer_common/TestCases/{strtol.c,scanf.c}. They catch msan false positive in the absence of the interceptors. Fix llvm/llvm-project#64388 Fix llvm/llvm-project#64946 Link: https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00010.html ("The GNU C Library version 2.38 is now available") Reviewed By: #sanitizers, vitalybuka, mgorny Differential Revision: https://reviews.llvm.org/D158943 (cherry picked from commit ad7e2501000da2494860f06a306dfe8c08cc07c3)
…argets 8033231240f223dc7c718d1d27ece2dbcc8057c6 made this test pass in MinGW environments, even if it still is failing in MSVC environments. (cherry picked from commit 277fc9475fb89c0b80d4237dbc8d698a55203c0d)
SANITIZER_GLIBC is always defined so should be tested with an if not an ifdef. Fixes: ad7e2501000d Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D159041 (cherry picked from commit 692344d87357ded619d216b265a9375f4326d8fb)
a0a4a2c
to
9e54dd0
Compare
Hi @MaskRay It looks like this is causing a regression in Initial report: #566 (comment) |
requested a cherry-pick on llvm/llvm-project#64388 (comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
resolves llvm/llvm-project#64388