cygwin source-patch fixing deadlock while writing to serial port

H. Henning Schmidt henning@hhschmidt.de
Mon Jan 19 21:21:00 GMT 2004


I found a potential deadlock while writing to a serial port (e.g. 
/dev/com1) that has been opened as O_RDWR. The deadlock occurs from time 
to time (not sure about exact conditions) when I write to that port, 
while there is data coming in (e.g. from an external device) and I do 
not read away that data fast enough from the port.

I did provide a test case a while ago in 
http://sources.redhat.com/ml/cygwin/2003-03/msg01529.html. I digged into 
the issue some more now and found that the executing thread got 
sometimes deadlocked in fhandler_serial::raw_write(). It basically ends 
up in a for(;;) loop and just never hits the break;

The applied patch adds a safety exit to that for(;;) loop.
This fixes the testcase referenced above.

This might not be the last problem lingering in the serial access code 
(there are some FIXME tokens still around ...), but it is definitely an 
improvement for me. I thought I'd share that with you.

;Henning

-- 
H. Henning Schmidt
email: henning@hhschmidt.de
phone: +49 (0) 6155 / 899 283
fax:   +49 (0) 6155 / 899 284

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.cygwin-1.5.5-1
URL: <http://cygwin.com/pipermail/cygwin/attachments/20040119/0b70aae3/attachment.ksh>
-------------- next part --------------
--
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/


More information about the Cygwin mailing list