Bug 5267 - libunwind barfing when no vdso
Summary: libunwind barfing when no vdso
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Mark Wielaard
URL:
Keywords:
Depends on:
Blocks: 2246 5292
  Show dependency treegraph
 
Reported: 2007-11-02 16:46 UTC by Andrew Cagney
Modified: 2007-11-19 11:45 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cagney 2007-11-02 16:46:06 UTC
For instance:

(fhpd) load /home/mark/src/git/frysk-obj/frysk-core/frysk/pkglibdir/funit-hello
Loaded executable file:
/home/mark/src/git/frysk-obj/frysk-core/frysk/pkglibdir/funit-hello
(fhpd) print _start
[1.0]

Error: null
Error: Symbol "_start" is not found in the current context.
(fhpd) print Exception in thread "main" java.lang.NullPointerException
   at lib.unwind.UnwindX86.createProcInfoFromElfImage(fhpd)
   at frysk.stack.LibunwindAddressSpace.findProcInfo(fhpd)
   at lib.unwind.UnwindX86.getProcInfo(fhpd)
   at lib.unwind.Cursor.getProcInfo(fhpd)
   at frysk.stack.LibunwindFrame.getAddress(fhpd)
Comment 1 Mark Wielaard 2007-11-14 12:50:44 UTC
It seems this code path isn't taken anymore. I get the following without
stacktrace now:

$ frysk-core/frysk/bindir/fhpd 
(fhpd) load /home/mark/src/git/frysk-obj/frysk-core/frysk/pkglibdir/funit-hello
Loaded executable file:
/home/mark/src/git/frysk-obj/frysk-core/frysk/pkglibdir/funit-hello
(fhpd) print _start
[0.0]
Error: null
(fhpd) 

I assume the Error: null is still wrong though. At least it is pretty uninformative.
Comment 2 Mark Wielaard 2007-11-14 13:07:24 UTC
Got it, we don't print the stacktrace anymore (it is a NullPointerException with
null message, we only print the 'null').
Comment 3 Mark Wielaard 2007-11-19 11:45:42 UTC
Fixed by:

frysk-core/frysk/stack/ChangeLog
2007-11-19  Mark Wielaard  <mwielaard@redhat.com>

    * LibunwindFrame.java (getAddress): Don't do a proc name lookup,
    use new Cursor.getIP().

frysk-imports/libunwind/ChangeLog
2007-11-19  Mark Wielaard  <mwielaard@redhat.com>

    * src/mi/Gget_reg.c (unw_get_reg): Use cached value from cursor
    when looking for UNW_REG_IP.

frysk-sys/lib/unwind/ChangeLog
2007-11-19  Mark Wielaard  <mwielaard@redhat.com>

    * Cursor.java (getIP): New method.
    (unwind): Check current ip.
    * Unwind.java (getIP): New method.
    * cni/UnwindH.hxx (getIP): Likewise.
    (getContext): Check for null elfImage.

Although now you will hit either bug #5286 or #5345, but this isn't specific to
the exe load target.