Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lldb] DebugInfoD tests & fixes (but with dwp testing disabled) #98344

Merged
merged 14 commits into from
Jul 10, 2024

Conversation

kevinfrei
Copy link
Contributor

This is all the tests and fixes I've had percolating since my first attempt at this in January. After 6 months of trying, I've given up on adding the ability to test DWP files in LLDB API tests. I've left both the tests (disabled) and the changes to Makefile.rules in place, in the hopes that someone who can configure the build bots will be able to enable the tests once a non-borked dwp tool is widely available.

Other than disabling the DWP tests, this continues to be the same diff that I've tried to land and not revert five times before. There are a couple of fixes that the testing exposed, and I've abandoned the DWP tests because I want to get those fixes finally upstreamed, as without them DebugInfoD is less useful.

@kevinfrei
Copy link
Contributor Author

@JDevlieghere or @clayborg if one of you could please approve & land this, I believe this disables the tests that caused the previous diff to be reverted.

@JDevlieghere JDevlieghere merged commit b9496a7 into llvm:main Jul 10, 2024
5 of 6 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 10, 2024

LLVM Buildbot has detected a new failure on builder lldb-aarch64-ubuntu running on linaro-lldb-aarch64-ubuntu while building lldb at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/1331

Here is the relevant piece of the build log for the reference:

