public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* New command line  utility: ferror
@ 2008-03-03 17:54 Sami Wagiaalla
  0 siblings, 0 replies; only message in thread
From: Sami Wagiaalla @ 2008-03-03 17:54 UTC (permalink / raw)
  To: frysk

Hi,

I have added a new command line utility to frysk and called it ferror.
ferror watches the write system call for a given string then extracts
a stack back trace when that system call is found.

The purpose of ferror is to give the user an idea where an error message
is coming from. Especially in programs which depend on large stacks
of libraries; as is the case in gnome for example.

Here is a small example:

    [swagiaal@toner temp]$ ls
    [swagiaal@toner temp]$ ls fake
    ls: cannot access fake: No such file or directory
    [swagiaal@toner temp]$ ferror -e "No such file or directory" --
    /bin/ls fake
    Tracing 13017.13017
    /bin/ls: cannot access fake: No such file or directoryProcess is
    trying to output No such file or directory
    Stack trace:

    Task #13017
    #0 0x00000030f54c6e80 in __write_nocancel () from .../libc-2.7.so
    #1 0x00000030f546c343 in _IO_file_write@@GLIBC_2.2.5 () from
    .../libc-2.7.so
    #2 0x00000030f546d803 in _IO_file_xsputn@@GLIBC_2.2.5 () from
    .../libc-2.7.so
    #3 0x00000030f54475e8 in buffered_vfprintf () from .../libc-2.7.so
    #4 0x00000030f54430bf in _IO_vfprintf () from .../libc-2.7.so
    #5 0x00000030f546133b in __fxprintf () from .../libc-2.7.so
    #6 0x00000030f54d3d07 in error_tail () from .../libc-2.7.so
    #7 0x00000030f54d4083 in __error () from .../libc-2.7.so
    #8 0x0000000000402f9b in [unknown] from .../ls
    #9 0x0000000000403e0f in [unknown] from .../ls
    #10 0x0000000000407542 in [unknown] from .../ls
    #11 0x00000030f541e074 in __libc_start_main () from .../libc-2.7.so
    #12 0x0000000000402369 in [unknown] from .../ls

    Process is trying to output No such file or directory
    Stack trace:

    Task #13017
    #0 0x00000030f54c6e80 in __write_nocancel () from .../libc-2.7.so
    #1 0x00000030f546c343 in _IO_file_write@@GLIBC_2.2.5 () from
    .../libc-2.7.so
    #2 0x00000030f546d803 in _IO_file_xsputn@@GLIBC_2.2.5 () from
    .../libc-2.7.so
    #3 0x00000030f54475e8 in buffered_vfprintf () from .../libc-2.7.so
    #4 0x00000030f54430bf in _IO_vfprintf () from .../libc-2.7.so
    #5 0x00000030f546133b in __fxprintf () from .../libc-2.7.so
    #6 0x00000030f54d3c89 in error_tail () from .../libc-2.7.so
    #7 0x00000030f54d4083 in __error () from .../libc-2.7.so
    #8 0x0000000000402f9b in [unknown] from .../ls
    #9 0x0000000000403e0f in [unknown] from .../ls
    #10 0x0000000000407542 in [unknown] from .../ls
    #11 0x00000030f541e074 in __libc_start_main () from .../libc-2.7.so
    #12 0x0000000000402369 in [unknown] from .../ls
    [swagiaal@toner temp]$

for some reason ferror is outputing the stack trace twice
and I have yet to figure out of that is a bug or feature... but
the information is there.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-03 17:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-03 17:54 New command line utility: ferror Sami Wagiaalla

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).