public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Frysk Hackers <frysk@sourceware.org>
Subject: libunwind  Cursor.step() return values
Date: Thu, 06 Dec 2007 16:23:00 -0000	[thread overview]
Message-ID: <475821DC.3030801@redhat.com> (raw)

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



             reply	other threads:[~2007-12-06 16:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-06 16:23 Phil Muldoon [this message]
2007-12-06 18:02 ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=475821DC.3030801@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).