diff options
author | andreas_kupries <akupries@shaw.ca> | 2008-04-04 16:46:57 (GMT) |
---|---|---|
committer | andreas_kupries <akupries@shaw.ca> | 2008-04-04 16:46:57 (GMT) |
commit | bd64b428cf44de3abad33cda014cb21a5252ef79 (patch) | |
tree | 5c53dad0a279bb101e8f30f2530c0f68414f278c /tests | |
parent | 691a1239878ea8dece6135548a490b4d36285fe2 (diff) | |
download | tcl-bd64b428cf44de3abad33cda014cb21a5252ef79.zip tcl-bd64b428cf44de3abad33cda014cb21a5252ef79.tar.gz tcl-bd64b428cf44de3abad33cda014cb21a5252ef79.tar.bz2 |
* generic/tclIORChan.c (ReflectClose): Added missing removal of
the now closed channel from the reflection map. Before we could
crash the system by invoking 'chan postevent' on a closed
reflected channel, dereferencing the dangling pointer in the
map.
* tests/ioCmd.test (iocmd-31.8): Testcase for the above.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ioCmd.test | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/ioCmd.test b/tests/ioCmd.test index 2b4877f..fcb0b74 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -13,7 +13,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: ioCmd.test,v 1.36 2008/03/11 22:28:34 das Exp $ +# RCS: @(#) $Id: ioCmd.test,v 1.37 2008/04/04 16:46:57 andreas_kupries Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -1795,6 +1795,18 @@ test iocmd-31.7 {chan postevent, posted events do happen} -match glob -body { rename foo {} set res } -result {{watch rc* write} {} TOCK {} {watch rc* {}}} +test iocmd-31.8 {chan postevent after close throws error} -match glob -setup { + proc foo {args} {oninit; onfinal; track; return} + proc dummy args { return } + set c [chan create {r w} foo] + fileevent $c readable dummy +} -body { + close $c + chan postevent $c read +} -cleanup { + rename foo {} + rename dummy {} +} -returnCodes error -result {can not find reflected channel named "rc*"} # ### ### ### ######### ######### ######### ## Same tests as above, but exercising the code forwarding and |