Page MenuHomePhabricator

ayermolo (Alexander Yermolovich)
User

Projects

User does not belong to any projects.

User Details

User Since
Aug 25 2020, 4:03 PM (96 w, 6 d)

Recent Activity

Today

ayermolo added a comment to D129089: [BOLT] Fix concurrency bugs in the instrumentation runtime.

@ayermolo The runtime libs such as instrumentation must not depend on external libraries like libstdc++. But in our (currently internal) implementation we are using __atomic_test_and_set, I think it is better option here which eliminates inline asm usage and is arch independent

Tue, Jul 5, 10:09 AM · Restricted Project, Restricted Project

Yesterday

ayermolo added a comment to D129089: [BOLT] Fix concurrency bugs in the instrumentation runtime.

Why can't we use standard std::lock_guard here?

Mon, Jul 4, 9:30 AM · Restricted Project, Restricted Project

Thu, Jun 30

ayermolo committed rGe159abdb0400: [BOLT][DWARF] Support mix mode DWARF (authored by ayermolo).
[BOLT][DWARF] Support mix mode DWARF
Thu, Jun 30, 4:54 PM · Restricted Project
ayermolo closed D128232: [BOLT][DWARF] Support mix mode DWARF.
Thu, Jun 30, 4:53 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D128232: [BOLT][DWARF] Support mix mode DWARF.

addressed nit

Thu, Jun 30, 4:30 PM · Restricted Project, Restricted Project

Mon, Jun 27

