Bug 3791

Summary: Frames without resolved symbol name display address 0x0
Product: frysk Reporter: Jan Kratochvil <jan>
Component: generalAssignee: Mike Cvet <mcvet>
Status: RESOLVED FIXED    
Severity: normal CC: mcvet
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: i686-pc-linux-gnu Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 3346, 3702, 3728, 3691    
Attachments: Fix on top of the current code; unfinished Java binding.

Description Jan Kratochvil 2006-12-23 15:47:27 UTC
Per discussion on #frysk@irc.gimp.net:

There is another bug - but definitely in the Java binding of libunwind only -
that fstack(1) never shows any address without associated symbol and it just
prints `null' instead.
the bug in `./cni/FrameCursor.cxx':`lib::unwind::FrameCursor::create_frame_cursor'.
unw_get_proc_name fails => unw_get_reg (cursor, UNW_REG_IP, &ip);
libunwind/tests/test-ptrace.c
Comment 1 Mike Cvet 2007-01-04 18:12:27 UTC
2007-01-04  Mike Cvet  <mcvet@redhat.com>

	* cni/FrameCursor.cxx (create_frame_cursor): Resolve frame address
	from unw_get_proc_info independently of function name. Fixes #3791.
Comment 2 Jan Kratochvil 2007-01-12 11:18:09 UTC
The fix contains code using uninitialized variable if symbol resolving was
unsuccessful.
Comment 3 Jan Kratochvil 2007-01-12 11:19:15 UTC
Created attachment 1491 [details]
Fix on top of the current code; unfinished Java binding.

Uninitialized value of `offset' was being retrieved.
The success return value of unw_get_reg() SHOULD be evaluated and acted upon;
it should not fail in any valid run (even if no symbols/debugging is
available).  I am just not aware of all those Java bindings so IMO it would be
appropriate to throw there Java exception, please fix it according to the `#if
0' code.
I would not write that assert() there myself but based on the mcvet's original
code it should not hurt.  Shouldn't it be more some Java assertion?  Unaware of
your crosslanguage style there.
Comment 4 Jan Kratochvil 2007-01-24 20:36:21 UTC
Committed:
2007-01-24  Jan Kratochvil <jan.kratochvil@redhat.com>
            Mike Cvet  <mcvet@redhat.com>

        * cni/FrameCursor.cxx (create_frame_cursor): Fix retrieved address.
        Temporarily remove assertion failing due to libunwind Bug 3917.