delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/11/15/18:25:31

From: corinna DOT vinschen AT cityweb DOT de (Corinna Vinschen)
Subject: winsup snapshot 981111, error in read_handler()?
15 Nov 1998 18:25:31 -0800 :
Message-ID: <364F84B9.C78490CB.cygnus.cygwin32.developers@cityweb.de>
References: <19981111231958 DOT 36866 AT cygnus DOT com>
Mime-Version: 1.0
To: Christopher Faylor <cgf AT cygnus DOT com>, cygwin32-developers AT cygnus DOT com

> Tue Nov  3 16:12:59 1998  Christopher Faylor <cgf AT cygnus DOT com>
> 
>         * syscalls.cc (read_handler): Use new ready_for_read method to
>         determine if an fd has data for reading.  This function optionally
>         blocks until there is data to read.
>         (read_helper): Add debugging statement.

Hello Chris,

I have found a strange behaviour in this function. The man-package,
contributed by Michael Hirmke on ftp.franken.de runs without problem
until the last snapshot. Since using this new snapshot, the man command
fails unsystematically in paging gzipped man pages, which is done
by calling the command sequence

	(cd; gunzip | tbl | groff | less)

via system().
50% of the calls went thru, in 50% of the calls the error message is 

	fgets: Interrupted system call
	Error reading man page foo.X.gz
	No manual entry for foo

The effect seems to take place only on short files, e.g `man bash' works,
`man pr' doesn't.

With tracing, you can see the following sequence:

	[main] gunzip 1301 (0) alive_parent: parent still alive
	[main] gunzip 1301 (0) alive_parent: parent still alive
	[main] man 1299 (0) _read: WFMO 1
	[read_helper] man 1299 (0) read_helper: r 0xA039760: /dev/piper
	[main] man 1299 (0) _read: interrupted /dev/piper, res 1
	[main] man 1299 (0) _read: -1 = read (4, 0xA039358, 1024), errno 4

instead of the working (previous snapshot) sequence:

	[main] gunzip 1337 (0) alive_parent: parent still alive
	[main] gunzip 1337 (0) alive_parent: parent still alive
	[read_helper] man 1335 (0) peek_pipe: /dev/piper, ready for read
	[read_helper] man 1335 (0) read_handler: /dev/piper bytes read: 1024
	[main] man 1335 (0) _read: WFMO 0
	[main] man 1335 (0) _read: 1024 = read (4, 0xA039358, 1024), errno 2

In my personal version of the cygwin1.dll, I have substitute the function
`read_handler()' in syscalls.cc by the version of the previous snapshot.
The main difference is the call to `cygwin_select()' instead of the now
used `fh->ready_for_read(INFINITE)'.
I know, taking the old code isn't the right solution, but it works for now.

Regards,
Corinna

- Raw text -


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