This script causes expect to coredump: #!/usr/bin/expect -f spawn false wait -i $spawn_id This comment in exp_close in exp_command.c gives a hint about what's going wrong: /* at this point esPtr may have been freed so don't touch it any longer */ Unfortunately, the esPtr which this comment says shouldn't be touched anymore is in fact touched in the for loop in exp_close_all in exp_chan.c This is as far as I got at debugging this problem before running into the extent of my expect knowledge. Note that this simple modification to the script makes the coredump go away, presumably by causing the channel to be removed from the list checked by exp_close_all before the script exits: #!/usr/bin/expect -f spawn false set timeout -1 expect eof wait -i $spawn_id
This script causes expect to coredump in skipjack beta4 as well.
The script causes a core dump in Limbo re-0701. However, ActiveTcl 8.4.0.1-beta2 appears to have solved this problem.
Thanks. The problem is still present in expect-5.38.0 too.
*** Bug 105038 has been marked as a duplicate of this bug. ***
Created attachment 95168 [details] A patch which should fix the problem
This is a simple use-after-free problem which can be fixed by rewriting the loop in exp_close_all.
Thanks for the patch. Who should I attribute it to btw?
Actually it looks like this is already fixed in expect-5.39.0 afaict from looking at the code.
Should be fixed finally in tcltk-8.3.5-91 (ie expect-5.39.0-91).
Actual fixed release number is -93.
Re-opening until package for RHL 9 available.