Can close-ing a pipe trigger a SIGPIPE?

Kostik Belousov kostikbel at gmail.com
Sun Oct 18 12:15:57 UTC 2009


On Sat, Oct 17, 2009 at 06:04:46PM -0400, Mikhail T. wrote:
> Kostik Belousov написав(ла):
> >> This 0-size write must be part of the pipe-closing -- descriptors 4 and
> >> 5 must be the pipe's:
> >>
> >>  92722 tclsh8.5 CALL  write(0x4,0x800e24028,0)
> >>  92722 tclsh8.5 RET   write -1 errno 32 Broken pipe
> >>  92722 tclsh8.5 PSIG  SIGPIPE caught handler=0x800f126d0 mask=0x0 code=0x0
> >>  92722 tclsh8.5 CALL  sigreturn(0x7fffffffa0c0)
> >>  92722 tclsh8.5 RET   sigreturn JUSTRETURN
> >>  92722 tclsh8.5 CALL  close(0x5)
> >>  92722 tclsh8.5 RET   close 0
> >>  92722 tclsh8.5 CALL  close(0x4)
> >>  92722 tclsh8.5 RET   close 0
> >>
> >> Why would it write 0 bytes? Is doing so triggering a SIGPIPE now -- but,
> >> perhaps, didn't use to?
> >>     
> >
> > Obviously, I cannot answer the question. This is something that should
> > be read from source code or asked by authors.
Source code of the application, this is probably unclear from the above
sentence.

> >   
> You -- or someone else -- could comment like:
> 
> a) Yeah, the meaning of write-ing 0 bytes changed in version such and
> such to conform to such and such standard.
> 
> or
> 
> b) No, nothing changed in that area of FreeBSD for years -- there must
> be something in Tcl itself.

It cannot be stated in this way, since application started to issue
zero-length writes. Why it started doing this, either some buggy ABI
change in the base system, or buggy application noted and reacted
inconsitently to the ABI addition etc cannot be even theoretized. This
is why I made that formulation noting the reason should be read from the
app source code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20091018/fa627e1e/attachment.pgp


More information about the freebsd-stable mailing list