Bug 105038 - wait without close causes segfault
Summary: wait without close causes segfault
Keywords:
Status: CLOSED DUPLICATE of bug 58317
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: tcltk
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jens Petersen
QA Contact: Bill Huang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-09-24 20:38 UTC by James Olin Oden
Modified: 2007-04-18 16:57 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-02-21 18:58:43 UTC
Embargoed:


Attachments (Terms of Use)

Description James Olin Oden 2003-09-24 20:38:10 UTC
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 08:11:40 UTC
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 18:58:43 UTC
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.