From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,eabba00ce5f9982a X-Google-Attributes: gidfee84,public From: Dave Butenhof Subject: Re: SIGPIPE->SIGIOT on DU 4.0? Date: 1999/05/03 Message-ID: <372D921A.DAFB56EA@zko.dec.com>#1/1 X-Deja-AN: 473527380 Content-Transfer-Encoding: 7bit References: <7g4ksc$t2l$1@nnrp1.dejanews.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Compaq Computer Corporation Mime-Version: 1.0 Newsgroups: comp.unix.osf.osf1 gabejones@my-dejanews.com wrote: > I'm doing socket programming, and occasionally an attempt to write to a > closed socket results in a SIGPIPE being thrown. No problem, I have an > exception handler (using the TRY/CATCH macros) that does the right thing and > gets my sockets back on track. My problem is that 1 out of every 15 times or > so, I seem to get SIGIOT instead of SIGPIPE. Further, while I have a handler > to deal with SIGIOT, it seems to just bypass it and I get a crash and core > dump. (Is it that DU 4.0 does not convert SIGIOT to an exception?) Just > doing a RAISE(pthread_exc_SIGPIPE_e) also seems to on occasion result in this > behavior. Ideas, anyone? I don't know enough about signals & exceptions to > know from whence a SIGIOT would come. SIGIOT is an alias for SIGABRT. (I don't know why SIGIOT, which would seem to be the least common of the two, is treated as the "primary alias".) What's probably happening is that the SIGPIPE is received while you don't have a TRY block in scope. When an exception propagates to the "end" ("bottom") of a thread's stack without finding a handler, the thread library tries to convert it back into the original signal, to leave a core file that can be analyzed. There were several levels of subtle problem in all this that were fixed in various patches in the early 4.0x releases. One of the problems was that an unhandled signal exception would also terminate the process by calling abort() (resulting in SIGABRT/SIGIOT) rather than by re-raising the appropriate original signal. This may be your problem. If so, you can get rid of it by installing the latest patch kits for your release, or by upgrading to at least 4.0D. /---------------------------[ Dave Butenhof ]--------------------------\ | Compaq Computer Corporation butenhof@zko.dec.com | | 110 Spit Brook Rd ZKO2-3/Q18 http://members.aol.com/drbutenhof | | Nashua NH 03062-2698 http://www.awl.com/cseng/titles/0-201-63392-2/ | \-----------------[ Better Living Through Concurrency ]----------------/