Page MenuHomePhabricator

DWZ 06/06: Fix for symlinked .build-id/**.debug files
Changes PlannedPublic

Authored by jankratochvil on Feb 20 2018, 7:57 AM.

Details

Reviewers
labath
clayborg
Summary

So far /usr/lib/debug/.build-id/**.debug files could be opened any way. But with DWZ they can contain relative filename reference to /usr/lib/debug/.dwz/* files which then depends on whether the build-id .debug file is a symlink or not. Resolve the symlinks first before storing the filename for later references.

Without this fix I was getting:

warning: (x86_64) /usr/lib64/python3.6/lib-dynload/_heapq.cpython-36m-x86_64-linux-gnu.so Cannot get DWZ common file - file "/usr/lib/debug/.build-id/99/../../../../.dwz/python3-3.6.4-7.fc27.x86_64" cannot be opened

All DWZ patches are also applied in: git clone -b dwz git://git.jankratochvil.net/lldb

Diff Detail

Event Timeline

jankratochvil edited the summary of this revision. (Show Details)Feb 20 2018, 8:09 AM
labath added inline comments.Feb 21 2018, 8:41 AM
source/Host/common/Symbols.cpp
284–288

Do we need to check the equivalentness twice? My impression is that this function "sees through" symlinks (and even if it didn't, doing it post-resolve should be enough).

jankratochvil marked an inline comment as done.Feb 24 2018, 11:26 PM
jankratochvil added inline comments.
source/Host/common/Symbols.cpp
284–288

You are right, llvm::sys::fs::equivalent does st_dev+st_ino comparison.

jankratochvil marked an inline comment as done.
jankratochvil planned changes to this revision.Apr 14 2018, 4:22 AM
jankratochvil retitled this revision from DWZ 11/11: Fix for symlinked .build-id/**.debug files to DWZ 07/07: Fix for symlinked .build-id/**.debug files.
jankratochvil planned changes to this revision.Apr 30 2018, 2:23 PM

The testcase needs some updates after recent upstream testsuite changes.

jankratochvil retitled this revision from DWZ 07/07: Fix for symlinked .build-id/**.debug files to DWZ 06/06: Fix for symlinked .build-id/**.debug files.
jankratochvil set the repository for this revision to rLLDB LLDB.Aug 2 2018, 9:26 AM
jankratochvil added a project: Restricted Project.Aug 30 2018, 7:15 AM
jankratochvil planned changes to this revision.Jun 27 2019, 3:45 AM