This is the mail archive of the frysk@sourceware.org mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

New command line utility: ferror


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]