| Summary: | valgrind + AddressSanitizer: ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD. | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Graham Leggett <minfrin> |
| Component: | general | Assignee: | Julian Seward <jseward> |
| Status: | RESOLVED NOT A BUG | ||
| Severity: | normal | CC: | tom |
| Priority: | NOR | ||
| Version First Reported In: | 3.12.0 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Graham Leggett
2017-05-20 18:44:28 UTC
Using valgrind and asan together is never likely to work anyway. I haven't seen that error before but usually it falls over because the address space manipulation each tries to do is incompatible. By the way the specific problem you're seeing here is that asan is trying to make sure it's intercepting malloc etc but of course valgrind also wants to do the same thing and they can't both do so. Having completely rebuilt both gstreamer git-master and valgrind v3.12.0 from source using gcc v6.20 with AddressSanitizer disabled, I am still getting the same error: ==26049== ==26049==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD. ==26049== Jump to the invalid address stated on the next line ==26049== at 0x0: ??? ==26049== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==26049== ==26049== ==26049== Process terminating with default action of signal 11 (SIGSEGV) ==26049== Bad permissions for mapped region at address 0x0 ==26049== at 0x0: ??? ==26049== ==26049== HEAP SUMMARY: ==26049== in use at exit: 0 bytes in 0 blocks ==26049== total heap usage: 0 allocs, 0 frees, 0 bytes allocated ==26049== ==26049== All heap blocks were freed -- no leaks are possible ==26049== ==26049== For counts of detected and suppressed errors, rerun with: -v ==26049== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) Is there any mechanism to switch off AddressSanitizer, or at least get valgrind to coexist peacefully with AddressSanitizer on modern compilers? Turned out the session I was using to run valgrind had libasan preloaded with LD_PRELOAD, and this turns AddressSanitizer on and triggers this crash. Removing LD_PRELOAD produces the next crash, this time in valgrind: vex: priv/guest_arm_toIR.c:13352 (decode_V8_instruction): Assertion `szBlg2 <= 3' failed. vex storage: T total 243148328 bytes allocated vex storage: P total 0 bytes allocated valgrind: the 'impossible' happened: LibVEX called failure_exit(). Looks like this is this bug: https://bugs.kde.org/show_bug.cgi?id=372794 Building bleeding edge valgrind to see if that will get further... For the record, bug that prevents valgrind running raised with the RPi people here: https://bugs.kde.org/show_bug.cgi?id=380037 Let's try that again. For the record, the bug with the RPi people is here: https://github.com/RPi-Distro/repo/issues/68 At their suggestion moving /etc/ld.so.preload out of the way to prevent the loading the optimised RPi specific code causes valgrind to run successfully on the RPi. |