Unix Programming - Debugging broken pipe

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > September 2007 > Debugging broken pipe





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Debugging broken pipe
Henrik Goldman

2007-09-14, 1:30 am

Hello,

I'm writing some code which stops due to a broken pipe on Solaris 8 (sparc
64). Now i'm trying to
see where this comes from.
However this turned out not to be so simple.

It seems that the application doesn't give a core dump even though coredumps
are enabled using coreadm.

When I use gdb in debug mode I get:

-bash-3.1$ gdb test_long
GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.8"...
(gdb) set args ../../../out/SunOS_sparc64/
(gdb) r
Starting program: /export/home/hg//test/temp/SunOS_sparc64/test_long
.../../../out/SunOS_sparc64/
procfs:4259 -- process not stopped.
procfs: ...giving up...

What can I do?

Thanks.

-- Henrik



Ian Collins

2007-09-14, 7:32 am

Henrik Goldman wrote:
> Hello,
>
> I'm writing some code which stops due to a broken pipe on Solaris 8 (sparc
> 64). Now i'm trying to
> see where this comes from.
> However this turned out not to be so simple.
>
> It seems that the application doesn't give a core dump even though coredumps
> are enabled using coreadm.
>

Given the nature a of SIGPIPE, a core file probably wouldn't tell you much.

> When I use gdb in debug mode I get:
>

I don't know about gdb, but dbx with Sun Studio will trap SIGPIPE.

Why don't you block the signal and catch the error when write fails?

--
Ian Collins.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com