delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/11/20/09:36:56

From: adf AT mentor-systems DOT com (Austin David France)
Subject: RE: B20, bash, #! & relative script execution
20 Nov 1998 09:36:56 -0800 :
Message-ID: <000f01be14a2$c20f1b60$010120c0.cygnus.cygwin32.developers@menpc1>
References: <000001be1485$514e89a0$010120c0 AT menpc1>
Mime-Version: 1.0
To: <cygwin32-developers AT cygnus DOT com>

Additional Info:  Executing the longer form of the script name, xx34567
causes the following traces to be output

----------------------------------------------------------------------------
--------
[main] bash 1002 (0) find_exec:
e:\GnuWin32\cygwin-b20\H-i586-cygwin32\bin\bash.exe = find_exec (/bin/bash)
[main] bash 1002 (0) spawn_guts: getting path of /d/mentor/bin/xx34567
[main] bash 1002 (0) spawn_guts: path is
[main] bash 1002 (0) spawn_guts: prog_arg is /d/mentor/bin/xx34567
[main] bash 1002 (0) spawn_guts: copy is now
e:\GnuWin32\cygwin-b20\H-i586-cygwin32\bin\bash.exe /d/mentor/bin/xx34567
winkle
----------------------------------------------------------------------------
--------

Also, the last line of the previous trace has lost a trailing 8 and should
have
been

	[sig] bash 1004 (0) wait_sig: sigcatch_nonmain 0x158

Cheers
()z


> -----Original Message-----
> From: owner-cygwin32-developers AT cygnus DOT com
> [mailto:owner-cygwin32-developers AT cygnus DOT com]On Behalf Of Austin David
> France
> Sent: 20 November 1998 12:57
> To: cygwin32-developers AT cygnus DOT com
> Subject: B20, bash, #! & relative script execution
>
>
> B20.0 (0.1/1/1) -11-8 11:59:08
> Bash 2.02.1(2)
> PATH=/e/gnuwin32/CYGWIN~1/H-I586~1/bin:/c/winnt/system32:/d/mentor/bin
> NTW40SP4
>
> I have a script called "xx" in /d/Mentor/Bin
>
>    #!/bin/bash
>    echo $@
>
> >From the bash command line, if I type "xx", nothing happens -
> bash hangs -
> until I hit ^c
>
> The last few cygwin1.dll traces output by this are:
> --------------------------------------------------------------------------
> [main] bash 1001 (0) find_exec:
> e:\GnuWin32\cygwin-b20\H-i586-cygwin32\bin\bash.exe = find_exec
> (/bin/bash)
> [main] bash 1001 (0) spawn_guts: getting path of /d/mentor/bin/xx
> [main] bash 1001 (0) spawn_guts: path is
> [sig] bash 1001 (0) wait_sig: sigcatch_nonmain 0x15
> ------------------------------------------------------------------
> ----------
> -
> The problems seem to start in spawn.cc around line 381 (based on
> the 981116
> snapshot of winsup), in particular the debug at line 384 (spawn_guts: path
> is) above outputs an empty string, suggesting a problem perhaps in
> split_path(), or should ptr be modified to point at buf?
>
> If I type /d/mentor/bin/xx this code is not executed (because an absolute
> path is supplied) and the script runs correctly, i.e. bash does not hang.
> So the problem appears to be a combination of a script found by searching
> the path.
>
> Interestingly, if I rename the script to be xx34567 and type "xx34567" the
> script executes correctly, anything shorter and the script hangs.  A
> colleague who also has NTW40SP4 & B20 has exactly the same problem, except
> he can run scripts with names > 4 characters in length.
>
> This is my first dip into the source code so apologies for not
> investigating
> further.  I will continue to investigate, but you peeps can
> probably sort it
> in a much more timely manner.
>
> Austin David France
> Mentor Systems plc
> mailto:adf AT mentor-systems DOT com
>


------------------------------------------------------------------------

The views and opinions expressed in this e-mail message are the sender's
and do not necessarily represent the views of Mentor Systems plc.

------------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019