Bug 105038 - wait without close causes segfault
wait without close causes segfault
Status: CLOSED DUPLICATE of bug 58317
Product: Red Hat Linux
Classification: Retired
Component: tcltk (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
Bill Huang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-09-24 16:38 EDT by James Olin Oden
Modified: 2007-04-18 12:57 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-21 13:58:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description James Olin Oden 2003-09-24 16:38:10 EDT
Description of problem:
If you run a script that does a "wait" without a doing a "close" 
before hand, expect will segfault.

Version-Release number of selected component (if applicable):
5.38.0-88

How reproducible:
Always

Steps to Reproduce:
1.  Run the following script:

spawn /bin/ls
wait

    
Actual results:
You get a segmentation fault.  If you run gdb against expect and the core you
get the following backtrace:

#0  0x4002d2e1 in expStateCheck (interp=0xbfffe9f0, esPtr=0xb8, open=1, 
adjust=0, 
    msg=0xbfffe9f0 "close") at exp_command.c:200
200     exp_command.c: No such file or directory.
        in exp_command.c
(gdb) bt
#0  0x4002d2e1 in expStateCheck (interp=0xbfffe9f0, esPtr=0xb8, open=1, 
adjust=0, 
    msg=0xbfffe9f0 "close") at exp_command.c:200
#1  0x4002d5b0 in exp_close (interp=0x804a328, esPtr=0xb8) at exp_command.c:326
#2  0x40042bac in exp_close_all (interp=0x804a328) at exp_chan.c:403
#3  0x4003b4b8 in exp_exit_handlers (clientData=0x804a328) at exp_main_sub.c:143
#4  0x400877ff in Tcl_Finalize () from /usr/lib/libtcl8.3.so
#5  0x400875fb in Tcl_Exit () from /usr/lib/libtcl8.3.so
#6  0x40030399 in Exp_ExitCmd (clientData=0x0, interp=0x4004e3fc, argc=2, 
argv=0xbfffeaf4)
    at exp_command.c:2261
#7  0x4006b78b in TclInvokeStringCommand () from /usr/lib/libtcl8.3.so
#8  0x400a7517 in TclExpandTokenArray () from /usr/lib/libtcl8.3.so
#9  0x400a7c02 in Tcl_EvalEx () from /usr/lib/libtcl8.3.so
#10 0x400a7f66 in Tcl_Eval () from /usr/lib/libtcl8.3.so
#11 0x08048a81 in main ()
#12 0x420156a4 in __libc_start_main () from /lib/tls/libc.so.6

Expected results:

No segfault, please.

Additional info:

If you add a close before the wait, the segfault goes away.
Comment 1 Jens Petersen 2003-09-25 04:11:40 EDT
Thanks for the report.  It would certain be nice to have a fix for this.

*** This bug has been marked as a duplicate of 58317 ***
Comment 2 Red Hat Bugzilla 2006-02-21 13:58:43 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

Note You need to log in before you can comment on or make changes to this bug.