ayermolo committed rGbecbbb7e3c81: Round up zero-sized symbols to 1 byte in `.debug_aranges` (without breaking… (authored by pcwalton).
Round up zero-sized symbols to 1 byte in `.debug_aranges` (without breaking…
Mon, Jun 27, 10:02 AM · Restricted Project, Restricted Project
ayermolo closed D126835: Round up zero-sized symbols to 1 byte in `.debug_aranges` (without breaking other logic)..
Mon, Jun 27, 10:02 AM · Restricted Project, Restricted Project

Fri, Jun 24

ayermolo committed rG11a8dd65ec60: [BOLT][DWARF] Add support for DW_AT_call_pc/DW_AT_call_return_pc (authored by ayermolo).
[BOLT][DWARF] Add support for DW_AT_call_pc/DW_AT_call_return_pc
Fri, Jun 24, 12:39 PM · Restricted Project
ayermolo closed D128526: [BOLT][DWARF] Add support for DW_AT_call_pc/DW_AT_call_return_pc.
Fri, Jun 24, 12:39 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D128526: [BOLT][DWARF] Add support for DW_AT_call_pc/DW_AT_call_return_pc.

nits

Fri, Jun 24, 12:10 PM · Restricted Project, Restricted Project
ayermolo added a comment to D126835: Round up zero-sized symbols to 1 byte in `.debug_aranges` (without breaking other logic)..

The test failures in libomp don't look related to me.

Fri, Jun 24, 11:34 AM · Restricted Project, Restricted Project
ayermolo requested review of D128526: [BOLT][DWARF] Add support for DW_AT_call_pc/DW_AT_call_return_pc.
Fri, Jun 24, 6:54 AM · Restricted Project, Restricted Project

Thu, Jun 23

ayermolo added a comment to D126835: Round up zero-sized symbols to 1 byte in `.debug_aranges` (without breaking other logic)..

Looks like this would be another issue with zero-length symbols: https://reviews.llvm.org/D127897 (just cross-referencing/collating)

Well it's an issue right now even without this change.

Sorry, what I meant is: This issue (D126835) and the other (D127897) would probably both be better-off solved by changing the compiler/LLVM to never produce zero-length entries.

Oh I see.
Some more context. Debug info that D127897 is handling is coming from GCC.

Oh, that surprises me - could you provide repro steps?

int conv32(const void* ptr) { return *(const int *) ptr; }

int foo(const void* ptr) {
  return conv32(ptr) + 2;
}

gcc -g -gstrict-dwarf -gz=none -O3 helper.cpp -c
Version 11.2.1

Huh - I'd argue that's /probably/ a bug in GCC? Describing a zero-length inlined scope seems of minimal value. I guess some very late optimization probably causes this in GCC. Might be worth filing a bug on GCC or otherwise asking them about that situation (if you do, please CC me - I'd be curious to follow along).

Thu, Jun 23, 5:08 PM · Restricted Project, Restricted Project
ayermolo added a comment to D127889: [LLDB] Handle DIE with DW_AT_low_pc and empty ranges.

I've reverted this due to failures on our bots: https://lab.llvm.org/buildbot/#/builders/96/builds/25032/steps/6/logs/stdio

/usr/bin/ld: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/Commands/Output/dwarf5-low-pc-ranges-inlining.test.tmp.dir/main5.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/Commands/Output/dwarf5-low-pc-ranges-inlining.test.tmp.dir/main5.o: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status

I think that the system ld is expecting an AArch64 format object here. Perhaps you could use lld instead given that we always build that when running the lldb tests?

Also I'm pretty sure you'll need to require the x86 target in llvm as well. The test will fail if this is an AArch64 target only build for example.

Thu, Jun 23, 6:52 AM · Restricted Project, Restricted Project

Wed, Jun 22

ayermolo committed rG130167ed1eff: [LLDB] Handle DIE with DW_AT_low_pc and empty ranges (authored by ayermolo).
[LLDB] Handle DIE with DW_AT_low_pc and empty ranges
Wed, Jun 22, 10:55 AM · Restricted Project
ayermolo closed D127889: [LLDB] Handle DIE with DW_AT_low_pc and empty ranges.
Wed, Jun 22, 10:55 AM · Restricted Project, Restricted Project
ayermolo added a comment to D126835: Round up zero-sized symbols to 1 byte in `.debug_aranges` (without breaking other logic)..

Looks like this would be another issue with zero-length symbols: https://reviews.llvm.org/D127897 (just cross-referencing/collating)

Well it's an issue right now even without this change.

Sorry, what I meant is: This issue (D126835) and the other (D127897) would probably both be better-off solved by changing the compiler/LLVM to never produce zero-length entries.

Oh I see.
Some more context. Debug info that D127897 is handling is coming from GCC.

Oh, that surprises me - could you provide repro steps?

Wed, Jun 22, 10:33 AM · Restricted Project, Restricted Project
ayermolo added a comment to D126835: Round up zero-sized symbols to 1 byte in `.debug_aranges` (without breaking other logic)..

Looks like this would be another issue with zero-length symbols: https://reviews.llvm.org/D127897 (just cross-referencing/collating)

Well it's an issue right now even without this change.

Sorry, what I meant is: This issue (D126835) and the other (D127897) would probably both be better-off solved by changing the compiler/LLVM to never produce zero-length entries.

Oh I see.
Some more context. Debug info that D127897 is handling is coming from GCC.

Long term @zr33 (our summer intern) is working on mechanism to write out .debug_Info/.debug_abbrev using the same mechanics as in codegen/dwarflinker.
Once that is enabled we can leave this pattern as is without converting to ranges.

Still not really following - "converting to ranges" as in "changing consumers to use ranges instead of aranges"? sure - though I think that change would be a good thing in general, since aranges take up a bunch of object space.

My bad I should have been more clear.. This is just what BOLT does. We convert DW_AT_low_pc/DW_AT_high_pc to DW_AT_low_pc/DW_AT_ranges.. This is because BOLT can break up functions.
Due to the limits of our current implementation if DIEs share a an abbrev table we must convert all of them.

Wed, Jun 22, 8:36 AM · Restricted Project, Restricted Project

Tue, Jun 21

ayermolo updated subscribers of D126835: Round up zero-sized symbols to 1 byte in `.debug_aranges` (without breaking other logic)..

Looks like this would be another issue with zero-length symbols: https://reviews.llvm.org/D127897 (just cross-referencing/collating)

Tue, Jun 21, 5:00 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D128232: [BOLT][DWARF] Support mix mode DWARF.

changed debug-line checks not to include offsets

Tue, Jun 21, 4:42 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D128232: [BOLT][DWARF] Support mix mode DWARF.

got order wrong

Tue, Jun 21, 4:15 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D128232: [BOLT][DWARF] Support mix mode DWARF.

seeing what's in line-str

Tue, Jun 21, 3:58 PM · Restricted Project, Restricted Project
ayermolo retitled D128232: [BOLT][DWARF] Support mix mode DWARF from [BOLT][DWARF] Support mix mode monolithic DWARF to [BOLT][DWARF] Support mix mode DWARF.
Tue, Jun 21, 3:02 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D128232: [BOLT][DWARF] Support mix mode DWARF.

Added test for split dwarf.

Tue, Jun 21, 3:01 PM · Restricted Project, Restricted Project

Mon, Jun 20

ayermolo updated the diff for D128232: [BOLT][DWARF] Support mix mode DWARF.

updated test, removed warning

Mon, Jun 20, 8:45 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D128232: [BOLT][DWARF] Support mix mode DWARF.

Added check for .debug_line

Mon, Jun 20, 5:01 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D128232: [BOLT][DWARF] Support mix mode DWARF.

rebase

Mon, Jun 20, 4:34 PM · Restricted Project, Restricted Project
ayermolo requested review of D128232: [BOLT][DWARF] Support mix mode DWARF.
Mon, Jun 20, 4:31 PM · Restricted Project, Restricted Project

Wed, Jun 15

ayermolo updated the diff for D127897: [BOLT][DWARF] Handle range with same low_pc/high_pc.

updated test

Wed, Jun 15, 3:53 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D127897: [BOLT][DWARF] Handle range with same low_pc/high_pc.

fixed test

Wed, Jun 15, 3:38 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D127897: [BOLT][DWARF] Handle range with same low_pc/high_pc.

oops clobbered the diff

Wed, Jun 15, 2:44 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D127897: [BOLT][DWARF] Handle range with same low_pc/high_pc.

removed old code

Wed, Jun 15, 2:41 PM · Restricted Project, Restricted Project
ayermolo requested review of D127897: [BOLT][DWARF] Handle range with same low_pc/high_pc.
Wed, Jun 15, 12:32 PM · Restricted Project, Restricted Project
ayermolo added a reviewer for D127889: [LLDB] Handle DIE with DW_AT_low_pc and empty ranges: clayborg.
Wed, Jun 15, 11:34 AM · Restricted Project, Restricted Project
ayermolo requested review of D127889: [LLDB] Handle DIE with DW_AT_low_pc and empty ranges.
Wed, Jun 15, 11:34 AM · Restricted Project, Restricted Project

Tue, Jun 14

ayermolo added a comment to D126835: Round up zero-sized symbols to 1 byte in `.debug_aranges` (without breaking other logic)..

When trying this on Chromium (in the context of https://crbug.com/1335630) we hit a densemap assert in llvm::DwarfDebug::emitDebugARanges()
See the attached reproducer.

Thanks for the reproducer, @hansw - sounds worth addressing before this moves forward.

(I'm still sort of feeling like we should fix the underlying entities to be non-zero length always (even if they're zero length at the language level - they can still be non-zero length as an implementation detail providing unique addresses))

Tue, Jun 14, 11:27 AM · Restricted Project, Restricted Project
ayermolo added inline comments to D127613: [BOLT][DWARF] Add Unit test for DW_AT_high_pc [DW_FORM_addr].
Tue, Jun 14, 11:22 AM · Restricted Project, Restricted Project
ayermolo accepted D127613: [BOLT][DWARF] Add Unit test for DW_AT_high_pc [DW_FORM_addr].
Tue, Jun 14, 10:02 AM · Restricted Project, Restricted Project

Mon, Jun 13

ayermolo added a comment to D127613: [BOLT][DWARF] Add Unit test for DW_AT_high_pc [DW_FORM_addr].

For title maybe something like
[BOLT][DWARF] Add Unit test for DW_AT_high_pc [DW_FORM_addr]

Mon, Jun 13, 12:32 PM · Restricted Project, Restricted Project
ayermolo added inline comments to D127613: [BOLT][DWARF] Add Unit test for DW_AT_high_pc [DW_FORM_addr].
Mon, Jun 13, 11:16 AM · Restricted Project, Restricted Project

Sat, Jun 11

ayermolo accepted D127561: [BOLT][NFC] Move printDebugInfo out of BC::printInstruction.
Sat, Jun 11, 7:46 AM · Restricted Project, Restricted Project

Fri, Jun 10

ayermolo abandoned D120073: [LLD] Fix for race condition..
Fri, Jun 10, 3:44 PM · Restricted Project, Restricted Project

Thu, Jun 9

ayermolo added a comment to D126835: Round up zero-sized symbols to 1 byte in `.debug_aranges` (without breaking other logic)..

Looks ok to me.
@dblaikie thoughts?

Thu, Jun 9, 1:39 PM · Restricted Project, Restricted Project
ayermolo committed rG901867b1ef94: [BOLT][DWARF] Fix dwarf5-loclist-offset-form test (authored by ayermolo).
[BOLT][DWARF] Fix dwarf5-loclist-offset-form test
Thu, Jun 9, 10:55 AM · Restricted Project
ayermolo closed D127417: [BOLT][DWARF] Fix dwarf5-loclist-offset-form test.
Thu, Jun 9, 10:54 AM · Restricted Project, Restricted Project
ayermolo requested review of D127417: [BOLT][DWARF] Fix dwarf5-loclist-offset-form test.
Thu, Jun 9, 10:28 AM · Restricted Project, Restricted Project

Wed, Jun 8

ayermolo committed rG1c6dc43de979: [BOLT]DWARF] Eagerly write out loclists (authored by ayermolo).
[BOLT]DWARF] Eagerly write out loclists
Wed, Jun 8, 4:54 PM · Restricted Project
ayermolo closed D126999: [BOLT]DWARF] Eagerly write out loclists.
Wed, Jun 8, 4:53 PM · Restricted Project, Restricted Project
ayermolo added inline comments to D120073: [LLD] Fix for race condition..
Wed, Jun 8, 9:50 AM · Restricted Project, Restricted Project

