-
Notifications
You must be signed in to change notification settings - Fork 260
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
[BUG] False positive vptr errors with shared ubsan runtimes(which is the default) #2065
Comments
vptr check is part of ubsan, not sure why enabling ubsan doesn't trigger it. You might want to open a bug in llvm-project/issues for clarification |
but asan*.so is in NDK |
can i make vpt check no crash in android by use wrap.sh? |
That NDK is three and a half years old (and is based on an LLVM that's nearly five). There's a pretty good chance that the bug has been fixed since then. Have a look at https://github.com/android/ndk-samples/tree/main/sanitizers for the recommended way to use ubsan in apps. Note that ASan isn't supported any more, since HWASan is better in almost every way: http://go/android-dev/ndk/guides/memory-debug If you update to NDK r27 and UBSan still isn't able to catch the bug without ASan, attach a complete test case and we can re-open. It may just be the case that UBSan isn't able to catch this bug in every case though. There are a number of UBSan checks that can't be caught 100% reliably, but idk if this is one of them. |
I tried to upgrade to NDK r27, but there was still a problem.😢 |
Here is my demo,thanks |
Isn't this is the intended behavior? this bug is specifically caught by vptr sanitizer. |
Yeah, that's what |
You can take a look at the C++ code I attached at the beginning. This is the most common use of C++ polymorphism and should not be detected as an error; and I work normally on other platforms |
But my code should not be detected as errors |
Are you using fvisibility flag somewhere? there is a similar bug reported in: https://bugs.llvm.org/show_bug.cgi?id=39191 |
In fact, all my inheritances are in the same library, I didn't make calls across libraries, and I didn't proactively turn off visibility |
You can download the zip I sent earlier and check my compilation options |
As the current behavior of vptr relates to open source implementation of this sanitizer, it is better to create an issue in the llvm-project/issues repo. |
I have already asked a question on this page, but no one responded😢 |
Link? |
Link to what? |
The other bug you filed that you said has no response. We may be able to help with that. |
here:llvm/llvm-project#106933 |
Adding some folks from the sanitizer team: @eugenis @fmayer I was able to reproduce this on Android with the following command (nb: also push
Adding |
Description
Env Info:
Error Info:
C++ Code:
### cmake options:
described:
When I turned on one of the options separately, it worked well.Or if I turn off the vptr check, it can work well,but when i both open ASAN and UBASAN,the error coming...
Affected versions
Canary
Canary version
NDKr21e
Host OS
Mac
Host OS version
14.2.1
Affected ABIs
arm64-v8a
Build system
CMake
Other build system
No response
minSdkVersion
24
Device API level
No response
The text was updated successfully, but these errors were encountered: