TCL segfault crash when package require Expect

Posted by aarjabkumar on 2015-07-31 01:05

Script tested -

Inside - /opt/bin/expect

set pool [tpool::create -minworkers [array size inputListToRun] -initcmd {
spawn telnet 10.64.12.126
}]

Output - invalid command name "spawn"

Modified script -

Inside - /opt/bin/expect

set pool [tpool::create -minworkers [array size inputListToRun] -initcmd {
package require Expect
spawn telnet 10.64.12.126
}]

Output - Segmentation fault(core dumped)

Please help me understand what is going wrong here. How would I make spawn work inside a Thread.

Tclsh version - 8.6
Thread version - 2.7.2
OS - CentOS 7
Expect version - 5.45

grahams
ActiveState Staff
Fri, 2015-08-14 13:36

As noted by Don Porter in other places where this thread has circulated, Expect is not thread safe.