Bug 457412 - Valgrind does not read properly DWARF2 as generated by Clang14
Summary: Valgrind does not read properly DWARF2 as generated by Clang14
Status: RESOLVED DUPLICATE of bug 452758
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.19.0
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-02 13:55 UTC by Jonathan DUFOUR
Modified: 2022-08-03 17:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Source code to compile with -g to trigger the valgrind error (124 bytes, text/x-c++src)
2022-08-02 13:55 UTC, Jonathan DUFOUR
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan DUFOUR 2022-08-02 13:55:31 UTC
Created attachment 151073 [details]
Source code to compile with -g to trigger the valgrind error

Encountered the same issue as the one described in this report: https://bugs.kde.org/show_bug.cgi?id=452758,
except that it's with DWARF2 in my case.
Also, it appears that the problem occurs only when compiling with at least one of the following flags: -g, -g1, -g2, -g3.
I'm using clang 14.0.6.

# Steps to reproduce
1. Compile any source code using clang 14.0.6, with one of the listed flags above (I have attached a simple hello.cpp that print the timeless Hello World, for those who haven't anything to compile).
2. Using the version 3.19.0, run valgrind on the created executable.
3. It would result in that kind of output

==13063== Memcheck, a memory error detector
==13063== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==13063== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==13063== Command: ./hello.out
==13063== 
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x23
==13063== Valgrind: debuginfo reader: ensure_valid failed:
==13063== Valgrind:   during call to ML_(img_get)
==13063== Valgrind:   request for range [24662751, +4) exceeds
==13063== Valgrind:   valid image size of 32360 for image:
==13063== Valgrind:   "/home/jodufour/Documents/42/Cursus/Projects/cpp_module_00/hello.out"
==13063== 
==13063== Valgrind: debuginfo reader: Possibly corrupted debuginfo file.
==13063== Valgrind: I can't recover.  Giving up.  Sorry.
==13063==
Comment 1 Mark Wielaard 2022-08-03 17:12:29 UTC
Those are DW_FORM_strx1 and DW_FORM_strx2 which are generated by clang for DWARF5.
So this is a duplicate of bug #452758

Note that -g1 -g2 etc are the "verbosity" of the DWARF not the version.
To change the version use -gdwarf-4

*** This bug has been marked as a duplicate of bug 452758 ***