#89 Insufficient test for lost bg channel in exp_background_chan

closed-fixed
None
5
2012-08-15
2012-05-14
No

The test in exp_background_channelhandler() in expect.c on line 2508 checks to make sure that the backup channel name (exp#) is still known to Tcl_GetChannel() and, if it is, assumes that esPtr is still valid and wasn't lost in the background handler.

While this works in the general case, it fails if esPtr was lost in the background handler AND another process spawned which gets reassigned the old name. When this happens Expect ends up segfaulting (at least on RHEL Linux, Expect 5.45, Tcl 8.5.11).

I'm attaching a patch that has fixed it for me.

Discussion

    • assigned_to: nobody --> andreas_kupries
    • status: open --> closed-fixed
     
  • Committed to CVS head. Version bumped to 5.45.1