This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

select with timeout on /dev/com1 never returns



  Ever had one of those weeks where *every* feature you try and use seems
not to want to work for you?  sigh :-{

  Well, unless I've done something really dumb, this simple testcase ought
to wait 1/4 of a second to receive a char from com1 and then exit.

  But it doesn't.  It locks up in some very serious way that prevents the
process from being killed with ctrl-c and in fact even prevents a debugger
from attaching to it.  However it's still possible to kill the process with
the task manager.

  When I try and debug it with vs.net, I get an error that says 'The process
appears to be deadlocked (or is not running any user-mode code).'  OTOH gdb
seems to manage to get attached to it ok.  Strange.  

  Also, running it under strace makes it responsive to ctrl-c again (but
doesn't otherwise change the behaviour).  It also shows that the select does
in fact timeout, but never seems to make it through the cleanup routines and
back to the main function.

  This problem may be related to either
http://sources.redhat.com/ml/cygwin/2003-06/msg00477.html
http://sources.redhat.com/ml/cygwin/2003-06/msg00493.html
which describe select failing to notice serial input, and/or
http://sources.redhat.com/ml/cygwin/2003-03/msg02097.html
which describes select returning spurious 'read ready' indications.  I
couldn't find any indication that either of these problems have been
addressed since they were discussed on the list.

  Anyway, I'm about to get down and build a debug version of the .dll and
see where I can get with this problem, and I'll report any progress I make.
I just need to figure out why every single testcase in 'make check' fails
with "child process exited abnormally".  It seems not to be finding the
newly-built .dll and so failing to execute any of them.

  If anyone feels like taking a look over the attached testcase just to
confirm that this is a real bug and not some silly mistake I've made in
opening and setting up the com port, and that the problem is reproducible
for them, that would be most helpful.

  Also if anyone has any useful information about what goes on during the
post-select cleanup stage, that might give me a clue or two as well.


  cheers,
     DaveK

Attachment: strace.out
Description: Binary data

Attachment: makefile
Description: Binary data

Attachment: sertest.c
Description: Text document

--
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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]