From nobody@FreeBSD.org  Wed Dec  5 22:56:32 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8492216A417
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  5 Dec 2007 22:56:32 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 76BE613C461
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  5 Dec 2007 22:56:32 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id lB5MuTw5073149
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 5 Dec 2007 22:56:29 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id lB5MuTOw073148;
	Wed, 5 Dec 2007 22:56:29 GMT
	(envelope-from nobody)
Message-Id: <200712052256.lB5MuTOw073148@www.freebsd.org>
Date: Wed, 5 Dec 2007 22:56:29 GMT
From: heasley <heas@shrubbery.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: tcl84 spins trying to close dead pty
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         118452
>Category:       ports
>Synopsis:       lang/tcl84 spins trying to close dead pty
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 05 23:00:02 UTC 2007
>Closed-Date:    Tue Jan 01 10:33:17 UTC 2008
>Last-Modified:  Tue Jan 01 10:33:17 UTC 2008
>Originator:     heasley
>Release:        6.2R
>Organization:
sni
>Environment:
6.2-RELEASE FreeBSD 6.2-RELEASE #1: Mon Jul 23 01:53:25 GMT 2007     root@ns2.routeviews.org:/usr/src/sys/i386/compile/ns2  i386

>Description:
rancid with tcl84 results in a spinning expect if the client closes the telnet/ssh connection unexpectedly.
>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.
>Fix:
Haven't gone dumpster diving, so I don't know the proper fix, but forcing the use of tcl83 works.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->mm 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Dec 6 03:42:21 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118452 

From: Martin Matuska <mm@FreeBSD.org>
To: bug-followup@FreeBSD.org, heas@shrubbery.net
Cc: janos.mohacsi@bsd.hu
Subject: Re: ports/118452: lang/tcl84 spins trying to close dead pty
Date: Sat, 29 Dec 2007 22:47:49 +0100

 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.

From: Mohacsi Janos <mohacsi@niif.hu>
To: Martin Matuska <mm@FreeBSD.org>
Cc: bug-followup@FreeBSD.org, heas@shrubbery.net, janos.mohacsi@bsd.hu
Subject: Re: ports/118452: lang/tcl84 spins trying to close dead pty
Date: Mon, 31 Dec 2007 09:56:17 +0100 (CET)

 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.
 >
State-Changed-From-To: open->closed 
State-Changed-By: mm 
State-Changed-When: Tue Jan 1 10:33:15 UTC 2008 
State-Changed-Why:  
expect-devel fixed for WITHOUT_X11, rancid updated. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118452 
>Unformatted:
