Bug 9044 - gdb coredumps on -O1 compiled binary on x86_64
Summary: gdb coredumps on -O1 compiled binary on x86_64
Status: RESOLVED OBSOLETE
Alias: None
Product: gdb
Classification: Unclassified
Component: symtab (show other bugs)
Version: 3.50
: P1 critical
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-06 16:08 UTC by tigran
Modified: 2014-09-19 21:08 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
uvar.c (322 bytes, application/octet-stream)
, tigran
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tigran 2005-05-06 16:08:01 UTC
[Converted from Gnats 1939]

gdb coredumps on a simple test program (attached) when
it is compiled with -O1. Running gdb on the core file
shows the offending code to be in gdb/dwarf2loc.c:dwarf_expr_frame_base() function:

*length = symbaton->size;

Now, if the program is compiled with -O0 then everything
is fine. But if the program is compiled with -O2 then
some function arguments on the backtrace are shown
as "optimized away", which is understandable, but the
argument x9 passed to the top-level function kt_func3
is shown incorrectly. But I doubt this has anything to
do with the coredump I am reporting. Just a different bug.

Release:
6.3.50.20050506-cvs

Environment:
SLES9 x86_64

How-To-Repeat:
$ gcc -g -Wall uvar.c -O1 -o uvar
$ gdb uvar
(gdb) b kt_func3
(gdb) r
Comment 1 Sergio Durigan Junior 2014-09-19 21:08:15 UTC
(gdb) b kt_func3 
Breakpoint 1 at 0x400530: file uvar.c, line 10.
(gdb) r
Starting program: /tmp/a.out 

Breakpoint 1, kt_func3 (x1=x1@entry=286331187, x2=x2@entry=572662340, x3=x3@entry=858993493, x4=x4@entry=1145324646, x5=x5@entry=1431655799, x6=x6@entry=1717986952, x7=x7@entry=2004318105, 
    x8=x8@entry=-2004318038, x9=x9@entry=-1717986885) at uvar.c:10
10	{

Therefore, closing as OBSOLETE.