From: <no...@so...> - 2001-10-17 20:56:59
|
Bugs item #219354, was opened at 2000-10-25 22:11 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=110894&aid=219354&group_id=10894 Category: 01. Notifier Group: : 8.2.3 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Kevin B KENNY (kennykb) Summary: threaded notifier does not work with signals Initial Comment: OriginalBugID: 5817 Bug Version: 8.2.3 SubmitDate: '2000-06-06' LastModified: '2000-10-25' Severity: CRIT Status: UnAssn Submitter: techsupp OS: Solaris OSVersion: SunOS cs1.nyc.office.juno.com 5.6 Generic_105181-16 sun4u sparc Machine: SunOS cs1.nyc.office.juno.com 5.6 Generic_105181-16 sun4u sparc FixedDate: '2000-10-25' ClosedDate: '2000-10-25' Name: Benjamin Vitale Extensions: TclX 8.2 CustomShell: none, except the patch submitted above. Comments: I thought I had submitted another patch, but I don't see it here. anyway, it was incomplete- the select masks need to be reset in the EINTR case, otherwise ALL event handlers will fire, which is wrong. ReproducibleScript: 1. run the following script. tail -f sig.log; send a HUP signal. 2. telnet localhost 12346 #!./tclsh package require Tclx signal trap HUP hup proc hup {} { log "hupping" } set s [socket -server accept 12346] proc reader {fd} { gets $fd line puts $fd "you said $line" flush $fd } proc accept {fd addr port} { log "accepting" puts $fd hello flush $fd fileevent $fd read "reader $fd" } close stdin close stdout # close stderr set logfd [open sig.log {CREAT APPEND WRONLY}] proc log {s} { global logfd puts $logfd "[clock format [clock seconds] -format "%H:%M:%S"] $s" flush $logfd } log hello proc bgerror {s} { log $s } vwait forever ObservedBehavior: the string 'hupping' does not appear in the log until you telnet DesiredBehavior: the string 'hupping' should appear in the log as soon as you send the HUP signal, even if no socket activity is occurring. Patch: =================================================================== RCS file: /proj/juno/repository/tcl/core/tcl/unix/tclUnixNotfy.c,v retrieving revision 1.1.1.2 retrieving revision 1.3 diff -u -r1.1.1.2 -r1.3 --- tclUnixNotfy.c 2000/01/26 19:14:13 1.1.1.2 +++ tclUnixNotfy.c 2000/06/02 06:25:31 1.3 @@ -897,6 +897,8 @@ */ while (1) { + int async_ready = 0; + /* * Set up the select mask to include the receive pipe. */ @@ -941,6 +943,12 @@ * Try again immediately on an error. */ + if (errno == EINTR && Tcl_AsyncReady ()) + { + async_ready = 1; + memset ((void *) &masks [0], 0, 3 * MASK_SIZE * sizeof (fd_mask)); + } + else continue; } @@ -957,7 +965,8 @@ found |= word; (((long*)(tsdPtr->readyMasks))[i]) = word; } - if (found || (tsdPtr->pollState & POLL_DONE)) { + if (found || (tsdPtr->pollState & POLL_DONE) || async_ready) { + async_ready = 0; tsdPtr->eventReady = 1; Tcl_ConditionNotify(&tsdPtr->waitCV); if (tsdPtr->onList) { PatchFiles: tclUnixNotfy.c ---------------------------------------------------------------------- >Comment By: Jeffrey Hobbs (hobbs) Date: 2001-10-17 13:56 Message: Logged In: YES user_id=72656 This may be already handled by closed bug 219251 by davygrvy. ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2001-09-19 13:07 Message: Logged In: YES user_id=75003 Benjamin Vitale = <be...@st...>. Also note that David Gravereaux did several changes relating to Async handling for threaded tcl. This might affect the bug and/or patch in this item. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=110894&aid=219354&group_id=10894 |