Subject: 1.5.24-2: non-blocking serial IO blocks (delays in non-blocking IO)
From: "Steffen DETTMER" <[email-masked]>
To: <[email-masked]>
Cc: "Steffen DETTMER" <[email-masked]>
Date: Wed, 21 Mar 2007 15:16:02 +0100
List-Id: <cygwin.cygwin.com>

Hi,

recently I upgraded to cygwin 1.5.24-2 and a serial application
stopped working. This application is doing a `select(2)' and, if data
is available, calls `read(2)' requesting more data as ariving. I
expect that the read immediately returns the number of avialable
bytes.

With 1.5.24-2, the read operation blocks several seconds (I think
five or ten) before it returns.

I replaced cygwin1.dll with the one from cygwin-1.5.21-2.tar.bz2
and it works again (I took 1.5.21-2, because for 1.5.22-1 a
serial IO timeout problem was fixed - maybe there is a
relation?).

I made `strace' files and they look very similar, but I saw one
detail difference in `fhandler_serial::raw_read: inq 4' (working
version) vs. `inq 255' (blocking version). This is a wild guess
and maybe this has no relation to my problem and I just confuse
anyone :)

I tell some details about it just in case it helps:

There are four bytes sent by the serial peer that were not read
at this point and thus should be in some queue. So in the working
version 1.5.21-2, `inq' tells the number of bytes I expect in the
queue. The newer version 1.5.24-2 has the number 255 at this
point.

Here the strace with a few lines context:

non-blocking (working, old, 1.5.21-2) version:

  readv: readv (3, 0x22BCD0, 1) nonblocking, sigcatchers 0
  peek_serial: fh->overlapped_armed 1
  fhandler_base::ready_for_read: read_ready 1, avail 1
  fhandler_serial::raw_read: ulen 1540, vmin_ 255, vtime_ 5000, hEvent 0x62C
  fhandler_serial::raw_read: inq 4
  fhandler_serial::raw_read: vtime_ 5000, vmin_ 255, n 4, tot 4
  fhandler_base::read: returning 4, binary mode
  readv: 4 = readv (3, 0x22BCD0, 1), errno 3

  (this and some other similar communications took less than one second)

blocking (non-working, new, 1.5.24-2) version:

  readv: readv (3, 0x22BCD0, 1) nonblocking, sigcatchers 0
  peek_serial: fh->overlapped_armed 1
  fhandler_base::ready_for_read: read_ready 1, avail 1
  fhandler_serial::raw_read: ulen 1540, vmin_ 255, vtime_ 5000, hEvent 0x62C
  fhandler_serial::raw_read: inq 255
  8 fhandler_serial::raw_read: vtime_ 5000, vmin_ 255, n 4, tot 4
  fhandler_base::read: returning 4, binary mode
  readv: 4 = readv (3, 0x22BCD0, 1), errno 3

  (this took somewhat between five and ten seconds leading to a timeout)

The application I used to create this trace was calling
`select(fd)' and `bytesRead = read(fd, buffer, 1024)'.

Is this a bug in cygwin? Can I help analysing it (e.g. trying
more cygwin1.dll versions)?

oki,

Steffen
 
About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them.
www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
 
About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them.
www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
--
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/