This is an archive of the discontinued LLVM Phabricator instance.

[lit] Don't set DYLD_LIBRARY_PATH when DYLD_INSERT_LIBRARIES is set.
ClosedPublic

Authored by JDevlieghere on Aug 27 2019, 4:33 PM.

Details

Summary

Setting DYLD_INSERT_LIBRARIES to the Asan runtime and DYLD_LIBRARY_PATH to the LLVM shared library dir causes the test suite to crash with a segfault. We see this on the LLDB sanitized bot [1] on GreenDragon. I've spent some time investigating, but I'm not sure what's going on (yet).

Originally I thought this was because we were building compiler-rt and were loading an incompatible, just-built Asan library. However, the issue persists even without compiler-rt. It doesn't look like the Asan runtime is opening any other libraries that might be found in LLVM's shared library dir and talking to the team confirms that. Another possible explanation is that we're loading lldb form a place we don't expect, but that doesn't make sense either, because DYLD_LIBRARY_PATH is always set without the crash. I tried different Python versions and interpreters but the issue persist.

As a (temporary?) workaround I propose not setting DYLD_LIBRARY_PATH when DYLD_INSERT_LIBRARIES is set so we can turn the Asan bot on again and get useful results.

[1] http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-sanitized/

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.Aug 27 2019, 4:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 27 2019, 4:33 PM
Herald added a subscriber: abidh. · View Herald Transcript
aprantl accepted this revision.Aug 27 2019, 4:46 PM

It's a hack, but it's a well-documented one.

This revision is now accepted and ready to land.Aug 27 2019, 4:46 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 27 2019, 5:31 PM