diff options
author | aku <andreas.kupries@gmail.com> | 2014-06-20 05:14:43 (GMT) |
---|---|---|
committer | aku <andreas.kupries@gmail.com> | 2014-06-20 05:14:43 (GMT) |
commit | 3cd11c535e5bf16c7bbb61ebb35cc368aa751e0f (patch) | |
tree | 3c39fabb6a230d9b565729a175992c6c5f3efc5b /generic | |
parent | 7834f2fe96420221f0b47ff335972fa7850d7554 (diff) | |
parent | f326f97897cf1deebbeb48e3f4298afb4f2e53d7 (diff) | |
download | tcl-3cd11c535e5bf16c7bbb61ebb35cc368aa751e0f.zip tcl-3cd11c535e5bf16c7bbb61ebb35cc368aa751e0f.tar.gz tcl-3cd11c535e5bf16c7bbb61ebb35cc368aa751e0f.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).
Diffstat (limited to 'generic')
-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; |