diff options
| author | andreask@activestate.com <aku> | 2014-06-20 05:14:43 (GMT) |
|---|---|---|
| committer | andreask@activestate.com <aku> | 2014-06-20 05:14:43 (GMT) |
| commit | a63eace6c7f831eafee6029283fe4eb8b3c0d798 (patch) | |
| tree | 3c39fabb6a230d9b565729a175992c6c5f3efc5b | |
| parent | 9952aa6826697b7641c2d617038d0e1fa9157fb4 (diff) | |
| parent | b366179738793459891b98b4325d9993171079d7 (diff) | |
| download | tcl-a63eace6c7f831eafee6029283fe4eb8b3c0d798.zip tcl-a63eace6c7f831eafee6029283fe4eb8b3c0d798.tar.gz tcl-a63eace6c7f831eafee6029283fe4eb8b3c0d798.tar.bz2 | |
[b47b176adf] Stop possible segfaults when variability in mutex lock
schedules cause a ForwardingResult to remain on the forwardList after
it has been processed (IORChan is the origin of the code in IORTrans).
| -rw-r--r-- | generic/tclIORChan.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 6a43441..ff602c6 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -2527,6 +2527,11 @@ DeleteReflectedChannelMap( /* * The receiver for the event exited, before processing the event. We * detach the result now, wake the originator up and signal failure. + * + * Attention: Results may have been detached already, by either the + * receiver, or this thread, as part of other parts in the thread + * teardown. Such results are ignored. See ticket [b47b176adf] for the + * identical race condition in Tcl 8.6 IORTrans. */ evPtr = resultPtr->evPtr; @@ -2536,6 +2541,9 @@ DeleteReflectedChannelMap( continue; } paramPtr = evPtr->param; + if (!evPtr) { + continue; + } evPtr->resultPtr = NULL; resultPtr->evPtr = NULL; @@ -2666,6 +2674,11 @@ DeleteThreadReflectedChannelMap( /* * The receiver for the event exited, before processing the event. We * detach the result now, wake the originator up and signal failure. + * + * Attention: Results may have been detached already, by either the + * receiver, or this thread, as part of other parts in the thread + * teardown. Such results are ignored. See ticket [b47b176adf] for the + * identical race condition in Tcl 8.6 IORTrans. */ evPtr = resultPtr->evPtr; @@ -2675,6 +2688,9 @@ DeleteThreadReflectedChannelMap( continue; } paramPtr = evPtr->param; + if (!evPtr) { + continue; + } evPtr->resultPtr = NULL; resultPtr->evPtr = NULL; |