Tue, Jun 7

ayermolo updated the summary of D126999: [BOLT]DWARF] Eagerly write out loclists.
Tue, Jun 7, 4:45 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D126999: [BOLT]DWARF] Eagerly write out loclists.

addressed comments

Tue, Jun 7, 3:45 PM · Restricted Project, Restricted Project
ayermolo retitled D126999: [BOLT]DWARF] Eagerly write out loclists from [BOLT][DWARF] Change loclist to take not delay writing out lists. to [BOLT]DWARF] Eagerly write out loclists.
Tue, Jun 7, 3:27 PM · Restricted Project, Restricted Project

Mon, Jun 6

ayermolo updated subscribers of D126999: [BOLT]DWARF] Eagerly write out loclists.
Mon, Jun 6, 4:21 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D126999: [BOLT]DWARF] Eagerly write out loclists.

clang-format

Mon, Jun 6, 11:47 AM · Restricted Project, Restricted Project
ayermolo updated the diff for D126999: [BOLT]DWARF] Eagerly write out loclists.

clang-format

Mon, Jun 6, 11:32 AM · Restricted Project, Restricted Project
ayermolo updated the diff for D126999: [BOLT]DWARF] Eagerly write out loclists.

rebase

Mon, Jun 6, 10:08 AM · Restricted Project, Restricted Project

