[issue45842] AddressSanitizer: bad-free - hello world c extension

Francesc Elies report at bugs.python.org
Tue Nov 30 02:12:30 EST 2021


Francesc Elies <francesc.elies at gmail.com> added the comment:

I am closing this one, bad-free is in this case a false positive.

Starting python and loading a dll which was linked with asan is incorrect.

One should asan-rt as earyly as possible, in order to do that in linux one should use LD_PRELOAD but in windows it's a bit more convoluted.

We made an executable which loads asan and instructed the dll DLLs to use the runtime linked into the main executable to avoid shadow memory collisions.

In the official docs https://clang.llvm.org/docs/AddressSanitizer.html I could not find much about asan with clang under windows. 

Despite the library file names where not the same as in llvm master and that the blogpost has msvc in mind instead of clang this blog https://devblogs.microsoft.com/cppblog/addresssanitizer-asan-for-windows-with-msvc/#contributions-to-asan-runtime pointed us in the right direction.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45842>
_______________________________________


More information about the Python-bugs-list mailing list