Subject: Re: Bash-1.14.5 crashes in not too uncommon cd command
To: None <dgilbert@pci.on.ca, chet@odin.ins.cwru.edu>
From: None <Havard.Eidnes@runit.sintef.no>
List: current-users
Date: 09/17/1995 16:26:58
----Next_Part(Sun_Sep_17_16:21:57_1995)--
Content-Type: Text/Plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

> > Configuration Information [Automatically generated, do not change]:
> > Machine: sun4
> > OS: NetBSD
> > Compiler: gcc
> >
> > Description:
> > 	A core dump with the following backtrace is produced by internal-cd
> >
> > Program terminated with signal 10, Bus error.
> > #0  0x5d168 in _catclose ()
> > (gdb) bt
> > #0  0x5d168 in _catclose ()
> > #1  0x5cc00 in _catopen ()
> > #2  0x5c640 in __strerror ()
> > #3  0x58d50 in strerror ()
>
> This looks like a problem with the NetBSD C library.

Um, not quite, I'm afraid.  I seem to remember fixing this, and
yes, I found it in my archive and I now think I remember what I
did...

The problem is that on NetBSD/Sun4 you should not be using GNU's
malloc() routine, as it only aligns on 4 byte boundaries, whereas
alignment on 8 byte boundaries is needed for support of the "long
long" data type, which I think is used by (among other things)
the NLS part of the C library.

I fixed this by inserting (or modifying, I don't remember
anymore) the attached section in the machines.h file in bash.
Arguably, GNU's malloc() could be fixed instead, but I found the
way I did it to be the easiest workaround.


Hope this helps.

- H=E5vard

----Next_Part(Sun_Sep_17_16:21:57_1995)--
Content-Type: Text/Plain; charset=us-ascii

/* **************************************************************** */
/*                                                                  */
/*                      Sun Microsystems Machines                   */
/*                                                                  */
/* **************************************************************** */

/* NetBSD running on a sparc. */
#if defined (sparc) && defined (__NetBSD__)
#  define M_MACHINE "sun4"
#  define M_OS "NetBSD"
#  define SYSDEP_CFLAGS -DOPENDIR_NOT_ROBUST -DINT_GROUPS_ARRAY \
                        -DRLIMTYPE=quad_t
#  define SYSDEP_LDFLAGS -static
#  define HAVE_SYS_SIGLIST
#  define HAVE_SETLINEBUF
#  define HAVE_GETGROUPS
#  define HAVE_VFPRINTF
#  define HAVE_STRERROR
#  define VOID_SIGHANDLER
#  define HAVE_DIRENT
#  define HAVE_STRCASECMP
#  undef USE_GNU_MALLOC /* Aligns on 4, we need 8 for long long */
#endif /* sparc && __NetBSD__ */

#if defined (sun) && !defined (M_MACHINE)

----Next_Part(Sun_Sep_17_16:21:57_1995)----