Skip to content

[StandardInstrumentations] Ensure non-null module pointer when getting display name for IR file #110779

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

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

duk-37
Copy link
Contributor

@duk-37 duk-37 commented Oct 2, 2024

Fixes a crash when using -filter-print-funcs with -ir-dump-directory. A quick reproducer on trunk (also included as a test):

; opt -passes=no-op-function -print-after=no-op-function -filter-print-funcs=nope -ir-dump-directory=somewhere test.ll

define void @test() {
    ret void
}

Compiler Explorer

…g display name for IR file

Fixes a crash when using -filter-print-funcs with -ir-dump-directory.
@duk-37 duk-37 force-pushed the force-module-for-display-name branch from 2e3fe7c to 2c8c0d3 Compare October 2, 2024 01:56
@duk-37 duk-37 requested a review from aeubanks October 2, 2024 01:57
@@ -0,0 +1,14 @@
;; Make sure we can run -filter-print-funcs with -ir-dump-directory.
; RUN: rm -rf %t/logs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to mkdir %t/logs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's automatically generated by -ir-dump-directory, so I don't think so.

@duk-37
Copy link
Contributor Author

duk-37 commented Oct 2, 2024

FYI I don't have commit access for the time being, so if this looks good it'd be great if you could merge it in @aeubanks :)

@aeubanks aeubanks merged commit 0004fba into llvm:main Oct 2, 2024
6 of 8 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 2, 2024

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

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

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
UNSUPPORTED: lldb-api :: lang/cpp/const_static_integral_member_int128/TestConstStaticIntegralMemberInt128.py (759 of 2813)
PASS: lldb-api :: lang/cpp/constructors/TestCppConstructors.py (760 of 2813)
PASS: lldb-api :: lang/cpp/const_this/TestConstThis.py (761 of 2813)
PASS: lldb-api :: lang/cpp/covariant-return-types/TestCovariantReturnTypes.py (762 of 2813)
PASS: lldb-api :: lang/cpp/crtp/TestCppCRTP.py (763 of 2813)
PASS: lldb-api :: lang/cpp/default-template-args/TestDefaultTemplateArgs.py (764 of 2813)
PASS: lldb-api :: lang/cpp/dereferencing_references/TestCPPDereferencingReferences.py (765 of 2813)
PASS: lldb-api :: lang/cpp/diamond/TestCppDiamond.py (766 of 2813)
PASS: lldb-api :: lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py (767 of 2813)
PASS: lldb-api :: lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py (768 of 2813)
FAIL: lldb-api :: lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py (769 of 2813)
******************** TEST 'lldb-api :: lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py' FAILED ********************
Script:
--
/usr/bin/python3.10 /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/lang/c/shared_lib_stripped_symbols -p TestSharedLibStrippedSymbols.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 20.0.0git (https://github.com/llvm/llvm-project.git revision 0004fba07972eb521b43d4336e6a9eff7e512ff8)
  clang revision 0004fba07972eb521b43d4336e6a9eff7e512ff8
  llvm revision 0004fba07972eb521b43d4336e6a9eff7e512ff8
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_expr_dsym (TestSharedLibStrippedSymbols.SharedLibStrippedTestCase) (test case does not fall in any category of interest for this run) 
FAIL: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_expr_dwarf (TestSharedLibStrippedSymbols.SharedLibStrippedTestCase)
FAIL: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_expr_dwo (TestSharedLibStrippedSymbols.SharedLibStrippedTestCase)
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_frame_variable_dsym (TestSharedLibStrippedSymbols.SharedLibStrippedTestCase) (test case does not fall in any category of interest for this run) 
XFAIL: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_frame_variable_dwarf (TestSharedLibStrippedSymbols.SharedLibStrippedTestCase)
XFAIL: LLDB (/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang-arm) :: test_frame_variable_dwo (TestSharedLibStrippedSymbols.SharedLibStrippedTestCase)
======================================================================
FAIL: test_expr_dwarf (TestSharedLibStrippedSymbols.SharedLibStrippedTestCase)
   Test that types work when defined in a shared library and forwa/d-declared in the main executable
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1769, in test_method
    return attrvalue(self)
  File "/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/test/API/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py", line 24, in test_expr
    self.expect(
  File "/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2370, in expect
    self.runCmd(
  File "/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1000, in runCmd
    self.assertTrue(self.res.Succeeded(), msg + output)
AssertionError: False is not true : Variable(s) displayed correctly
Error output:

@duk-37 duk-37 deleted the force-module-for-display-name branch October 2, 2024 12:08
Sterling-Augustine pushed a commit to Sterling-Augustine/llvm-project that referenced this pull request Oct 3, 2024
…g display name for IR file (llvm#110779)

Fixes a crash when using `-filter-print-funcs` with
`-ir-dump-directory`. A quick reproducer on trunk (also included as a
test):

```ll
; opt -passes=no-op-function -print-after=no-op-function -filter-print-funcs=nope -ir-dump-directory=somewhere test.ll

define void @test() {
    ret void
}
```

[Compiler Explorer](https://godbolt.org/z/sPErz44h4)
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.

3 participants