Bug 2166796
Summary: | gdb gives a weird error about potentially wrong DWARF information in jq debuginfo (DWARF-2 expression error: DW_OP_GNU_uninit must always be the very last op.) | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Gabriel Ravier <gabravier> |
Component: | gdb | Assignee: | Kevin Buettner <kevinb> |
Status: | CLOSED UPSTREAM | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 37 | CC: | ahajkova, fweimer, guinevere, jan, keiths, kevinb, mcermak, mjw, pmuldoon, sergiodj |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2023-08-02 16:09:49 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Gabriel Ravier
2023-02-03 01:14:45 UTC
I'm able to reproduce this problem using both gdb-12.1-7.fc37 and upstream GDB (14.0.50.20230203-git). Thus it appears that there's no upstream fix yet, or at least nothing that's been committed/pushed. With regard to the DWARF, here's what I see: <1><468f1>: Abbrev Number: 112 (DW_TAG_subprogram) <468f2> DW_AT_external : 1 <468f2> DW_AT_name : (indirect string, offset: 0x4781): jq_util_input_next_input <468f6> DW_AT_decl_file : 10 <468f6> DW_AT_decl_line : 411 <468f8> DW_AT_decl_column : 4 <468f9> DW_AT_prototyped : 1 <468f9> DW_AT_type : <0x3f2> <468fd> DW_AT_sibling : <0x4692e> ... <2><46921>: Abbrev Number: 102 (DW_TAG_variable) <46922> DW_AT_name : (indirect string, offset: 0x8cb): value <46926> DW_AT_decl_file : 10 <46926> DW_AT_decl_line : 414 <46928> DW_AT_decl_column : 6 <46929> DW_AT_type : <0x3f2> Note that there's no DW_AT_location, so I looked for an abstract origin entry: <2><2dfa0>: Abbrev Number: 90 (DW_TAG_variable) <2dfa1> DW_AT_abstract_origin: <0x46921> <2dfa5> DW_AT_location : 0x27cf1 (location list) <2dfa9> DW_AT_GNU_locviews: 0x27ce1 (Note that the DW_AT_abstract_origin attribute's value is 0x46921 which is the DIE for the local variable "value".) Looking at the location list, I see: 00027cf1 v000000000000000 v000000000000000 views at 00027ce1 for: 000000000002f8fe 000000000002f92e (DW_OP_reg13 (r13); DW_OP_GNU_uninit; DW_OP_piece: 8; DW_OP_reg12 (r12); DW_OP_GNU_uninit; DW_OP_piece: 8) I think that this is probably correct. It appears to me that the problem is that GDB doesn't understand the use of DW_OP_GNU_uninit in conjunction with the use of DW_OP_piece. I think that this bug is correctly assigned to "gdb". I'll see what I can do about it... I recently fixed an issue in elfutils libdw with DW_OP_GNU_uninit. But we mostly just ignore DW_OP_GNU_uninit. It seems not very well specified and not that useful. Here it seems to say "Look the value is in r13 (and the next piece is in r12), O, but the value in r13/r12 is not initialized, so you can regard it as not existing anyway..." It would be good if gdb didn't reject the DWARF as invalid, but I think we should lobby GCC to not emit it. Unless someone sees how this is really helpful (having a non-existing or empty location list seems more useful than having one with DW_OP_GNU_uninit in it). I've posted a patch and test case for this problem to the (upstream) gdb-patches list: https://sourceware.org/pipermail/gdb-patches/2023-June/200054.html |