This is the mail archive of the
frysk@sourceware.org
mailing list for the frysk project.
libunwind Cursor.step() return values
- From: Phil Muldoon <pmuldoon at redhat dot com>
- To: Frysk Hackers <frysk at sourceware dot org>
- Date: Thu, 06 Dec 2007 16:22:52 +0000
- Subject: libunwind Cursor.step() return values
I've been looking at a fd 0 close when opening a corefile on x86 via
fhpd. The last few of the console trace are:
-Dec-07 10:13:10 AM lib.unwind.Cursor <init>
FINE: lib.unwind.Cursor@54e690 Create Cursor
6-Dec-07 10:13:10 AM lib.unwind.UnwindX86 step
FINE: lib.unwind.UnwindX86@376460 step cursor: 0x1ccc00
6-Dec-07 10:13:10 AM frysk.stack.LibunwindAddressSpace findProcInfo
FINE: Entering findProcInfo, ip: 804854a
6-Dec-07 10:13:10 AM frysk.stack.LibunwindAddressSpace getElfImage
FINE: frysk.stack.LibunwindAddressSpace@28ab40 Entering getElfImage, addr: 0x804854a
6-Dec-07 10:13:10 AM frysk.stack.LibunwindAddressSpace getElfImage
FINEST: Handling regular map name:
6-Dec-07 10:13:10 AM frysk.stack.LibunwindAddressSpace getElfImage
FINER: Leaving getElfImage
6-Dec-07 10:13:10 AM frysk.stack.LibunwindAddressSpace findProcInfo
FINEST: Obtained elfImage: Bad Elf Image, ret: -1
6-Dec-07 10:13:10 AM lib.unwind.UnwindX86 createProcInfoFromElfImage
FINE: lib.unwind.UnwindX86@376460 Pre unw_get_unwind_table
6-Dec-07 10:13:10 AM lib.unwind.UnwindX86 createProcInfoFromElfImage
FINE: lib.unwind.UnwindX86@376460 Post unw_get_unwind_table
6-Dec-07 10:13:10 AM frysk.stack.LibunwindAddressSpace findProcInfo
FINE: post procInfo ProcInfo Error: -1
6-Dec-07 10:13:10 AM lib.unwind.Cursor unwind
FINEST: lib.unwind.Cursor@42dac8, unwind, step returned: -1
And the exception returned after that is:
(fhpd) ERROR: Could not read from command line
Bad file descriptorException in thread "main" frysk.sys.Errno$Ebadf: tcsetattr: Bad file descriptor (fd 0)
at frysk.sys.termios.Termios.set(fhpd)
at frysk.sys.termios.Termios.set(fhpd)
at frysk.util.PtyTerminal$1.start(fhpd)
at java.lang.Runtime.runShutdownHooks(libgcj.so.8rh)
at java.lang.Runtime.exitNoChecks(libgcj.so.8rh)
at java.lang.Runtime.exitNoChecksAccessor(libgcj.so.8rh)
Looking at: ~/frysk/frysk-sys/lib/unwind/Cursor.java I see this code in question:
public Cursor unwind() {
logger.log(Level.FINE, "{0}, unwind\n", this);
//XXX: Don't unwind if no more, or unknown frames.
if (step == 0 || getIP() == 0)
return null;
Cursor newCursor = new Cursor(addressSpace,
unwinder.copyCursor(cursor), unwinder);
step = newCursor.step();
logger.log(Level.FINEST, "{0}, unwind, step returned: {1}\n",
new Object[] {this, new Integer(step)});
if (step > 0)
return newCursor;
return null;
}
I see that step == 0 means no more or unknown frames. Further down the:
step = newCursor.step()
returns -1 in this case. What does that mean in this case?
Regards
Phil