Step 6 (test) failure: build (failure)
...
UNSUPPORTED: lldb-api :: commands/watchpoints/watchpoint_count/TestWatchpointCount.py (259 of 1992)
PASS: lldb-api :: commands/watchpoints/watchpoint_commands/command/TestWatchpointCommandPython.py (260 of 1992)
PASS: lldb-api :: commands/watchpoints/watchpoint_commands/TestWatchpointCommands.py (261 of 1992)
UNSUPPORTED: lldb-api :: commands/watchpoints/watchpoint_set_command/TestWatchLocationWithWatchSet.py (262 of 1992)
PASS: lldb-api :: commands/watchpoints/watchpoint_events/TestWatchpointEvents.py (263 of 1992)
PASS: lldb-api :: commands/watchpoints/watchpoint_on_vectors/TestValueOfVectorVariable.py (264 of 1992)
PASS: lldb-api :: commands/watchpoints/watchpoint_disable/TestWatchpointDisable.py (265 of 1992)
PASS: lldb-api :: commands/watchpoints/multiple_threads/TestWatchpointMultipleThreads.py (266 of 1992)
UNSUPPORTED: lldb-api :: driver/batch_mode/TestBatchMode.py (267 of 1992)
UNRESOLVED: lldb-api :: debuginfod/SplitDWARF/TestDebuginfodDWP.py (268 of 1992)
******************** TEST 'lldb-api :: debuginfod/SplitDWARF/TestDebuginfodDWP.py' FAILED ********************
Script:
--
/usr/bin/python3.8 /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env ARCHIVER=/usr/local/bin/llvm-ar --env OBJCOPY=/usr/bin/llvm-objcopy --env LLVM_LIBS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib --env LLVM_INCLUDE_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/include --env LLVM_TOOLS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin --arch aarch64 --build-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex --lldb-module-cache-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/lldb --compiler /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/clang --dsymutil /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/dsymutil --llvm-tools-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin --lldb-obj-root /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb --lldb-libs-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -p TestDebuginfodDWP.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 19.0.0git (https://github.com/llvm/llvm-project.git revision b9496a74eb4029629ca2e440c5441614e766f773)
  clang revision b9496a74eb4029629ca2e440c5441614e766f773
  llvm revision b9496a74eb4029629ca2e440c5441614e766f773
Skipping the following test categories: ['libc++', 'dsym', 'gmodules', 'debugserver', 'objc']

--
Command Output (stderr):
--
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_debuginfod_both_okd_symfiles_from_service (TestDebuginfodDWP.DebugInfodDWPTests) (requires curl) 
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_debuginfod_both_symfiles_from_service (TestDebuginfodDWP.DebugInfodDWPTests) (requires curl) 
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_debuginfod_dwp_from_service (TestDebuginfodDWP.DebugInfodDWPTests) (requires curl) 
FAIL: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_normal_stripped (TestDebuginfodDWP.DebugInfodDWPTests)
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_normal_stripped_only_dwp (TestDebuginfodDWP.DebugInfodDWPTests) (requires one of linux_freebsd_but_old_dwp_tools_on_build_bots_are_broken) 
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_normal_stripped_split_with_dwp (TestDebuginfodDWP.DebugInfodDWPTests) (requires one of linux_freebsd_but_old_dwp_tools_on_build_bots_are_broken) 
======================================================================
ERROR: test_normal_stripped (TestDebuginfodDWP.DebugInfodDWPTests)
   Validate behavior with a stripped binary, no symbols or symbol locator.
----------------------------------------------------------------------
Error when building test subject.

Build Command:
make VPATH=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -C /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/debuginfod/SplitDWARF/TestDebuginfodDWP.test_normal_stripped -I /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -I /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make -f /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF/Makefile all ARCH=aarch64 'CC="/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang"' CLANG_MODULE_CACHE_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api LLDB_OBJ_ROOT=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb OS=Linux HOST_OS=Linux

Build Command Output:
make: Entering directory '/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/debuginfod/SplitDWARF/TestDebuginfodDWP.test_normal_stripped'
"/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang" -g -O0  -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../../include -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/include -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make -include /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h  -fno-limit-debug-info  -gsplit-dwarf  -MT main.o -MD -MP -MF main.d -c -o main.o /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF/main.c
"/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang"  main.o -g -O0  -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../../include -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/include -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make -include /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h  -fno-limit-debug-info  -gsplit-dwarf    --driver-mode=g++ -Wl,--build-id -o "a.out"
cp "a.out" "a.out.unstripped"
/usr/bin/llvm-objcopy --only-keep-debug "a.out" "a.out.debug"
/usr/bin/llvm-objcopy --strip-debug --add-gnu-debuglink="a.out.debug" "a.out" "a.out"

keith added a commit to keith/llvm-project that referenced this pull request Jul 10, 2024
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 10, 2024

LLVM Buildbot has detected a new failure on builder lldb-arm-ubuntu running on linaro-lldb-arm-ubuntu while building lldb at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/616

Here is the relevant piece of the build log for the reference:

Step 6 (test) failure: build (failure)
...
PASS: lldb-api :: commands/watchpoints/watchpoint_commands/condition/TestWatchpointConditionCmd.py (260 of 2751)
PASS: lldb-api :: commands/watchpoints/watchpoint_commands/command/TestWatchpointCommandPython.py (261 of 2751)
UNSUPPORTED: lldb-api :: commands/watchpoints/watchpoint_count/TestWatchpointCount.py (262 of 2751)
PASS: lldb-api :: commands/watchpoints/watchpoint_disable/TestWatchpointDisable.py (263 of 2751)
PASS: lldb-api :: commands/watchpoints/watchpoint_events/TestWatchpointEvents.py (264 of 2751)
UNSUPPORTED: lldb-api :: commands/watchpoints/watchpoint_set_command/TestWatchLocationWithWatchSet.py (265 of 2751)
PASS: lldb-api :: commands/watchpoints/watchpoint_on_vectors/TestValueOfVectorVariable.py (266 of 2751)
PASS: lldb-api :: debuginfod/Normal/TestDebuginfod.py (267 of 2751)
PASS: lldb-api :: commands/watchpoints/watchpoint_size/TestWatchpointSizes.py (268 of 2751)
UNRESOLVED: lldb-api :: debuginfod/SplitDWARF/TestDebuginfodDWP.py (269 of 2751)
******************** TEST 'lldb-api :: debuginfod/SplitDWARF/TestDebuginfodDWP.py' FAILED ********************
Script:
--
/usr/bin/python3.8 /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env ARCHIVER=/usr/local/bin/llvm-ar --env OBJCOPY=/usr/bin/llvm-objcopy --env LLVM_LIBS_DIR=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./lib --env LLVM_INCLUDE_DIR=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/include --env LLVM_TOOLS_DIR=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin --arch armv8l --build-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex --lldb-module-cache-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin/lldb --compiler /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin/clang --dsymutil /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin/dsymutil --llvm-tools-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./bin --lldb-obj-root /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb --lldb-libs-dir /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/./lib /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -p TestDebuginfodDWP.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 19.0.0git (https://github.com/llvm/llvm-project.git revision b9496a74eb4029629ca2e440c5441614e766f773)
  clang revision b9496a74eb4029629ca2e440c5441614e766f773
  llvm revision b9496a74eb4029629ca2e440c5441614e766f773
Skipping the following test categories: ['libc++', 'dsym', 'gmodules', 'debugserver', 'objc']

--
Command Output (stderr):
--
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_debuginfod_both_okd_symfiles_from_service (TestDebuginfodDWP.DebugInfodDWPTests) (requires curl) 
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_debuginfod_both_symfiles_from_service (TestDebuginfodDWP.DebugInfodDWPTests) (requires curl) 
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_debuginfod_dwp_from_service (TestDebuginfodDWP.DebugInfodDWPTests) (requires curl) 
FAIL: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_normal_stripped (TestDebuginfodDWP.DebugInfodDWPTests)
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_normal_stripped_only_dwp (TestDebuginfodDWP.DebugInfodDWPTests) (requires one of linux_freebsd_but_old_dwp_tools_on_build_bots_are_broken) 
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_normal_stripped_split_with_dwp (TestDebuginfodDWP.DebugInfodDWPTests) (requires one of linux_freebsd_but_old_dwp_tools_on_build_bots_are_broken) 
======================================================================
ERROR: test_normal_stripped (TestDebuginfodDWP.DebugInfodDWPTests)
   Validate behavior with a stripped binary, no symbols or symbol locator.
----------------------------------------------------------------------
Error when building test subject.

Build Command:
make VPATH=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -C /home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex/debuginfod/SplitDWARF/TestDebuginfodDWP.test_normal_stripped -I /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -I /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make -f /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF/Makefile all ARCH=armv8l 'CC="/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang"' CLANG_MODULE_CACHE_DIR=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api LLDB_OBJ_ROOT=/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb OS=Linux HOST_OS=Linux

Build Command Output:
make: Entering directory '/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/lldb-test-build.noindex/debuginfod/SplitDWARF/TestDebuginfodDWP.test_normal_stripped'
"/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang" -g -O0  -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../../include -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/include -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make -include /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h  -fno-limit-debug-info  -gsplit-dwarf  -MT main.o -MD -MP -MF main.d -c -o main.o /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF/main.c
"/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang"  main.o -g -O0  -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../../include -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/tools/lldb/include -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -I/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make -include /home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h  -fno-limit-debug-info  -gsplit-dwarf    --driver-mode=g++ -Wl,--build-id -o "a.out"
cp "a.out" "a.out.unstripped"
/usr/bin/llvm-objcopy --only-keep-debug "a.out" "a.out.debug"
/usr/bin/llvm-objcopy --strip-debug --add-gnu-debuglink="a.out.debug" "a.out" "a.out"

@kevinfrei
Copy link
Contributor Author

"fixed forward" with PR98351 if someone can approve & land that (it just disabled the baseline test for DWP stuff, as well: I missed it because the dwp tests run on all the machines I have access to :/ )

clayborg pushed a commit that referenced this pull request Jul 10, 2024
This should disable the failing test on the ubuntu build bots
@JDevlieghere (I forgot to disable the 'baseline' test, as it tests the
debugger's basic handling of DWP files, but again, the API
infrastructure doesn't quite support DWP generation)

#98344 (comment)
@kevinfrei kevinfrei deleted the debuginfod-no-dwp-testing branch July 10, 2024 22:01
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
…#98344)

This is all the tests and fixes I've had percolating since my first
attempt at this in January. After 6 months of trying, I've given up on
adding the ability to test DWP files in LLDB API tests. I've left both
the tests (disabled) and the changes to Makefile.rules in place, in the
hopes that someone who can configure the build bots will be able to
enable the tests once a non-borked dwp tool is widely available.

Other than disabling the DWP tests, this continues to be the same diff
that I've tried to land and
[not](llvm#90622)
[revert](llvm#87676)
[five](llvm#86812)
[times](llvm#85693)
[before](llvm#96802). There are a
couple of fixes that the testing exposed, and I've abandoned the DWP
tests because I want to get those fixes finally upstreamed, as without
them DebugInfoD is less useful.
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
This should disable the failing test on the ubuntu build bots
@JDevlieghere (I forgot to disable the 'baseline' test, as it tests the
debugger's basic handling of DWP files, but again, the API
infrastructure doesn't quite support DWP generation)

llvm#98344 (comment)
walter-erquinigo added a commit that referenced this pull request Jul 16, 2024
This reverts commit 2fa1220.
This reverts commit b9496a7.

The patch #98344 causes a crash in LLDB when parsing some files like `numpy.libs/libgfortran-daac5196.so.5.0.0` on graviton (you can download it in https://drive.google.com/file/d/12ygLjJwWpzdYsrzBPp1JGiFHxcgM0-XY/view?usp=drive_link if you want to troubleshoot yourself).

The assert that is hit is the following:

```
llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2452: std::pair<unsigned int, std::map<long unsigned int, lldb_private::AddressClass> > ObjectFileELF::ParseSymbolTable(lldb_private::Symtab*, lldb::user_id_t, lldb_private::Section*): Assertion `strtab->GetObjectFile() == this' failed.
[383588:383636:20240716,025305.572639:ERROR crashpad_client_linux.cc:780] Crashpad isn't enabled
```

This object file doesn't have apparently a strings table but LLDB still tries to process it due to the code that is being reverted.
@walter-erquinigo
Copy link
Member

walter-erquinigo commented Jul 16, 2024

@kevinfrei , I'm so sorry to tell you that I have reverted this patch. The revert commit is 27b2f4f and I left some notes there, which I also copy here:

The patch #98344 causes a crash in LLDB when parsing some files like numpy.libs/libgfortran-daac5196.so.5.0.0 on graviton (you can download it in https://drive.google.com/file/d/12ygLjJwWpzdYsrzBPp1JGiFHxcgM0-XY/view?usp=drive_link if you want to troubleshoot yourself).

The assert that is hit is the following:

```
llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2452: std::pair<unsigned int, std::map<long unsigned int, lldb_private::AddressClass> > ObjectFileELF::ParseSymbolTable(lldb_private::Symtab*, lldb::user_id_t, lldb_private::Section*): Assertion `strtab->GetObjectFile() == this' failed.

@kevinfrei
Copy link
Contributor Author

@kevinfrei , I'm so sorry to tell you that I have reverted this patch. The revert commit is 27b2f4f and I left some notes there, which I also copy here:

The patch #98344 causes a crash in LLDB when parsing some files like numpy.libs/libgfortran-daac5196.so.5.0.0 on graviton (you can download it in https://drive.google.com/file/d/12ygLjJwWpzdYsrzBPp1JGiFHxcgM0-XY/view?usp=drive_link if you want to troubleshoot yourself).

The assert that is hit is the following:

llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2452: std::pair<unsigned int, std::map<long unsigned int, lldb_private::AddressClass> > ObjectFileELF::ParseSymbolTable(lldb_private::Symtab*, lldb::user_id_t, lldb_private::Section*): Assertion `strtab->GetObjectFile() == this' failed.

Reverted with a repro instead of some inscrutable "This didn't work on a build machine configured by someone 4 years ago who promptly forgot what they did and there's no documentation, but here's this log: good luck!" is glorious! I'll get on it- thanks 😃

@walter-erquinigo
Copy link
Member

@kevinfrei , I'm glad I can be of help to you! Let me know if you want me to try out your next iteration of this PR on my device.

yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Summary:
This reverts commit 2fa1220.
This reverts commit b9496a7.

The patch #98344 causes a crash in LLDB when parsing some files like `numpy.libs/libgfortran-daac5196.so.5.0.0` on graviton (you can download it in https://drive.google.com/file/d/12ygLjJwWpzdYsrzBPp1JGiFHxcgM0-XY/view?usp=drive_link if you want to troubleshoot yourself).

The assert that is hit is the following:

```
llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2452: std::pair<unsigned int, std::map<long unsigned int, lldb_private::AddressClass> > ObjectFileELF::ParseSymbolTable(lldb_private::Symtab*, lldb::user_id_t, lldb_private::Section*): Assertion `strtab->GetObjectFile() == this' failed.
[383588:383636:20240716,025305.572639:ERROR crashpad_client_linux.cc:780] Crashpad isn't enabled
```

This object file doesn't have apparently a strings table but LLDB still tries to process it due to the code that is being reverted.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60251733
JDevlieghere pushed a commit that referenced this pull request Aug 6, 2024
…ing with stripped binaries (#99362)

@walter-erquinigo found the the [PR with testing and a fix for
DebugInfoD](#98344) caused an
issue when working with stripped binaries.

The issue is that when you're working with split-dwarf, there are *3*
possible files: The stripped binary the user is debugging, the
"only-keep-debug" *or* unstripped binary, plus the `.dwp` file. The
debuginfod plugin should provide the unstripped/OKD binary. However, if
the debuginfod plugin fails, the default symbol locator plugin will just
return the stripped binary, which doesn't help. So, to address that, the
SymbolVendorELF code checks to see if the SymbolLocator's
ExecutableObjectFile request returned the same file, and bails if that's
the case. You can see the specific diff as the second commit in the PR.

I'm investigating adding a test: I can't quite get a simple repro, and
I'm unwilling to make any additional changes to Makefile.rules to this
diff, for Pavlovian reasons.
banach-space pushed a commit to banach-space/llvm-project that referenced this pull request Aug 7, 2024
…ing with stripped binaries (llvm#99362)

@walter-erquinigo found the the [PR with testing and a fix for
DebugInfoD](llvm#98344) caused an
issue when working with stripped binaries.

The issue is that when you're working with split-dwarf, there are *3*
possible files: The stripped binary the user is debugging, the
"only-keep-debug" *or* unstripped binary, plus the `.dwp` file. The
debuginfod plugin should provide the unstripped/OKD binary. However, if
the debuginfod plugin fails, the default symbol locator plugin will just
return the stripped binary, which doesn't help. So, to address that, the
SymbolVendorELF code checks to see if the SymbolLocator's
ExecutableObjectFile request returned the same file, and bails if that's
the case. You can see the specific diff as the second commit in the PR.

I'm investigating adding a test: I can't quite get a simple repro, and
I'm unwilling to make any additional changes to Makefile.rules to this
diff, for Pavlovian reasons.
TIFitis pushed a commit that referenced this pull request Aug 8, 2024
…ing with stripped binaries (#99362)

@walter-erquinigo found the the [PR with testing and a fix for
DebugInfoD](#98344) caused an
issue when working with stripped binaries.

The issue is that when you're working with split-dwarf, there are *3*
possible files: The stripped binary the user is debugging, the
"only-keep-debug" *or* unstripped binary, plus the `.dwp` file. The
debuginfod plugin should provide the unstripped/OKD binary. However, if
the debuginfod plugin fails, the default symbol locator plugin will just
return the stripped binary, which doesn't help. So, to address that, the
SymbolVendorELF code checks to see if the SymbolLocator's
ExecutableObjectFile request returned the same file, and bails if that's
the case. You can see the specific diff as the second commit in the PR.

I'm investigating adding a test: I can't quite get a simple repro, and
I'm unwilling to make any additional changes to Makefile.rules to this
diff, for Pavlovian reasons.
kstoimenov pushed a commit to kstoimenov/llvm-project that referenced this pull request Aug 15, 2024
…ing with stripped binaries (llvm#99362)

@walter-erquinigo found the the [PR with testing and a fix for
DebugInfoD](llvm#98344) caused an
issue when working with stripped binaries.

The issue is that when you're working with split-dwarf, there are *3*
possible files: The stripped binary the user is debugging, the
"only-keep-debug" *or* unstripped binary, plus the `.dwp` file. The
debuginfod plugin should provide the unstripped/OKD binary. However, if
the debuginfod plugin fails, the default symbol locator plugin will just
return the stripped binary, which doesn't help. So, to address that, the
SymbolVendorELF code checks to see if the SymbolLocator's
ExecutableObjectFile request returned the same file, and bails if that's
the case. You can see the specific diff as the second commit in the PR.

I'm investigating adding a test: I can't quite get a simple repro, and
I'm unwilling to make any additional changes to Makefile.rules to this
diff, for Pavlovian reasons.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants