Using expect 5.38.0 and Tcl/Tk 8.4.1 on 64-bit HPUX
11.00
The 'spawn' command core dumps with a bus error. This
can be noticed during the spawn.test testsuite test.
I traced this to the exp_command.c file when the
Exp_SpawnCmd function tries to parse the "-open
$shannel" option. When it tries to call
Tcl_GetChannelHandle() it passes it the address of an
int (called rfd or wfd), which (on my platform) is 4
bytes wide, but Tcl_GetChannelHandle() tries to stuff a
pointer (to ClientData) into it, which is 8 bytes wide.
So I created a ClientData variable called result for
Tcl_GetChannelHandle() to interact with, and then
assigned it's value to rfd and wfd with a type cast to
int (which generates a superfluous warning).
With this patch the testsuite test now passes and
expect works fine on my platform.
As a side note, I thought that the testsuite tests were
supposed to catch bus error signals so that the test
could fail gracefully instead of dying with a core
dump, correct?
A "diff -up" patch for exp_command.c for Expect 5.38.0
Logged In: YES
user_id=200144
The patch for "exp_main_tk.c" does not belong to this patch
and should be deleted.
Logged In: YES
user_id=75003
An equivalent patch is already present in the CVS head here
at SF. This patch was passed to Don Libes as well.