JuliaLinearAlgebra / libblastrampoline

Using PLT trampolines to provide a BLAS and LAPACK demuxing library.
MIT License
66 stars 17 forks source link

Turn off DEEPBIND for sanitizers? #47

Closed tkf closed 3 years ago

tkf commented 3 years ago

Since libblastrampoline always uses RTLD_DEEPBIND if available,

https://github.com/staticfloat/libblastrampoline/blob/23de7a09bf354fe6f655c457bab5bf47fdd2486d/src/dl_utils.c#L38-L39

it seems not possible to use it with sanitizers like ASAN https://github.com/google/sanitizers/issues/611. Julia's jl_dlopen automatically disables DEEPBIND when a sanitizer is enabled but that's detected at compile-time and so taking the same approach in a library like this may be hard.

Is it possible to have (say) an environment variable for turning off DEEPBIND at run-time? Skimming the source code for DEEPBINDLESS handling, it seems that there might be enough ingredients already?