Problem with bash 3.xyz (Full Version)

All Forums >> [SFU / Interix / SUA Technology] >> Tools Discussion Forum



Message


ale -> Problem with bash 3.xyz (Sep. 21, '06, 6:48:24 PM)

After upgrade (with pkg_add) from bash 2.05.2.2 to 3.0.0.8 I can't start it as login shell from Windows' shortcut.

I just copied SFU's default shortcut to C shell and change its target from '%Windir%\posix.exe /u /c /bin/csh -l' to '%Windir%\posix.exe /u /c /usr/local/bin/bash -l'. This shortcut works fine for bash 2, but bash 3 starts and then exits immediately (terminal windows flashes for a second and then closed without any output). This behavior occurs in both SFU 3.5 on XP and SUA 6.0 on Vista RC1.

I still can run bash as login shell from csh. What goes wrong?


---
Sorry for bad English.




Rodney -> RE: Problem with bash 3.xyz (Sep. 21, '06, 7:01:05 PM)

Check that it's listed in the /etc/shells file as
/usr/local/bin/bash




ale -> RE: Problem with bash 3.xyz (Sep. 21, '06, 7:04:29 PM)

It is


% cd /etc
% cat ./shells
/bin/sh
/bin/ksh
/bin/csh
/bin/tcsh
/usr/local/bin/bash
%


---
Sorry for bad English




Rodney -> RE: Problem with bash 3.xyz (Sep. 21, '06, 8:51:36 PM)

> I still can run bash as login shell from csh. What goes wrong?

You started it as "bash -l" then, yes?

If you start a CMD.EXE shell and then run "bash -l" does it give an error message?




ale -> RE: Problem with bash 3.xyz (Sep. 22, '06, 5:53:41 AM)

Yes, when I start "bash -l" from "csh -l"'s prompt, it runs.

But when I start it from non-login csh or cmd.exe (or from shortcut), it simply doesn't run without any error messages.

In addition to XP and Vista, I tried to reproduce this problem in SUA 5.2 on W2k3 with domain environment -- exactly the same, bash 3 doesn't run as login shell, but bash 2 runs OK.




eperea -> RE: Problem with bash 3.xyz (Sep. 22, '06, 7:28:58 AM)

What command line were you using? It seems to work fine here from 4NT or CMD:

[C:\]posix /u /c /usr/local/bin/bash -l
Welcome to the Interix UNIX utilities.

DISPLAY=localhost:0.0
bash-3.00$ pwd
/dev/fs/C/SFU/home/eperea
bash-3.00$




ale -> RE: Problem with bash 3.xyz (Sep. 22, '06, 7:51:28 AM)

Win+R, cmd


Microsoft Windows XP [Версия 5.1.2600]
(С) Корпорация Майкрософт, 1985-2001.

Z:\>c:

C:\>posix /u /c /usr/local/bin/bash -l


C:\>


Without -l:


Microsoft Windows XP [Версия 5.1.2600]
(С) Корпорация Майкрософт, 1985-2001.

Z:\>c:

C:\>posix /u /c /usr/local/bin/bash

bash-3.00$ date
Fri Sep 22 16:45:48 AZST 2006
bash-3.00$ exit
exit

C:\>


(SFU 3.5 on XP SP2 with domain environment. System locale is set to Russian.)




ale -> RE: Problem with bash 3.xyz (Sep. 22, '06, 8:31:39 AM)

I just remove all /Tools packages with pkg_delete and install everything onto clean-again SFU. Now bash 3 works as login shell. Perhaps, some old stuff in /etc/profile.lcl (that remains after bash 2 to 3 update with pkg_add? -- I don't know, because I replace profile.lcl with SFU's default one) prevents it from normal starting. %)




grg -> RE: Problem with bash 3.xyz (Sep. 26, '06, 10:18:35 AM)

I experienced a similar problem just now.
I'm running Vista build 5728. Clean installed it and SFU today (for the first time).

Creating a shortcut which points to:
C:\Windows\posix.exe /u /c /usr/local/bin/bash -l
opens a window briefly, then dumps core.

As a workaround, I've just invoked bash from my .profile if $KSH_VERSION is set.

$ uname -a
Interix billyg 10.0 10.0.5464.0 x86 AMD Athlon/Duron

$ /usr/local/bin/bash --version
GNU bash, version 3.00.0(9)-release (i586-pc-inter
Copyright (C) 2004 Free Software Foundation, Inc.

$ gdb -c core /usr/local/bin/bash

GNU gdb 2002-11-11-cvs
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i586-pc-interix3"...
Core was generated by `/usr/local/bin/bash -l'.
Reading symbols from /usr/local/lib/libintl.so...
warning: "_environ": indirect symbol does not have real one (-1)


warning: "_RaiseException@16": indirect symbol does not have real one (-1)


warning: "_beThreadSafe": indirect symbol does not have real one (-1)

done.
Loaded symbols for /usr/local/lib/libintl.so
Reading symbols from /usr/local/lib/libiconv.so...
warning: "_environ": indirect symbol does not have real one (-1)


warning: "_RaiseException@16": indirect symbol does not have real one (-1)


warning: "_beThreadSafe": indirect symbol does not have real one (-1)

done.
Loaded symbols for /usr/local/lib/libiconv.so
Reading symbols from /usr/lib/libc.so.3.5...done.
Loaded symbols for /usr/lib/libc.so.3.5
Reading symbols from /usr/lib/libdl.so.3.5...done.
Loaded symbols for /usr/lib/libdl.so.3.5
Reading symbols from /usr/lib/ld.so...done.
Loaded symbols for /usr/lib/ld.so
#0 0x773ec514 in ?? ()
(gdb) bt
#0 0x773ec514 in ?? ()
#1 0x736e6c30 in ?? ()
#2 <signal handler called>
#3 0x773ed8df in ?? ()
#4 0x773ed56c in ?? ()
#5 0x773ed456 in ?? ()
#6 0x736d7f77 in ?? ()
#7 0x77d87cd7 in _free () at free.c:93
#8 0x00444a1a in change_to_directory ()
#9 0x004445bc in cd_builtin ()
#10 0x00411912 in execute_builtin ()
#11 0x0041227c in execute_builtin_or_function ()
#12 0x00411412 in execute_simple_command ()
#13 0x0040e421 in execute_command_internal ()
#14 0x0040dfa6 in execute_command ()
#15 0x0040e64d in execute_command_internal ()
#16 0x00439090 in parse_and_execute ()
#17 0x00439833 in _evalfile ()
#18 0x00439a21 in maybe_execute_file ()
#19 0x0040231c in run_startup_files ()
#20 0x00401af0 in main ()
(gdb) quit




Rodney -> RE: Problem with bash 3.xyz (Sep. 26, '06, 11:17:05 AM)

I'm thinking that for build 5728 of Vista this may be a problem with
the loading of the 3.5 shared libraries since static 3.5 binaries (such
as the installer) are running. There's always the chance that 5728 isn't
a good snapshot... I'll see if MS can tell me anything...




StanleyJ -> RE: Problem with bash 3.xyz (Sep. 26, '06, 11:19:36 AM)

quote:

ORIGINAL: grg

*gdb output*


That's exactly what I see, line-for-line.




StanleyJ -> RE: Problem with bash 3.xyz (Sep. 26, '06, 12:01:15 PM)

I figured I'd try compiling against the latest source (3.0.16)... http://ftp.gnu.org/pub/gnu/bash/

Configure line was:

./configure --prefix=/usr/local --enable-static-link --build=i586-pc-interix


... then a "gmake", which dies with:


gcc -c  -I. -I../.. -I../.. -I../../lib -I../../include -I.  -DHAVE_CONFIG_H -DS
HELL -DNO_MAIN_ENV_ARG -DBROKEN_DIRENT_D_INO  -D_ALL_SOURCE -D_ALL_SOURCE -I/usr
/local/include  -I/usr/local/ssl/include  strtoll.c
In file included from strtoll.c:24:
strtol.c:148:12: invalid suffix "ui64" on integer constant
strtol.c:149:12: invalid suffix "ui64" on integer constant
strtol.c:223:40: invalid suffix "i64" on integer constant
strtol.c:224:37: invalid suffix "i64" on integer constant
strtol.c:234:25: invalid suffix "i64" on integer constant
strtol.c:234:43: invalid suffix "i64" on integer constant
gmake[1]: *** [strtoll.o] Error 1
gmake[1]: Leaving directory `/dev/fs/C/Users/stanlj/SUA/bash/bash-3.0.16/lib/sh'

gmake: *** [lib/sh/libsh.a] Error 1


Which I assume are these bits of ./bash-3.0.16/lib/sh/strtol.c

Lines: 148-149


  cutoff = STRTOL_ULONG_MAX / (unsigned LONG int) base;
  cutlim = STRTOL_ULONG_MAX % (unsigned LONG int) base;


Lines: 223-224


              ? -((unsigned LONG int) (STRTOL_LONG_MIN + 1)) + 1
              : (unsigned LONG int) STRTOL_LONG_MAX))


Line: 234


      return negative ? STRTOL_LONG_MIN : STRTOL_LONG_MAX;




grg -> RE: Problem with bash 3.xyz (Sep. 26, '06, 12:42:06 PM)

Just to clarify, bash does actually work fine for me when invoked from within ksh (with or without exec()ing over ksh).




ale -> RE: Problem with bash 3.xyz (Sep. 26, '06, 5:14:34 PM)

Things are going more interesting.

Today I tried to install all my favorite bunch of /Tools packages on another machine with Vista RC1 (build 5600).

bash 3.0.0.8 dumps core on string 254 of default SUA's /etc/profile, when runs from shortcut/cmd/anything else as login shell.


# -------------
#
# Change directory to user's home directory.
# On UNIX, this would be done by the login(1) program, but since
# we don't always run login(1) (for example, from a shortcut) we emulate
# it here to be sure.
#
if [ "$HOME" != "" ]; then

cd "$HOME" # HERE bash does core
fi

# -------------
# now read in the system local profile
#
if [ -f /etc/profile.lcl ]; then
    . /etc/profile.lcl
fi


Just comment or remove this cd, or place it into /etc/profile.lcl, and then bash starts normally with -l switch!

Any ideas why?




Rodney -> RE: Problem with bash 3.xyz (Sep. 26, '06, 5:55:35 PM)

Given the crash is a SEGV there is something getting stored or referenced with
a wrong value (I say "wrong" rather than "bad" since it might have been okay
sometime earlier). It certainly won't have anything to do with threads.

This is the second posting that has it happening with a "cd". So there might
be something in this code. I doubt it's the system API chdir() because other
apps that chdir() are functioning; it may be with backward compatible shared
libraries. I have sent e-mail to Microsoft asking if anything is known about
this.

I'm going to make a static 3.5 based bash to see what happens.




Rodney -> RE: Problem with bash 3.xyz (Sep. 26, '06, 6:55:42 PM)

> I'm going to make a static 3.5 based bash to see what happens.

Well, that sucked. A static version (which has to have the 'enable' function,
ironically, disabled for a static build) still crashes the same way.
I get it kacking over when started as a login shell from a shortcut.
So... I'll try something else.




Rodney -> RE: Problem with bash 3.xyz (Sep. 26, '06, 7:10:25 PM)

I've narrowed it down to the specific line in bash (a free() call).
I'm looking to see if there is a double free for this address or something like that.
But given I can see this same code work when started from within another shell
I think it has to be something else.




Page: [1]



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.047