Pointer smash in thread::transfer of socket on Windows
Closed / Duplicate635197ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-11-07 21:46:36
Switching socket's thread on Windows (using
thread::transfer) on threaded Tcl crashes.
The following is an example code which fails on Windows:
package require Thread
set id [thread::create]
proc d {sock args} {
after idle [list d0 $sock]
}
proc d0 {sock} {
global id
set c [catch {thread::transfer $id $sock} rc]
thread::send $id [list set sock $sock]
thread::send -async $id {
set ln [gets $sock]
puts $sock $ln
flush $sock
close $sock
}
}
socket -server d 12345
set s [socket 127.0.0.1 12345]
puts $s TEST; flush $s
vwait forever
gdb (MinGW) dump:
Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 1568.0x694]
0x0046671a in TcpInputProc ()
(gdb) bt
#0 0x0046671a in TcpInputProc ()
#1 0x004165de in GetInput ()
#2 0x00415787 in FilterInputBytes ()
#3 0x004153d4 in Tcl_GetsObj ()
#4 0x0043b909 in Tcl_GetsObjCmd ()
#5 0x00405ba6 in TclEvalObjvInternal ()
#6 0x00406513 in Tcl_EvalEx ()
#7 0x0040604b in Tcl_EvalTokensStandard ()
#8 0x00406473 in Tcl_EvalEx ()
#9 0x0047cc1c in ThreadSendEval ()
#10 0x0047e053 in ThreadEventProc ()
#11 0x00458036 in Tcl_ServiceEvent ()
#12 0x0045831d in Tcl_DoOneEvent ()
#13 0x0047dcd0 in ThreadWait ()
#14 0x0047c67c in ThreadWaitObjCmd ()
#15 0x00405ba6 in TclEvalObjvInternal ()
#16 0x00406513 in Tcl_EvalEx ()
#17 0x004068ac in Tcl_Eval ()
#18 0x0047d032 in NewThread@4 ()
#19 0x7800248d in _libuser32_a_iname ()
#20 0x77e837cd in _libuser32_a_iname ()
kennykb Ticket [635197ffff]: 2 changes
[History diff]2002-11-08 04:51:30
andreas_kupriesplain2002-11-08 04:55:16
Logged In: YES user_id=75003 Duplicate of bug 593810.
andreas_kupries Closed ticket [635197ffff].
[History diff]2002-11-08 04:55:31
Log in (anonymous is fine) to add a comment.