Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
From: heiko  <heiko@hexco.de>
Organization: Eissfeldt Consulting
To: cygwin@cygwin.com
Subject: 1.3.22: Bug Pipereader with demo (WIN2K)
Date: Fri, 1 Aug 2003 15:46:24 +0200
MIME-Version: 1.0
Content-Type: Multipart/Mixed;
  boundary="------------Boundary-00=_CX0YOL9VG5VM1VUMR291"
Message-Id: <200308011546.24406.heiko@hexco.de>

--------------Boundary-00=_CX0YOL9VG5VM1VUMR291
Content-Type: text/plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: 8bit

Hi,

changes introduced in cygwin 1.3.18 broke my application cdda2wav from the 
cdrtools package. cygwin release 1.3.17 worked well.

Since that release my app and the whole windows GUI
as well freezes when the pipe reader has to wait...
Just checked that with version 1.3.22-1

The following minimal test case demonstrates the behaviour.
CAUTION: Your machine will freeze!!

Please forward this to Christopher Faylor.

(Chris, I have looked at the diff between 1.3.18 and 1.3.17,
but have no clue what it is; probably in fhandler::read_raw or 
fhandler_pipe::read)

Good bug hunting luck, and thanks,
Heiko Eißfeldt
--------------Boundary-00=_CX0YOL9VG5VM1VUMR291
Content-Type: text/x-csrc;
  charset="us-ascii";
  name="cygwinbug.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="cygwinbug.c"

#include	<stdio.h>
#include	<unistd.h>
#include	<windows.h>

int main(void)
{
	/* initialize pipes */
	int pipefdp2c[2];
	int pipefdc2p[2];
	
	if (pipe(pipefdp2c) < 0) {
		perror("cannot create pipe parent to child");
		exit(1);
	}
	if (pipe(pipefdc2p) < 0) {
		perror("cannot create pipe child to parent");
		exit(1);
	}

	if (0 == fork()) {
		/* child */
		close(pipefdp2c[0]);
		close(pipefdc2p[1]);
	} else {
		int dummy;

		/* parent */
		/* set priority class */
		if (FALSE == SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS)) {
			fprintf(stderr, "No realtime priority possible.\n");
		}
		/* set thread priority */
		if (FALSE == SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST)) {
			fprintf(stderr, "Could not set realtime priority.\n");
		}
		
		close(pipefdp2c[1]);
		close(pipefdc2p[0]);
		read(pipefdp2c[0], &dummy, 1);
	}
	return 0;
}


--------------Boundary-00=_CX0YOL9VG5VM1VUMR291
Content-Type: text/plain; charset=us-ascii

--
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/
--------------Boundary-00=_CX0YOL9VG5VM1VUMR291--

