From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from np.nosc.mil ([128.49.228.66]) by hawkwind.utcs.utoronto.ca with SMTP id <23980>; Thu, 5 Feb 1998 19:19:26 -0500 Received: (qmail 17918 invoked by uid 1168); 5 Feb 1998 21:48:31 -0000 Date: Thu, 5 Feb 1998 16:48:31 -0500 Message-ID: <19980205214831.17917.qmail@np.nosc.mil> To: rc@hawkwind.utcs.toronto.edu In-reply-to: (message from Tim Goodwin on Thu, 5 Feb 1998 11:46:00 +0000) Subject: Re: "rc" shell maintainer? From: Vincent Broman Reply-to: broman@nosc.mil -----BEGIN PGP SIGNED MESSAGE----- I tried out rc-1.5b2 on my SunOS 4.1.3 (with most Sun patches) machine and gcc-2.7.2, and I got a core dump during trip. Any suggestions? Program received signal SIGSEGV, Segmentation fault. 0xf773470c in malloc () (gdb) bt #0 0xf773470c in malloc () #1 0xa55c in ealloc (n=12) at nalloc.c:115 #2 0x7398 in get_var_place (s=0xc8f8 "*", stack=TRUE) at hash.c:151 #3 0xc80c in varassign (name=0xc8f8 "*", def=0x1b814, stack=TRUE) at var.c:18 #4 0xcc18 in starassign (dollarzero=0x1b838 "", a=0x1b810, stack=TRUE) at var.c:143 #5 0x239c in funcall (av=0x1b800) at builtins.c:77 #6 0x3d0c in exec (s=0x2374, parent=TRUE) at exec.c:90 #7 0xd494 in walk (n=0x1b788, parent=TRUE) at walk.c:37 #8 0x8694 in doit (execit=TRUE) at input.c:296 #9 0x9fa4 in main (argc=2, argv=0xf7ffef4c, envp=0xf7ffef50) at main.c:98 This appears to bomb in malloc while the argument list is being set up to execute "submatch 'umask bad' 'bad umask' 'bad umask'". I have essentially no trouble on another SunOS 4.1.4 machine with the same source code. This problem occurs with readline, editline, or nothing added. The following are the only local changes I've made. - --- config.h.in.orig Mon Jul 7 08:43:53 1997 +++ config.h.in Wed Feb 4 15:40:59 1998 @@ -2,4 +2,5 @@ #undef STDC_HEADERS +#undef HAVE_SYS_TYPES_H #undef HAVE_SYS_RESOURCE_H #undef RLIMIT_NEEDS_KERNEL - --- configure.in.orig Mon Jul 7 08:43:53 1997 +++ configure.in Wed Feb 4 16:48:10 1998 @@ -277,10 +277,14 @@ AC_ARG_WITH(editline, [ --with-editline Simmule Turner's line editing], AC_CHECK_LIB(edit, readline, - - AC_DEFINE(READLINE) LIBS="$LIBS -ledit", + AC_DEFINE(READLINE) + LIBS="-ledit $LIBS", AC_MSG_WARN(editline library not found))) AC_ARG_WITH(readline, [ --with-readline Bloated GNU line editing], + AC_CHECK_LIB(termcap,tputs,LIBS="-ltermcap $LIBS", + AC_CHECK_LIB(ncurses,tputs,LIBS="-lncurses $LIBS")) AC_CHECK_LIB(readline, readline, - - AC_DEFINE(READLINE) LIBS="$LIBS -lreadline -ltermcap", + AC_DEFINE(READLINE) + LIBS="-lreadline $LIBS", AC_MSG_WARN(readline library not found))) - --- which.c.orig Mon Jul 7 08:43:53 1997 +++ which.c Wed Feb 4 17:02:32 1998 @@ -20,5 +20,5 @@ #define X_ALL (X_USR|X_GRP|X_OTH) - -extern int stat(const char *, struct stat *); +extern int stat(char *, struct stat *); static bool initialized = FALSE; @@ -88,5 +88,5 @@ gid = getegid(); #if HAVE_GETGROUPS - - ngroups = getgroups(0, (gid_t *)0); + ngroups = getgroups(0, (GETGROUPS_T *)0); gidset = malloc(ngroups * sizeof(gid_t)); if (!gidset) Vincent Broman, code D712 Bayside Space and Naval Warfare Systems Center, San Diego (was NOSC, NRaD) San Diego, CA 92152-6145, USA Phone: +1 619 553 1641 Email: broman at spawar.navy.mil or nosc.mil PGP protected mail preferred. -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBNNozTGCU4mTNq7IdAQGtUwP/W/hnkSZKulAZhodR7+b3fX+M1WnISqLp XHB614mZVY0prcuoPpf0sXwb4nxLu3R03PhXCsymGnxzmyPR9nzqY+zOjniZd8SA ow6h59DBPA3Or5ULOWJfeSC/+K53s7dXwbS1FH9QkclF/hhICd1u6Uzf5A6pa+ND 8l3Anxd9/X8= =28Zb -----END PGP SIGNATURE-----