| Summary: | Valgrind cannot read binaries containing debug symbols in DWARF 64 format | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Borys <borys.smejda> |
| Component: | general | Assignee: | Julian Seward <jseward> |
| Status: | REPORTED --- | ||
| Severity: | normal | CC: | mark |
| Priority: | NOR | ||
| Version First Reported In: | 3.21.0 | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | output of running: valgrind -v ./main | ||
|
Description
Borys
2023-10-26 20:21:56 UTC
In theory valgrind should be able to parse DWARF64, see the initial length field reading in readdwarf.c and readdwarf3.c which set an 64bit flag. But it doesn't surprise me that code/path isn't tested and probably fails since by default DWARF32 is used. (In reply to Mark Wielaard from comment #1) > In theory valgrind should be able to parse DWARF64, see the initial length > field reading in readdwarf.c and readdwarf3.c which set an 64bit flag. But > it doesn't surprise me that code/path isn't tested and probably fails since > by default DWARF32 is used. Valgrind reads properly DWARF 64 in DWARF4 format. If I compile the exemplary project with -gdwarf-4 -gdwarf64. Valgrind correctly parses the binary, runs it and gives detailed information about memory leaks. If I use this command: llvm-dwarfdump main | grep -i "dwarf" I get the following output: Compile Unit: length = 0x0000000000000141, format = DWARF64, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x0000014d) This proves that the binary uses DWARF 4 with DWARF 64. Conclusion: Valgrind correctly parses DWARF 4 with DWARF 64, but it fails in reading DWARF 5 with DWARF 64. |