public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug backtrace/15032] New: GNU/Linux backtrace fails to use eh_frame information when built with --enable-64-bit-bfd
@ 2013-01-17 21:07 jkain at nvidia dot com
  2013-01-17 21:15 ` [Bug backtrace/15032] " jkain at nvidia dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: jkain at nvidia dot com @ 2013-01-17 21:07 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15032

             Bug #: 15032
           Summary: GNU/Linux backtrace fails to use eh_frame information
                    when built with --enable-64-bit-bfd
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: backtrace
        AssignedTo: unassigned@sourceware.org
        ReportedBy: jkain@nvidia.com
    Classification: Unclassified


I'm unable to provide a reproduction case for this bug but I did spend some
time debugging the problem.  I debugged the problem using the gdb-7.5.1 sources
and then confirmed the same problem occurs with the gdb-git sources from commit
3174fd02b667571ba97f88f6d48705dc0b009a86.

I found that dwarf2_frame_find_fde() may fail to accept the unwind information
in an objfile because fde_table->entries[0]->initial_location is invalid.  When
debugging a 32 bit inferior initial_location would hold a value like
0x10003b8f0 which is clearly out of bounds.  The initial_location should have
been 0x3b8f0.

I tracked this back to a problem in read_encoded_value() which was called by 
decode_frame_entry_1() to compute initial_location.  In the case I looked at,
read_encoded_value() which would go through the DW_EH_PE_pcrel and
DW_EH_PE_udata4 cases.  In one particular call that I found that:

* DW_EH_PE_pcrel case computed base = 0xbfd60.
* DW_EH_PE_udata4 case computed 0xfff7bb90 via bfd_get_32() and added base for
a result of 0x10003b8f0.

When read_encoded_value() summed the two values it used 64 bit math because
CORE_ADDR is a 64 bit type.  This gave the result 0x10003b8f0 when it should
instead have computed the result using 32 bit math and rolling over to 0x3b8f0.


Environment:
Linux dhcp-172-16-174-205.nvidia.com 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18
23:56:17 UTC 2010 i686 i686 i386 GNU/Linux

$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.5.1/lto-wrapper
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,lto --enable-plugin
--enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-ppl --with-cloog --with-tune=generic --with-arch=i686
--build=i686-redhat-linux
Thread model: posix
gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)

This GDB was configured as "i686-pc-linux-gnu".

I built gdb from the git tree at commit
3174fd02b667571ba97f88f6d48705dc0b009a86.  gdb 7.5.1 behaves the same way.
I configured gdb as: ../../gdb-git/configure --prefix
/home/joseph/gdb/install/git --enable-64-bit-bfd

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-02-07 18:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-17 21:07 [Bug backtrace/15032] New: GNU/Linux backtrace fails to use eh_frame information when built with --enable-64-bit-bfd jkain at nvidia dot com
2013-01-17 21:15 ` [Bug backtrace/15032] " jkain at nvidia dot com
2013-01-18 19:57 ` jan.kratochvil at redhat dot com
2013-01-18 20:29 ` jkain at nvidia dot com
2013-01-18 20:38 ` jan.kratochvil at redhat dot com
2013-01-18 21:25 ` jkain at nvidia dot com
2013-01-18 21:42 ` jkain at nvidia dot com
2013-01-21 18:39 ` jan.kratochvil at redhat dot com
2013-01-22 20:11 ` jkain at nvidia dot com
2013-01-22 20:18 ` jan.kratochvil at redhat dot com
2013-01-22 20:26 ` jkain at nvidia dot com
2013-01-27 17:49 ` jan.kratochvil at redhat dot com
2013-02-04 19:06 ` palves at redhat dot com
2013-02-07 18:18 ` jkain at nvidia dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).