Date: Sat, 13 Feb 1999 18:39:25 +0100 (MET) From: Juergen Lock <nox@jelal.kn-bremen.de> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/10064: /bin/sh called from make dumps core Message-ID: <199902131739.SAA02095@saturn.kn-bremen.de>
next in thread | raw e-mail | index | archive | help
>Number: 10064 >Category: bin >Synopsis: /bin/sh called from make dumps core >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Feb 13 09:50:00 PST 1999 >Closed-Date: >Last-Modified: >Originator: Juergen Lock >Release: FreeBSD 2.1.7-RELEASE i386 >Organization: me? organized? >Environment: >Description: During a long build (cygwin32 as cross compiler) /bin/sh called from gmake dumps core inside popstackmark(). Replacing the 2.1-stable sh with a 2.2.5-RELEASE one didn't help, so i tried the patch below: now its still building as i write this. >How-To-Repeat: I can send my (unfinished) port if your intrested, but you'll need some 250 MBytes free and wait a while before it gets to the point where it happenes. this is the C file i used to attach gdb to the offending sh command: -----cut-------- #include <stdio.h> int main(int argc, char **argv) { return execl ("/bin/sh", "/bin/sh", "-c", "read x; dir=`echo configure-target-libstdc++ | sed -e 's/configure-target-//'`; if [ ! -d i586-cygwin32 ]; then true; elif [ -f i586-cygwin32/${dir}/Makefile ] ; then true; elif echo \" libiberty newlib libio librx libstdc++ libg++ examples winsup \" | grep \" ${dir} \" >/dev/null 2>&1; then if [ -d ../${dir} ]; then [ -d i586-cygwin32/${dir} ] || mkdir i586-cygwin32/${dir}; r=`pwd`; export r; s=`cd ..; pwd`; export s; AR=\"` if [ -f $r/binutils/ar ] ; then echo $r/binutils/ar ; else if [ \"i386-unknown-freebsd2.1.7\" = \"i586-pc-cygwin32\" ] ; then echo ar; else t='-e s,^,i586-cygwin32-, '; echo ar | sed -e 's/x/x/' $t ; fi; fi`\"; export AR; AS=\"` if [ -f $r/gas/as-new ] ; then echo $r/gas/as-new ; else if [ \"i386-unknown-freebsd2.1.7\" = \"i586-pc-cygwin32\" ] ; then echo as; else t='-e s,^,i586-cygwin32-, '; echo as | sed -e 's/x/x/' $t ; fi; fi`\"; export AS; CC=\"` if [ -f $r/gcc/xgcc ] ; then if [ -f $r/i586-! cygwin32/newlib/Makefile ] ; then case \"i586-pc-cygwin32\" in i[3456]86-*-cygwin*) echo $r/gcc/xgcc -B$r/gcc/ -B$r/i586-cygwin32/newlib/ -L$r/i586-cygwin32/winsup -idirafter $r/i586-cygwin32/newlib/targ-include -idirafter $s/winsup/include -idirafter $s/newlib/libc/include -idirafter $s/newlib/libc/sys/cygwin -idirafter $s/newlib/libc/sys/cygwin32 -nostdinc; ;; *) echo $r/gcc/xgcc -B$r/gcc/ -idirafter $r/i586-cygwin32/newlib/targ-include -idirafter $s/newlib/libc/include -nostdinc; ;; esac else echo $r/gcc/xgcc -B$r/gcc/; fi; else if [ \"i386-unknown-freebsd2.1.7\"= \"i586-pc-cygwin32\" ] ; then echo gcc; else t='-e s,^,i586-cygwin32-, '; echo gcc | sed -e 's/x/x/' $t; fi; fi`\"; export CC; CFLAGS=\"-g -O2\"; export CFLAGS; CXX=\"` if [ -f $r/gcc/xgcc ] ; then if [ -f $r/i586-cygwin32/newlib/Makefile ] ; then case \"i586-pc-cygwin32\" in i[3456]86-*-cygwin*) echo $r/gcc/xgcc -B$r/gcc/ -B$r/i586-cygwin32/newlib/ -L$r/i586-cygwin32/winsup -idirafter $r/i586-cygwin32/newlib! /targ-include -idirafter $s/winsup/include -idirafter $s/newlib/libc/include -idirafter $s/newlib/libc/sys/cygwin -idirafter $s/newlib/libc/sys/cygwin32 -nostdinc; ;; *) echo $r/gcc/xgcc -B$r/gcc/ -idirafter $r/i586-cygwin32/newlib/targ-include -idirafter $s/newlib/libc/include -nostdinc; ;; esac else echo $r/gcc/xgcc -B$r/gcc/; fi; else if [ \"i386-unknown-freebsd2.1.7\" = \"i586-pc-cygwin32\" ] ; then echo c++; else t='-e s,^,i586-cygwin32-, '; echo c++ | sed -e 's/x/x/' $t; fi; fi`\"; export CXX; CXXFLAGS=\"-g -O2\"; export CXXFLAGS; DLLTOOL=\"` if [ -f $r/binutils/dlltool ] ; then echo $r/binutils/dlltool ; else if [ \"i386-unknown-freebsd2.1.7\" = \"i586-pc-cygwin32\" ] ; then echo dlltool; else t='-e s,^,i586-cygwin32-, '; echo dlltool | sed -e 's/x/x/' $t ; fi; fi`\"; export DLLTOOL; LD=\"` if [ -f $r/ld/ld-new ] ; then echo $r/ld/ld-new ; else if [ \"i386-unknown-freebsd2.1.7\" = \"i586-pc-cygwin32\" ] ; then echo ld; else t='-e s,^,i586-cygwin32-, '; echo ld | sed! -e 's/x/x/' $t ; fi; fi`\"; export LD; LDFLAGS=\"\"; export LDFLAGS; NM=\"` if [ -f $r/binutils/nm-new ] ; then echo $r/binutils/nm-new ; else if [ \"i386-unknown-freebsd2.1.7\" = \"i586-pc-cygwin32\" ] ; then echo nm; else t='-e s,^,i586-cygwin32-, '; echo nm | sed -e 's/x/x/' $t ; fi; fi`\"; export NM; RANLIB=\"` if [ -f $r/binutils/ranlib ] ; then echo $r/binutils/ranlib ; else if [ \"i386-unknown-freebsd2.1.7\" = \"i586-pc-cygwin32\" ] ; then echo ranlib; else t='-e s,^,i586-cygwin32-, '; echo ranlib | sed -e 's/x/x/' $t ; fi; fi`\"; export RANLIB; WINDRES=\"` if [ -f $r/binutils/windres ] ; then echo $r/binutils/windres ; else if [ \"i386-unknown-freebsd2.1.7\" = \"i586-pc-cygwin32\" ] ; then echo windres; else t='-e s,^,i586-cygwin32-, '; echo windres | sed -e 's/x/x/' $t ; fi; fi`\"; export WINDRES; echo Configuring in i586-cygwin32/${dir}; cd i586-cygwin32/${dir}; case .. in /*) topdir=.. ;; *) case \"i586-cygwin32\" in .) topdir=\"../..\" ;; *) topdir=\"! ../../..\" ;; esac ;; esac; if [ \"..\" = \".\" ] ; then if [ \"i586-cygwin32\" != \".\" ] ; then if /bin/sh $s/symlink-tree ${topdir}/${dir} \"no-such-file\" ; then if [ -f Makefile ]; then if gmake distclean; then true; else exit 1; fi; else true; fi; else exit 1; fi; else true; fi; srcdiroption=\"--srcdir=.\"; libsrcdir=\".\"; else srcdiroption=\"--srcdir=${topdir}/${dir}\"; libsrcdir=\"$s/${dir}\"; fi; if [ -f ${libsrcdir}/configure ] ; then /bin/sh ${libsrcdir}/configure --host=i586-cygwin32 --build=i386-unknown-freebsd2.1.7 --with-newlib --enable-multilib --with-cross-host=i386-unknown-freebsd2.1.7 --prefix=/usr/local/gnu-win32 ${srcdiroption} --with-target-subdir=\"i586-cygwin32\"; else /bin/sh $s/configure --host=i586-cygwin32 --build=i386-unknown-freebsd2.1.7 --with-newlib --enable-multilib --with-cross-host=i386-unknown-freebsd2.1.7 --prefix=/usr/local/gnu-win32 ${srcdiroption} --with-target-subdir=\"i586-cygwin32\"; fi;! else true; fi; else true; fi", (char *)NULL); } -----cut-------- >Fix: Index: /usr4/home4/cvs/src/bin/sh/memalloc.c =================================================================== RCS file: /home/cvs/cvs/src/bin/sh/memalloc.c,v retrieving revision 1.2 diff -u -r1.2 memalloc.c --- memalloc.c 1994/09/24 02:57:50 1.2 +++ memalloc.c 1999/02/13 16:37:22 @@ -180,6 +180,9 @@ INTOFF; while (stackp != mark->stackp) { sp = stackp; +#if 1 + if (!sp) break; +#endif stackp = sp->prev; ckfree(sp); } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902131739.SAA02095>