Jun 3 2022

ayermolo requested review of D126999: [BOLT]DWARF] Eagerly write out loclists.
Jun 3 2022, 1:03 PM · Restricted Project, Restricted Project

Jun 2 2022

ayermolo added a comment to D121876: [BOLT][DWARF] Implement monolithic DWARF5.

Hi,
The test started to fail on Ubuntu buildbot: https://lab.llvm.org/buildbot/#/builders/215/builds/6376

# PRECHECK: include_directories[ 0] = .debug_line_str[0x00000000]
            ^
<stdin>:8:12: note: scanning from here
 version: 5
           ^
<stdin>:30:1: note: possible intended match here
include_directories[ 0] = .debug_line_str[0x00000009] = "."

Can you please take a look?

Jun 2 2022, 11:05 AM · Restricted Project, Restricted Project, Restricted Project
ayermolo added inline comments to D126835: Round up zero-sized symbols to 1 byte in `.debug_aranges` (without breaking other logic)..
Jun 2 2022, 10:43 AM · Restricted Project, Restricted Project
ayermolo added inline comments to D126835: Round up zero-sized symbols to 1 byte in `.debug_aranges` (without breaking other logic)..
Jun 2 2022, 10:42 AM · Restricted Project, Restricted Project

Jun 1 2022

ayermolo committed rGab9a17599021: [BOLT][DWARF] Fix TU Index handling for DWARF4/5 (authored by ayermolo).
[BOLT][DWARF] Fix TU Index handling for DWARF4/5
Jun 1 2022, 6:17 PM · Restricted Project
ayermolo closed D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.
Jun 1 2022, 6:16 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.

rebase ontop of Fix LIT tests on Windows VS2019

Jun 1 2022, 3:57 PM · Restricted Project, Restricted Project

May 31 2022

ayermolo updated the diff for D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.

update with arc diff git merge-base HEAD origin --update D126087

May 31 2022, 6:28 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.

rebase

May 31 2022, 6:25 PM · Restricted Project, Restricted Project
ayermolo committed rGec2711b35411: [BOLT][DWARF] Fix dwarf5-debug-line test (authored by ayermolo).
[BOLT][DWARF] Fix dwarf5-debug-line test
May 31 2022, 6:18 PM · Restricted Project
ayermolo closed D126733: [BOLT][DWARF] Fix dwarf5-debug-line test.
May 31 2022, 6:18 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.

rebase

May 31 2022, 5:59 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.

changed type unordered map to const.

May 31 2022, 5:46 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D126733: [BOLT][DWARF] Fix dwarf5-debug-line test.

Changed so that it doesn't rely on offset.

May 31 2022, 5:31 PM · Restricted Project, Restricted Project
ayermolo retitled D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5 from [BOLT][DWARF] Fix TU Index handling for DWARF4/5. to [BOLT][DWARF] Fix TU Index handling for DWARF4/5.
May 31 2022, 5:24 PM · Restricted Project, Restricted Project
ayermolo requested review of D126733: [BOLT][DWARF] Fix dwarf5-debug-line test.
May 31 2022, 4:59 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.

addressing comments

May 31 2022, 11:15 AM · Restricted Project, Restricted Project
ayermolo added inline comments to D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.
May 31 2022, 11:13 AM · Restricted Project, Restricted Project
ayermolo added a comment to D126257: Round up zero-sized symbols to 1 byte in `.debug_aranges`..

Hmm for some reason I wan't getting any notifications on this diff. My apologies.

May 31 2022, 7:00 AM · Restricted Project, Restricted Project

May 26 2022

Herald added a project to D67122: [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour: Restricted Project.
May 26 2022, 11:20 AM · Restricted Project, Restricted Project, Restricted Project, Restricted Project

May 25 2022

ayermolo added a comment to D124892: [DWARF] Fix split dwarf debug inlining in mix mode situation..

With ThinLTO enabled we can have a function in a CU that doesn't have split dwarf inlining enabled that gets inlined into CU that has it enabled.
When we try to lookup Abstract Scope Die for the inlined scope in constructInlinedScopeDIE, it's not present and we assert.

So it seems there's probably some disconnect between the logic that adds abstract scope DIEs and the logic that looks them up? (one's using the source CU, one's using the destination CU?) - can you confirm that/which one's doing which?

& maybe them consistent would be good/suitable - I guess the right behavior is probably to treat the non-split-dwarf-inlining function as having no debug info for the purposes of the place it's inlined into?

So using this example.
When we are processing MachineFunction for main. We are processing SubProgram main, with CU in main.dwo. In constructAbstractSubprogramScopeDIE this is the SrcCU. It has debug inlining enabled.
What gets inlined in to it is Abstract Lexical Scope from helper.dwo that doesn't have debug inlining enabled.
Because of it we construct Abstract Subprogram Scope DIE only in SrcCU (Main DWO CU).

With my "fix" what happens is we end up creating CU for the helper dwo, Skeleton CU for it, and adding inline subprogram information to it for "func".
So when we construct subprogram scope die, when constructInlinedScopeDIE is invoked on scope for func (which comes from helper.cpp), we are able to find Inlined sub program and don't crash. Because we can find Origin DIE for inlined sub program.

Ideally I think we would like to have inlined sub program in main Skeleton CU. Otherwise it won't be complete.

I think that's probably where I'm suggesting differently: If someone didn't build SrcCU with split-dwarf-inlining, then even if that code gets inlined into MainCU that /does/ have split-dwarf-inlining, it would be OK/consistent /not/ to describe the inlined function from SrcCU. I think that'd be correctly respecting the level of detail the user asked for - no symbolizing for functions in (or from) SrcCU.

Could you implement that? By checking when we go to construct the inlined scope DIE if the subprogram comes from a CU without split-dwarf-inlining, and if so, skip creating the split dwarf inlined description?

May 25 2022, 4:17 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.

refactored extractDWOTUFromDWP

May 25 2022, 2:39 PM · Restricted Project, Restricted Project
ayermolo added a comment to D113741: [RFC][DwarfDebug][AsmPrinter] Support emitting function-local declaration for a lexical block.

@dblaikie, thank you for the reproducers!

I've tried to compile&examine them, but haven't found any issues. Likely, I did something wrong.
Could you, please, give more details on how to reproduce the issue(s)? I mean, exact compilation command line and/or crash details / wrong dwarf output? Thank you!

Oh, right, sorry:

For the first one, you should observe a crash (in a +Asserts build) when running this command:

$ clang++-tot ab-crash.ll -gsplit-dwarf -c -O1

The backtrace looks something like this:

$ clang++-tot ab-crash.ll -gsplit-dwarf -c -O1 -S 
clang++-tot: /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:660: llvm::DIE *llvm::DwarfCompileUnit::constructInlinedScopeDIE(llvm::LexicalScope *): Assertion `OriginDIE && "Unable to find original DIE for an inlined subprogram."' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang++-tot ab-crash.ll -gsplit-dwarf -c -O1 -S
1.      Code generation
2.      Running pass 'Function Pass Manager' on module 'ab-crash.ll'.
3.      Running pass 'X86 Assembly Printer' on function '@main'
 #0 0x0000000009e604ea llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/Support/Unix/Signals.inc:565:11
 #1 0x0000000009e6069b PrintStackTraceSignalHandler(void*) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/Support/Unix/Signals.inc:632:1
 #2 0x0000000009e5ed63 llvm::sys::RunSignalHandlers() /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/Support/Signals.cpp:97:5
 #3 0x0000000009e5fdfe llvm::sys::CleanupOnSignal(unsigned long) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/Support/Unix/Signals.inc:362:1
 #4 0x0000000009d6fa4e (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/Support/CrashRecoveryContext.cpp:0:7
 #5 0x0000000009d6fe03 CrashRecoverySignalHandler(int) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/Support/CrashRecoveryContext.cpp:390:1
 #6 0x00007f60568c08e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x138e0)
 #7 0x00007f6056389e71 raise ./signal/../sysdeps/unix/sysv/linux/raise.c:50:1
 #8 0x00007f6056373536 abort ./stdlib/abort.c:81:7
 #9 0x00007f605637341f get_sysdep_segment_value ./intl/loadmsgcat.c:509:8
#10 0x00007f605637341f _nl_load_domain ./intl/loadmsgcat.c:970:34
#11 0x00007f60563827f2 (/lib/x86_64-linux-gnu/libc.so.6+0x357f2)
#12 0x000000000b57ce6e llvm::DwarfCompileUnit::constructInlinedScopeDIE(llvm::LexicalScope*) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:0:3
#13 0x000000000b57cb6c llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*, llvm::DIE&) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:538:10
#14 0x000000000b57d3ae llvm::DwarfCompileUnit::createAndAddScopeChildren(llvm::LexicalScope*, llvm::DIE&) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:1072:7
#15 0x000000000b57efa1 llvm::DwarfCompileUnit::constructSubprogramScopeDIE(llvm::DISubprogram const*, llvm::LexicalScope*) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:1023:14
#16 0x000000000b52bc0d llvm::DwarfDebug::endFunctionImpl(llvm::MachineFunction const*) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2301:50
#17 0x000000000b505ab2 llvm::DebugHandlerBase::endFunction(llvm::MachineFunction const*) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp:0:5
#18 0x000000000b4e1f4c llvm::AsmPrinter::emitFunctionBody() /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1505:3
#19 0x0000000007ed7113 llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/Target/X86/X86AsmPrinter.cpp:82:3
#20 0x0000000008a96477 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/CodeGen/MachineFunctionPass.cpp:72:8
#21 0x0000000009165d5e llvm::FPPassManager::runOnFunction(llvm::Function&) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/IR/LegacyPassManager.cpp:1439:23
#22 0x000000000916abb2 llvm::FPPassManager::runOnModule(llvm::Module&) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/IR/LegacyPassManager.cpp:1485:16
#23 0x0000000009166649 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/IR/LegacyPassManager.cpp:1554:23
#24 0x00000000091661bd llvm::legacy::PassManagerImpl::run(llvm::Module&) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/IR/LegacyPassManager.cpp:542:16
#25 0x000000000916ae91 llvm::legacy::PassManager::run(llvm::Module&) /usr/local/google/home/blaikie/dev/llvm/src/llvm/lib/IR/LegacyPassManager.cpp:1681:3

But that's actually not the original situation I was investigating, so maybe it's another bug? (possibly same root cause, though)

Though the original issue I was investigating was from invalid .debug_gnu_pubnames (DIE offsets of 0, which prematurely terminates the .debug_gnu_pubnames list and produces a warning from llvm-dwarfdump), and by adding assert(Offset) in llvm::DIE::getOffset (initially I added it in the pubnames emission code, but generally it should be true that the offset of a DIE should not be queried until it's been computed, and no DIE has offset zero, because the offset is from the start of the CU contribution - so the headers come first and mean the DIE offset is always non-zero). It seems I still don't have a small reproduction for that exact issue, though.

The second test case provided above, that produces multiple DWO CUs can be reproduced as follows:

$ clang++-tot ab-multi-cu.ll -gsplit-dwarf -c -O1 && llvm-dwarfdump-tot ab-multi-cu.o
ab-multi-cu.o:  file format elf64-x86-64

.debug_info contents:
0x00000000: Compile Unit: length = 0x00000053, format = DWARF32, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x00000057)

0x0000000b: DW_TAG_compile_unit
              DW_AT_stmt_list   (0x00000000)
              DW_AT_comp_dir    ("/usr/local/google/home/blaikie/dev/scratch")
              DW_AT_GNU_pubnames        (true)
              DW_AT_GNU_dwo_name        ("ab-multi-cu.dwo")
              DW_AT_GNU_dwo_id  (0xe9d1660e0395035d)
              DW_AT_low_pc      (0x0000000000000000)
              DW_AT_high_pc     (0x000000000000000d)
              DW_AT_GNU_addr_base       (0x00000000)

0x00000030:   DW_TAG_subprogram
                DW_AT_low_pc    (0x0000000000000000)
                DW_AT_high_pc   (0x000000000000000d)
                DW_AT_name      ("main")

0x00000041:     DW_TAG_inlined_subroutine
                  DW_AT_abstract_origin (0x000000000000007b "f1")
                  DW_AT_low_pc  (0x0000000000000004)
                  DW_AT_high_pc (0x0000000000000009)
                  DW_AT_call_file       ("/usr/local/google/home/blaikie/dev/scratch/b.cpp")
                  DW_AT_call_line       (3)
                  DW_AT_call_column     (0x03)

0x00000055:     NULL

0x00000056:   NULL
0x00000057: Compile Unit: length = 0x00000027, format = DWARF32, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x00000082)

0x00000062: DW_TAG_compile_unit
              DW_AT_stmt_list   (0x0000004c)
              DW_AT_comp_dir    ("/usr/local/google/home/blaikie/dev/scratch")
              DW_AT_GNU_pubnames        (true)
              DW_AT_GNU_dwo_name        ("ab-multi-cu.dwo")
              DW_AT_GNU_dwo_id  (0xeb227ecffcd242c1)
              DW_AT_GNU_addr_base       (0x00000000)

0x0000007b:   DW_TAG_subprogram
                DW_AT_name      ("f1")
                DW_AT_inline    (DW_INL_inlined)

0x00000081:   NULL

In this case the second CU is OK (for the cross-CU inlining that's occurred), but it shouldn't have any DWO_* attributes, and the .dwo file shouldn't have a second CU in it (which it does after this patch) because Split DWARF doesn't have a good way to describe cross-CU references correctly once the CU is packaged in a dwp file. (this behavior is meant to be controlled by the SplitDwarfCrossCUReferences flag.

This does look like a stack trace for D124892.

May 25 2022, 2:05 PM · Restricted Project, debug-info, Restricted Project
ayermolo committed rGe51a6b7374ca: [BOLT][DWARF] Convert dwarf5-df-* tests to assembly tests (authored by zr33).
[BOLT][DWARF] Convert dwarf5-df-* tests to assembly tests
May 25 2022, 1:41 PM · Restricted Project
ayermolo closed D126086: [BOLT][DWARF] Convert dwarf5-df-* tests to assembly tests.
May 25 2022, 1:41 PM · Restricted Project, Restricted Project
ayermolo committed rG256a52d9aac8: Round up zero-sized symbols to 1 byte in `.debug_aranges`. (authored by pcwalton).
Round up zero-sized symbols to 1 byte in `.debug_aranges`.
May 25 2022, 1:32 PM · Restricted Project, Restricted Project
ayermolo closed D126257: Round up zero-sized symbols to 1 byte in `.debug_aranges`..
May 25 2022, 1:32 PM · Restricted Project, Restricted Project
ayermolo added a comment to D113741: [RFC][DwarfDebug][AsmPrinter] Support emitting function-local declaration for a lexical block.

There is an alternative implementation that relies on addition field of DISubprogram/DILexicalScope that tracks static locals, local imports and types D125693.

Ah, OK - so that 5-part sequence is an alternative to this one?

Might be good to figure out the issue here before debating which direction to go in, etc. (hmm, one of the patches in that series I've already approved? So am I reviewing alternatives here? Given the complexity here that's a bit costly for me/end up feeling like I'm drowning under trying to figure out all these moving parts... - a linear sequence is generally OK/good, I can review the easy parts and focus on the difficult ones, but multiple large alternatives can be a bit daunting)

Ping on this ^


Drive-by comment on the topic of the gnu pubnames error,

If I remember correctly, this issue with .debug_gnu_pubnames was caused by another patch (https://reviews.llvm.org/rG78d15a112cbd545fbb6e1aa37c221ef5aeffb3f2).
Did I understand you right that the same issue is reproduced with w/o that patch?

I've run into that error myself when trying to alter which unit a subprogram definition goes in -- see the comment at D94976#2543257 . That patch never landed in the end because I couldn't figure out exactly what was wrong. IMHO, there's some latent weirdness that triggers that error, exactly how is unclear though. IMO, it's not specific to rG78d15a112cbd5 .

[0] "(.debug_gnu_pubnames): name lookup table at offset (...) has a terminator at offset (...) before the expected end at (...)"

I've tried to reproduce the issue using the example from D94976 (and with this patch), it compiled fine and didn't show the mentioned problem with pubnames.
Another question is about the combination of FullLTO and split-dwarf which has been already discussed in this thread and which isn't (fully) supported by LLVM mainline (yet, at least in a way that doesn't violate DWARF specification).

So, I'm still looking for a reproducer for the issue with pubnames. Any help will be appreciated.

Yeah, I still need to figure out how to do that/get you that. :/

(is this at all/possibly related to https://reviews.llvm.org/D124892 ?)

Seems like a discussion is more about multiple CUs in DWO with full LTO? Need to read all the history in more details.
Side note BOLT doesn't support multiple CUs in the dwo. There are certain assumptions about abbrev, and how it writes out new dwo files.
Does pubnames actually used for anything? My impression is that debuggers (or at least lldb) ignores it.

Yep, debug_gnu_pubnames are used by gold and lld to build gdb_index which improves gdb startup time.

May 25 2022, 8:28 AM · Restricted Project, debug-info, Restricted Project

May 24 2022

ayermolo updated the diff for D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.

formating

May 24 2022, 2:23 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.

Addressing comments.

May 24 2022, 2:13 PM · Restricted Project, Restricted Project
ayermolo updated the summary of D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.
May 24 2022, 1:03 PM · Restricted Project, Restricted Project
ayermolo added a comment to D113741: [RFC][DwarfDebug][AsmPrinter] Support emitting function-local declaration for a lexical block.

There is an alternative implementation that relies on addition field of DISubprogram/DILexicalScope that tracks static locals, local imports and types D125693.

Ah, OK - so that 5-part sequence is an alternative to this one?

Might be good to figure out the issue here before debating which direction to go in, etc. (hmm, one of the patches in that series I've already approved? So am I reviewing alternatives here? Given the complexity here that's a bit costly for me/end up feeling like I'm drowning under trying to figure out all these moving parts... - a linear sequence is generally OK/good, I can review the easy parts and focus on the difficult ones, but multiple large alternatives can be a bit daunting)


Drive-by comment on the topic of the gnu pubnames error,

If I remember correctly, this issue with .debug_gnu_pubnames was caused by another patch (https://reviews.llvm.org/rG78d15a112cbd545fbb6e1aa37c221ef5aeffb3f2).
Did I understand you right that the same issue is reproduced with w/o that patch?

I've run into that error myself when trying to alter which unit a subprogram definition goes in -- see the comment at D94976#2543257 . That patch never landed in the end because I couldn't figure out exactly what was wrong. IMHO, there's some latent weirdness that triggers that error, exactly how is unclear though. IMO, it's not specific to rG78d15a112cbd5 .

[0] "(.debug_gnu_pubnames): name lookup table at offset (...) has a terminator at offset (...) before the expected end at (...)"

I've tried to reproduce the issue using the example from D94976 (and with this patch), it compiled fine and didn't show the mentioned problem with pubnames.
Another question is about the combination of FullLTO and split-dwarf which has been already discussed in this thread and which isn't (fully) supported by LLVM mainline (yet, at least in a way that doesn't violate DWARF specification).

So, I'm still looking for a reproducer for the issue with pubnames. Any help will be appreciated.

Yeah, I still need to figure out how to do that/get you that. :/

(is this at all/possibly related to https://reviews.llvm.org/D124892 ?)

May 24 2022, 10:35 AM · Restricted Project, debug-info, Restricted Project

May 23 2022

ayermolo added inline comments to D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.
May 23 2022, 5:34 PM · Restricted Project, Restricted Project
ayermolo added inline comments to D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.
May 23 2022, 5:10 PM · Restricted Project, Restricted Project
ayermolo added inline comments to D126010: Make sure the AsmPrinter doesn't emit any zero-sized symbols to `.debug_aranges`..
May 23 2022, 4:40 PM · Restricted Project, Restricted Project
ayermolo updated the diff for D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.

missed llvm-dwp

May 23 2022, 1:16 PM · Restricted Project, Restricted Project
ayermolo added a comment to D124892: [DWARF] Fix split dwarf debug inlining in mix mode situation..

With ThinLTO enabled we can have a function in a CU that doesn't have split dwarf inlining enabled that gets inlined into CU that has it enabled.
When we try to lookup Abstract Scope Die for the inlined scope in constructInlinedScopeDIE, it's not present and we assert.

So it seems there's probably some disconnect between the logic that adds abstract scope DIEs and the logic that looks them up? (one's using the source CU, one's using the destination CU?) - can you confirm that/which one's doing which?

& maybe them consistent would be good/suitable - I guess the right behavior is probably to treat the non-split-dwarf-inlining function as having no debug info for the purposes of the place it's inlined into?

May 23 2022, 12:48 PM · Restricted Project, Restricted Project
ayermolo accepted D126086: [BOLT][DWARF] Convert dwarf5-df-* tests to assembly tests.
May 23 2022, 11:17 AM · Restricted Project, Restricted Project
ayermolo added inline comments to D126086: [BOLT][DWARF] Convert dwarf5-df-* tests to assembly tests.
May 23 2022, 8:35 AM · Restricted Project, Restricted Project

May 21 2022

ayermolo added inline comments to D126086: [BOLT][DWARF] Convert dwarf5-df-* tests to assembly tests.
May 21 2022, 7:13 AM · Restricted Project, Restricted Project

May 20 2022

ayermolo added a comment to D126086: [BOLT][DWARF] Convert dwarf5-df-* tests to assembly tests.

Please update the title with [BOLT][DWARF] <title>

May 20 2022, 4:03 PM · Restricted Project, Restricted Project
ayermolo added inline comments to D126086: [BOLT][DWARF] Convert dwarf5-df-* tests to assembly tests.
May 20 2022, 12:57 PM · Restricted Project, Restricted Project
ayermolo requested review of D126087: [BOLT][DWARF] Fix TU Index handling for DWARF4/5.
May 20 2022, 12:56 PM · Restricted Project, Restricted Project

May 11 2022

ayermolo added a comment to D124892: [DWARF] Fix split dwarf debug inlining in mix mode situation..

@dblaikie Maybe you can point me in a direction where the fix could be better implemented? I can see what I can come up with.

May 11 2022, 7:46 AM · Restricted Project, Restricted Project