From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11197 invoked by alias); 13 Nov 2001 16:19:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11138 invoked from network); 13 Nov 2001 16:19:33 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sourceware.cygnus.com with SMTP; 13 Nov 2001 16:19:33 -0000 Received: from redhat.com (rtl.cygnus.com [205.180.230.21]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id IAA15057; Tue, 13 Nov 2001 08:19:30 -0800 (PST) Message-ID: <3BF147E8.CDEF58C3@redhat.com> Date: Fri, 02 Nov 2001 07:14:00 -0000 From: Fernando Nasser Organization: Red Hat Canada X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.3-12 i686) X-Accept-Language: en MIME-Version: 1.0 To: Andrew Cagney CC: gdb-patches@sources.redhat.com, Chris Faylor Subject: Re: [rfa/dejagnu] Work around cygwin / expect background problem References: <3BF0135D.9000902@cygnus.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2001-11/txt/msg00025.txt.bz2 Andrew Cagney wrote: > > Hello, > > The attached patch tweeks dejagnu/lib/remote/exp so that it uses the > shell's background rather than the TCL background operator when trying > to kill a GDB that's gone wallkabout. > > Turns out that expect on cygwin occasionaly and mysteriously die when > executing the TCL background. While the cygwin problems now appear > fixed, the problem is still out there in the field :-( > > look ok (fernando I guess?), > > Andrew > OK with me. But maybe you should say "on older versions of cygwin", or even on versions of cygwin older than " in this comment: Fernando > ! # run this in the background since, on cygwin, a strange file > ------------------------------------------------------------------------ > 2001-11-12 Andrew Cagney > > * lib/remote.exp (local_exec, standard_close): Use SHELL > background instead of tcl background to background the kill > processes. Work around cygwin/expect problem. > > Index: lib/remote.exp > =================================================================== > RCS file: /cvs/src/src/dejagnu/lib/remote.exp,v > retrieving revision 1.2 > diff -p -r1.2 remote.exp > *** remote.exp 2001/10/30 15:20:05 1.2 > --- remote.exp 2001/11/12 18:12:52 > *************** proc local_exec { commandline inp outp t > *** 179,185 **** > # command in order to execute the execution. (English. Gotta love it.) > if { ! $got_eof } { > verbose "killing $pid $pgid"; > ! exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill -15 $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid)" &; > } > # This will hang if the kill doesn't work. Nothin' to do, and it's not ok. > catch "close -i $spawn_id"; > --- 179,188 ---- > # command in order to execute the execution. (English. Gotta love it.) > if { ! $got_eof } { > verbose "killing $pid $pgid"; > ! # This is very, very nasty. SH, instead of EXPECT, is used to > ! # run this in the background since, on cygwin, a strange file > ! # I/O error occures. > ! exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill -15 $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid) &"; > } > # This will hang if the kill doesn't work. Nothin' to do, and it's not ok. > catch "close -i $spawn_id"; > *************** proc standard_close { host } { > *** 314,323 **** > } > if { $pid > 0 } { > verbose "doing kill, pid is $pid"; > ! # This is very, very nasty. Then again, if after did something > ! # reasonable... > set pgid "-[join $pid { -}]"; > ! exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid)" &; > } > verbose "pid is $pid"; > catch "close -i $shell_id"; > --- 317,327 ---- > } > if { $pid > 0 } { > verbose "doing kill, pid is $pid"; > ! # This is very, very nasty. SH, instead of EXPECT, is used to > ! # run this in the background since, on cygwin, a strange file > ! # I/O error occures. > set pgid "-[join $pid { -}]"; > ! exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid) &"; > } > verbose "pid is $pid"; > catch "close -i $shell_id"; -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9