-
Notifications
You must be signed in to change notification settings - Fork 1k
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
False positive when calling a function using dlsym #911
Comments
Off the top of my head I don't know if this is an expected/desired behavior of ubsan or not. |
Undefined behavior sanitizer claims not to produce false positives, yet this is a legitimate use of casts. When I asked about this on LLVM's IRC channel, they recommended putting in a report for it. |
I bet they actually meant to report at bugs.llvm.org (not sure if its easy to register a new account ) |
I can put it there (I already have an account), but I didn't see any category for sanitizer bugs... and isn't this project meant to track these issues with sanitizers? |
Yea, we kind of use both trackers interchangeably. This tracker is not-llvm-specific, e.g. gcc issues are also discussed here. |
@zygoloid: Ping. |
Sorry I missed this before. I would imagine the problem is that use of RTLD_LOCAL is causing the type_infos for the function types to not match across DSOs. This is likely not just an fsan problem; I'd expect (eg) a function pointer thrown from the DSO to not be caught outside it either. Maybe Clang needs to check whether a type_info object's type involves any user-defined types and force the use of string comparison for equality if not. Yuck. We should discuss this on the clang lists, maybe @rjmccall has a better idea. |
Just to state Richard's basic point explicitly: there's nothing wrong with this use of I think there are four key points in the analysis of this problem:
|
This does not seem to happen only with |
I ran into the same issue, but without the Note that this is extremely common for plugin systems where every plugin must provide some common functions which are then dlopen'ed later. Obviously |
We at the PyTorch project also ran into this. More context at pytorch/pytorch#28536 I'm planning to work around it by |
Has this effectively been accomplished in LLVM Clang 17 by llvm/llvm-project@46f366494f3c ? |
Workaround for known false-positive: google/sanitizers#911 Bug: chromium:348087176 Bug: chromium:42251292 Change-Id: I9c41b4608f079bd5eef9373e76c1e5ac218fffc1 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/194343 Reviewed-by: dan sinclair <[email protected]> Commit-Queue: Antonio Maiorano <[email protected]>
Code like this
gives the error
even though it's the standard way of invoking a function from
dlopen
.I put together a more complete example here.
The text was updated successfully, but these errors were encountered: