Opened 18 months ago
Closed 18 months ago
#18438 closed bug (fixed)
[Debugger] Fails to load whole debug info of an executable if its CIE's length is zero
Reported by: | KENZ_gelsoft | Owned by: | anevilyak |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta5 |
Component: | Applications/Debugger | Version: | R1/beta4 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Environment:
- Haiku: R1/beta4(Revision hrev56578+86) x86_64
- on Real hardware with 8core Core i7-3770 w/ 16GB RAM
The problem (w/ STR):
- The Debugger GUI can't locate source when I debug some libraries of the in-development Firefox. I can't specify source file location manually.
- Rebuilt with DWARF3(by
-gdwarf-3
) helped a bit (main executable can be debugged with symbol), but didn't help some (most part of) libraries. - I launched the Debugger from command line like
Debugger firefox
(with some additional args to firefox).
Problem details I investigated:
- The Debugger (kit) failed to load when the library has 0-length CIE(Common Information Entry).
- 0-length CIE is not forbidden in spec, and
llvm-dwarfdump
handles correctly this. - I didn't identify what and why the build tool produces such a binary (contains 0-length CIE). But there are more than one shared objects(.so) in the firefox build output.
Attachments (1)
Change History (5)
by , 18 months ago
Attachment: | source_file_unavailable.png added |
---|
comment:1 by , 18 months ago
Some links from the related forum topic.
My initial comment about this problem:
My sharing investigated result:
leavengood found 0-length CIE is valid:
comment:2 by , 18 months ago
My current change to the Debugger kit (revision is R1/beta4).
diff --git a/src/kits/debugger/dwarf/DwarfFile.cpp b/src/kits/debugger/dwarf/DwarfFile.cpp index e382d6200e..d6bd0a0b38 100644 --- a/src/kits/debugger/dwarf/DwarfFile.cpp +++ b/src/kits/debugger/dwarf/DwarfFile.cpp @@ -1155,6 +1155,11 @@ DwarfFile::_ParseFrameSection(ElfSection* section, uint8 addressSize, if (length > (uint64)dataReader.BytesRemaining()) return B_BAD_DATA; off_t lengthOffset = dataReader.Offset(); + + if (length == 0 && !ehFrame) { + // Just skipping .debug_frame with 0-length CIE + return B_OK; + } // CIE ID/CIE pointer uint64 cieID = dwarf64
I think this patch should work with latest Haiku, but will test, and will try submitting to the review.
comment:4 by , 18 months ago
Milestone: | Unscheduled → R1/beta5 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Merged in hrev57084.
Note:
See TracTickets
for help on using tickets.
Screenshot with "Source file unavailable" message without button locating source file