-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
RTLD_DEEPBIND
breaks sanitizer builds
#83212
Comments
I don't think this should be a compile option, I think this is pointed at the fact that This should maybe be an option in the GDExtension library's config, so users can opt-in to this behavior, and we keep the safe default. |
Good idea! That would also allow different extensions with different settings. Incidental to this, regarding sanitizer builds: in order to retain stacktraces in Rust code, it's necessary to not unload the dynamic library. A longer explanation can be seen in godot-rust/gdext#133. I worked around this by applying a patch that removes these 3 lines: godot/drivers/unix/os_unix.cpp Lines 664 to 666 in b137180
It looks like this was encountered in the past by Godot users as well: #46140 (comment) It's relatively specific, but it might be something to think about if sanitizer builds + GDExtension are an officially supported setup. |
Sanitizer builds are a pretty specific use case, and you already have to compile Godot with a special compile option to enable them, so I think making this a compile-time decision makes sense. Although, I'd argue it shouldn't be a new option, I think if you use any of the san options when building Godot, it should automatically disable
I don't agree with this. What happens without To be clear, what happens without this option, is that Linux's dynamic linker will link any symbol in the GDExtension (defined or undefined) to a symbol in the main Godot executable with the same name. So, if you make a GDExtension that has a class called Nobody ever wants this behavior :-) I think it's only needed in sanitizer builds, because those builds are probably replacing So, again, I think it's sanitizer builds that are special here. |
So what should we do here? Special case it for builds with sanitizers enabled? We have the |
That was the original idea that @Bromeon and I discussed. I have it on my TODO to try a different potential solution to the original problem that doesn't involve |
I just posted PR #84210 which should disable |
Godot version
4.2-dev (7f4e700)
System information
Linux CI
Issue description
Change #82973 introduces a regression for a downstream memory-sanitizer job.
Here is an example of such a failed job, the error is:
While Godot CI runs sanitizer builds as well, I don't think they include GDExtension.
It would be nice if
scons
could be configured to not passRTLD_DEEPBIND
todlopen()
.Or maybe even better, automatically disable that behavior if any of the sanitizer flags is passed to
scons
.Since the code has this check, it might even be enough to pass
RTLD_DEEPBIND=0
as a global#define
?godot/drivers/unix/os_unix.cpp
Lines 84 to 86 in b137180
Steps to reproduce
Build Godot master with:
Load it with ASan/LSan environment variables, in a project that has a GDExtension.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: