From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17894 invoked by alias); 3 Mar 2008 17:54:41 -0000 Received: (qmail 17884 invoked by uid 22791); 3 Mar 2008 17:54:40 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 03 Mar 2008 17:54:19 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m23HsH7r032289 for ; Mon, 3 Mar 2008 12:54:17 -0500 Received: from pobox-3.corp.redhat.com (pobox-3.corp.redhat.com [10.11.255.67]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m23HsH3M023672 for ; Mon, 3 Mar 2008 12:54:17 -0500 Received: from toner.yyz.redhat.com (toner.yyz.redhat.com [10.15.16.55]) by pobox-3.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m23HsGex008119 for ; Mon, 3 Mar 2008 12:54:17 -0500 Message-ID: <47CC3B48.5000505@redhat.com> Date: Mon, 03 Mar 2008 17:54:00 -0000 From: Sami Wagiaalla User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: frysk Subject: New command line utility: ferror Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2008-q1/txt/msg00113.txt.bz2 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.