www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/08/18/09:19:32

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 18 Aug 2008 09:18:49 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: cygwin 1.7.0-28: Broken pipe signal broken?
Message-ID: <20080818131849.GD31691@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <1KV3KS-06K7k00 AT fwd26 DOT aul DOT t-online DOT de>
MIME-Version: 1.0
In-Reply-To: <1KV3KS-06K7k00@fwd26.aul.t-online.de>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Mon, Aug 18, 2008 at 01:55:20PM +0200, Christian Franke wrote:
>During testing of my packages on 1.7, I got the following error message
>from the grub-mkrescue script from package grub:
>
>$ cat boot.img /dev/zero | dd bs=1024 count=1440 > floppy.img
>cat: write error: No space left on device
>
>But due to a hack in coreutils*/lib/full_write.c, the error message is
>misleading.
>
>
>The following test program demonstrates the root of the problem:
>
>===== testpipe.c =====
>#include <stdio.h>
>#include <unistd.h>
>#include <signal.h>
>#include <errno.h>
>
>void sigpipe_handler()
>{
>  write(2, "[SIGPIPE!]", 10);
>}
>
>int main()
>{
>  static char buf[1024*1024];
>  signal(SIGPIPE, sigpipe_handler);
>  errno = 0;
>  int n = write(1, buf, sizeof(buf));
>  fprintf(stderr, "write = %d, errno = %d\n", n, errno);
>  return 0;
>}
>======================
>
>
>Result on 1.5.25-15:
>
>$ ./testpipe | dd bs=1 count=1 >/dev/null 2>/dev/null
>[SIGPIPE!]write = -1, errno = 32
>
>Result on 1.7.0-28:
>
>$ ./testpipe | dd bs=1 count=1 >/dev/null 2>/dev/null
>write = 0, errno = 32
>
>
>According to strace, errno=EPIPE is set in
>fhandler_base::wait_overlapped() due to a failing GetOverlappedResult().
>
>Missing raise(SIGPIPE) call in fhandler_base::write_overlapped() ?

Thanks for the test case.  I'll look at this when I get back to a
windows system.  Right now my vmware workstation is broken and my vnc
access to my windows system is down.  Quite irritating.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019