Bug 118452 - lang/tcl84 spins trying to close dead pty
Summary: lang/tcl84 spins trying to close dead pty
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Martin Matuska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-05 23:00 UTC by heas
Modified: 2008-01-01 10:33 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description heas 2007-12-05 23:00:02 UTC
rancid with tcl84 results in a spinning expect if the client closes the telnet/ssh connection unexpectedly.

Fix: 

Haven't gone dumpster diving, so I don't know the proper fix, but forcing the use of tcl83 works.
How-To-Repeat: install ports/net/rancid.  Create a ~/.cloginrc with:

% more ~/.cloginrc
# route views
add user route-views.routeviews*        {rviews}
add password route-views.routeviews*    {foo}   {Xm00-c0w.}
add autoenable route-views.routeviews*  {0}
# EOF

now run the command:
   /usr/local/libexec/rancid/clogin -c "show clock" route-views.routeviews.org

This will result in a spinning expect process whose stack trace is:

#0  0x28202147 in fcntl () from /lib/libc.so.6
#1  0x0804ddd1 in ExpBlockModeProc ()
#2  0x280e7e0d in StackSetBlockMode () from /usr/local/lib/libtcl84.so.1
#3  0x280e7e5f in SetBlockMode () from /usr/local/lib/libtcl84.so.1
#4  0x280ea2ba in Tcl_SetChannelOption () from /usr/local/lib/libtcl84.so.1
#5  0x280ea8d0 in TclFinalizeIOSubsystem () from /usr/local/lib/libtcl84.so.1
#6  0x280d2e27 in Tcl_FinalizeThread () from /usr/local/lib/libtcl84.so.1
#7  0x280d2edb in Tcl_Finalize () from /usr/local/lib/libtcl84.so.1
#8  0x280d2fda in Tcl_Exit () from /usr/local/lib/libtcl84.so.1
#9  0x08052397 in Exp_ExitCmd ()
#10 0x280ae2e4 in TclInvokeStringCommand () from /usr/local/lib/libtcl84.so.1
#11 0x280af9e0 in TclEvalObjvInternal () from /usr/local/lib/libtcl84.so.1
#12 0x280b0f2a in Tcl_EvalEx () from /usr/local/lib/libtcl84.so.1
#13 0x280f2024 in Tcl_FSEvalFile () from /usr/local/lib/libtcl84.so.1
#14 0x280f217e in Tcl_EvalFile () from /usr/local/lib/libtcl84.so.1
#15 0x0804c736 in exp_interpret_cmdfilename ()
#16 0x0804b6e6 in main ()

ktrace seems to point to the spinning somewhere below frame 4.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-12-06 03:42:21 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mm

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Martin Matuska freebsd_committer freebsd_triage 2007-12-29 21:47:49 UTC
This is a known bug of lang/expect if combined with recent tcl84.
The maintainer of rancid (cc'd) should consider using lang/expect-devel.
Comment 3 Mohacsi Janos 2007-12-31 08:56:17 UTC
Hi,

The lang/expect-devel does not seems to be compile  on FreeBSD with 
WITHOUT_X11B:

make
===>  Extracting for expect-5.44.1.4
=> MD5 Checksum OK for expect-cvs-20071014.tar.gz.
=> SHA256 Checksum OK for expect-cvs-20071014.tar.gz.
===>  Patching for expect-5.44.1.4
===>  Applying FreeBSD patches for expect-5.44.1.4
===>   expect-5.44.1.4 depends on file: /usr/local/bin/autoconf-2.61 - 
found
===>   expect-5.44.1.4 depends on shared library: tcl84 - found
===>  Configuring for expect-5.44.1.4
/usr/bin/touch /usr/ports/lang/expect-devel/work/expect/configure
configure: WARNING: you should use --build, --host, --target
checking for correct TEA configuration... ok (TEA 3.5)
configuring expect 5.44.1.4
checking for autoconf... yes
checking for Tcl configuration... found /usr/local/lib/tcl8.4/tclConfig.sh
checking for existence of /usr/local/lib/tcl8.4/tclConfig.sh... loading
checking for Tk configuration... configure: WARNING: Can't find Tk 
configuration definitions
===>  Building for expect-5.44.1.4
make: cannot open Makefile.
*** Error code 2

Stop in /usr/ports/lang/expect-devel.

I had to remove WITHOUT_X11 in order to be able to install expect-devel.

Anyway I submitted patch to rancid to use expect-devel instead of expect.

Question to John Heasley: When do you plan to release Rancid 2.3.2 
non-alpha?

Regards,

Janos Mohacsi
Network Engineer, Research Associate, Head of Network Planning and Projects
NIIF/HUNGARNET, HUNGARY
Key 70EF9882: DEC2 C685 1ED4 C95A 145F  4300 6F64 7B00 70EF 9882

On Sat, 29 Dec 2007, Martin Matuska wrote:

> This is a known bug of lang/expect if combined with recent tcl84.
> The maintainer of rancid (cc'd) should consider using lang/expect-devel.
>
Comment 4 Martin Matuska freebsd_committer freebsd_triage 2008-01-01 10:33:15 UTC
State Changed
From-To: open->closed

expect-devel fixed for WITHOUT_X11, rancid updated. Thanks!