delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/11/20/05:45:58

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

This is a multi-part message in MIME format.

------=_NextPart_000_0001_01BE1485.514E89A0
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: 7bit

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

------=_NextPart_000_0001_01BE1485.514E89A0
Content-Type: application/octet-stream;
	name="bg-MENTOR.png"
Content-Transfer-Encoding: base64
Content-ID: <865441712 AT 20111998-0f52>

iVBORw0KGgoAAAANSUhEUgAAALUAAAAfCAMAAAHhDUyFAAAAFXRFWHRDcmVhdGlvbiBUaW1lAAfO
BgYTNAw04D6dAAAAB3RJTUUHzgYGEzUZlScIRwAAAAlwSFlzAAALEgAACxIB0t1+/AAAAwBQTFRF
7Ozs////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////TwsOHgAAAyRJREFUeNrVV4uS6yAIJRD+/5fX8EZN
ut2Zzk69va0iHI8I6ALtGxDLv+sD/jG5CBkRCBmrvjQ18i+4xR8ftJ431BFglfrqbAsYsTPxAcD/
yzdpD6xnQwcbRseJg7qIWYSgi8eCpcs6DnWwRZX7oXq8WP6mvafeNpP7o9xo3SlMq4xvBHaiKuKY
1w3BcKqvYtMsQhy/yKGp2uiuSQewhAGkILTd3uidqY2gzqXA10OO05bOJSX9Yorh+x78WNNN49Vk
w6Mdw4PoDWTu2jz7AF0bEC+Lw2Z9AqBha9cODfU3M260Q3ITVKTOkt9Tx5AmxReOfTEYwXxwYOsy
HjEIVVnTSIUcJoMxrj4hiRTTUUU0jmLE3JXBNuvbz636il1dd9N5W/RCDRMufLO5Lxaf/LmF/+/j
5EPtg9ifhvZyRqVuQ+vbHLXqR9nrJgkdOemdkmHat7melHBoUsKclBXalo1ix2VTXOZKYGLrV5MI
+IQu0Z7pbpNod1dmu0FFomzSJqGFEwa0+61Wl5oWAkKWPLDUgKp10sTaZusdOUNHhTNoLST5ttDJ
UZxQLosNNOqdsoGGCh2en6D1VLKWaInSSUTeQx/L8ZzUq8gW2qNUSxav0LWWuq+Xoh21s1TAGmNY
i1/6eC5+fowt+OzCtTvYrxkuEiq3TAm8M9aY1Qr7P7V/q6rfCf3B9u2s+/t5EsA83ssb0o3FBrxe
Tg82K2uuyS11uuSCXCO73Kjy63VZXj8AWwu53+Q52qQIzXg/+chakXla6iXrabs3rONVrO3MTQu1
m7qBz6zRAXSMK+vZTdN2gyxAVk+ziz9tTJu4Vjj5SyCUsdq+ZO20lTRyGCVrb8d6prqyH0NHdkE6
NxSWVdDCGWfdW9ZyFRl5WlnPx9YM631+w3rjPj7DZB8hs6sX1iAYaAPese4nXwxrUD2wTnc2hXvW
dqpPrLHkB21YzzUpVfodfB8h5lqPghYGs2/ObnvLGjj5ET9FiKsncKX9wLqnSGItyoXKczZWqvQu
63hQPbG+eRnxTvl1DYlYLVG7SqfWVJoW0YpMi3CenMa8Nf7+d8g3tR9jYT4p4RMoTQAAAABJRU5E
rkJggg==

------=_NextPart_000_0001_01BE1485.514E89A0--


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

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