-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
subtraction of unsigned offset overflow false alarm at -O2 and -O3 #98445
Comments
Could you please try 18 or |
I cannot reproduce this with clang-19.
|
I tried clang-14 and trunk here https://godbolt.org/z/WKsav9387 |
Sorry, the runtime error message is in exec.err. Here is the updated console. $ ../compiler-builds/llvmorg-14.0.6_build/bin/clang -fsanitize=undefined -fsanitize=address --rtlib=compiler-rt -g -lgcc_s -O2 testcase.c -o exec
$ timeout 1s ./exec 2>exec.err
$ cat exec.err
testcase.c:13:7: runtime error: subtraction of unsigned offset from 0x7ffe760240e0 overflowed to 0x7ffe760240f8 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior analysis/test960851-m.c:13:7 in AddressSanitizer:DEADLYSIGNAL ================================================================= ==351086==ERROR: AddressSanitizer: SEGV on unknown address 0x000041b58ab3 (pc 0x000041b58ab3 bp 0x7ffe76024190 sp 0x7ffe760240c8 T0) ==351086==The signal is caused by a READ memory access. AddressSanitizer:DEADLYSIGNAL AddressSanitizer: nested bug in the same thread, aborting.
$ ../compiler-builds/llvmorg-13.0.1_build/bin/clang -fsanitize=undefined -fsanitize=address --rtlib=compiler-rt -g -lgcc_s -O2 testcase.c -o exec
$ timeout 1s ./exec 2>exec.err
$ cat exec.err |
Even 18 is near end of maintenance. |
It seems to me that the infinite loop affected UBSAN to report undefined behaviors in clang-14. |
Hello, we are using clang to compile the above code in Ubuntu 22.04.3 LTS.
We found a case that there are discrepancies when compiling with llvmorg-14.0.6 at -O2 and -O3.
Is the discrepancy caused by infinite loop in the program? since the behavior is undefined before P2809.
The text was updated successfully, but these errors were encountered: