Bug 1084830

Summary: wrong Dwarf encoding of huge enumerator values
Product: [Fedora] Fedora Reporter: Petr Machata <pmachata>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: jakub, law, mnewsome
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-19 11:19:16 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 Petr Machata 2014-04-06 22:58:26 UTC
GCC represents huge enumerator values wrongly in Dwarf:

$ cat x.cc
enum : unsigned long { something = 10000000000000000000ULL };

int main(int argc, char *argv[]) {
  return sizeof (something);
}

$ g++ -Wall -g x.cc -std=c++11

The enumerator value is wrong in the generated debuginfo:

 <2><35>: номер аббревиатуры: 3 (DW_TAG_enumerator)
    <36>   DW_AT_name        : (косвенная строка, смещение: 0x1473): something  
    <3a>   DW_AT_const_value : -8446744073709551616     

Or, seen in the assembler:

.Ldebug_info0:
[...]
	.uleb128 0x3
	.long	.LASF5
	.sleb128 -8446744073709551616   ; <-- here
[...]

Version-Release number of selected component (if applicable):
# rpm -q gcc
gcc-4.8.2-1.fc20.x86_64
$ rpm -q gcc
gcc-4.6.3-2.fc15.x86_64

Comment 1 Petr Machata 2014-04-06 23:00:26 UTC
Oops, sorry for the localized readelf output:
 <2><39>: Abbrev Number: 3 (DW_TAG_enumerator)
    <3a>   DW_AT_name        : (indirect string, offset: 0x141d): something     
    <3e>   DW_AT_const_value : -8446744073709551616

Comment 2 Jaroslav Reznik 2015-03-03 15:40:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 4 Fedora End Of Life 2016-07-19 11:19:16 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.