|
From: SourceForge.net <no...@so...> - 2005-06-15 09:12:28
|
Bugs item #1180386, was opened at 2005-04-11 00:36 Message generated for change (Comment added) made by hoehle You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=1180386&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: segfault Status: Open Resolution: None Priority: 5 Submitted By: David Reiss (dreiss) Assigned to: Bruno Haible (haible) Summary: Stack Overflow Twice Causes Segfault Initial Comment: Causing a stack overflow twice in a row leads to a segfault in clisp 2.33.2 on x86 Linux from Gentoo ebuild. gcc is version 3.3.5, and glibc is version 2.3.4. My "CFLAGS" is '-mcpu=i686 -O2 -pipe'. Gzipped core file is attached. Note that this error does *not* happen with a clean, debug-enabled build. Should I send this bug report to the Gentoo ebuild maintainer instead? This is how I produced the problem: $ clisp -q -q [1]> (defun f (n) (if (zerop n) 0 (f (1- n)))) F [2]> (f 10000) *** - Program stack overflow. RESET [3]> (f 10000) Segmentation fault (core dumped) This is my system configuration: $ uname -a Linux ballpoint 2.6.10-gentoo-r6_dr #1 Sun Mar 6 13:56:17 PST 2005 i686 AMD Athlon(tm) 64 Processor 3200+ AuthenticAMD GNU/Linux $ $ gcc -v Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/specs Configured with: /var/tmp/portage/gcc-3.3.5-r1/work/gcc-3.3.5/configure --enable-version-specific-runtime-libs --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3.5 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5/info --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/include/g++-v3 --host=i686-pc-linux-gnu --disable-altivec --disable-nls --enable-__cxa_atexit --enable-clocale=gnu --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --enable-shared --enable-threads=posix --disable-multilib --disable-libgcj --enable-languages=c,c++ Thread model: posix gcc version 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) $ $ clisp --version GNU CLISP 2.33.2 (2004-06-02) (built 3322071952) (memory 3322072066) Software: GNU C 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) ANSI C program Features: (PCRE CLX-ANSI-COMMON-LISP CLX SYSCALLS REGEXP CLOS LOOP COMPILER CLISP ANSI-CL COMMON-LISP LISP=CL INTERPRETER SOCKETS GENERIC-STREAMS LOGICAL-PATHNAMES SCREEN FFI GETTEXT UNICODE BASE-CHAR=CHARACTER PC386 UNIX) Installation directory: /usr/lib/clisp/ User language: ENGLISH Machine: I686 (I686) ballpoint.Stanford.EDU [128.12.51.95] ---------------------------------------------------------------------- >Comment By: Jörg Höhle (hoehle) Date: 2005-06-15 11:12 Message: Logged In: YES user_id=377168 As I noticed that SAFETY=3 disables generational GC, I tried again with normal SAFETY settings but -DNO_GENERATIONAL_GC. The bug disappears. BTW, I'm still using the old sigsegv (i.e. without some patches that should not affect i386 anyway). I tried normal settings and -DDEBUG_SPVW. It crashed as usual. I was surprised that the only debug output was, right after program start: STACK depth: 114415 SP depth: 67108956 I had expected some more messages from using that option. Here's another way to crash: [1]> (defun fact(n)(if (zerop n) 1 (* n (fact (1- n))))) FACT [2]> (fact -1) *** - Program stack overflow. RESET [3]> (room) ; or call (ext:gc) Speicherzugriffsfehler which shows that the memory is corrupt -- somewhere Here again, I'm surprised there's no output from DEBUG_SPVW. ---------------------------------------------------------------------- Comment By: Jörg Höhle (hoehle) Date: 2005-06-14 18:03 Message: Logged In: YES user_id=377168 today's experimental results: SAFETY=3 fixed the crash, while it's still in with SAFETY=2 Now, where to look next?? Note that with SAFETY=2, STACK_register is not used, so that should not be the culprit this time. Well, actually, STACK_register was not used in my default build anyway since I'm using gcc-3.3 per default and lispbibl.d disables it for GNUC_MINOR<4. ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2005-05-24 15:08 Message: Logged In: YES user_id=5735 patches are in this thread: <http://thread.gmane.org/gmane.lisp.clisp.general/9405> ---------------------------------------------------------------------- Comment By: Jörg Höhle (hoehle) Date: 2005-05-24 10:43 Message: Logged In: YES user_id=377168 I asked Bruno Haible and he remembers/knows of no patches. Furthermore, libsigsegv-cvs is unchanged since 2.1 (what I have installed) w.r.t. i386 (mach and MacOSX changed), thus Bruno suspects a bug in CLISP: maybe STACK is in a register and not restored properly (I'll have to check whether my build and also the Ubuntu/Debian clisp-2.33.2 build uses a register variable for STACK). Summary: the crash bug is still in cvs-clisp-2005-05-18, as well as in Ubuntu's clisp-2.33.2 Debian package. ---------------------------------------------------------------------- Comment By: Jörg Höhle (hoehle) Date: 2005-05-23 18:29 Message: Logged In: YES user_id=377168 [ME too], with an even simpler case: (f -1) -> stack overflow, RESET (cl::barf) (or other errors) -> core dump Debian (April 2005 Hoary/Ubuntu) on Linux-386, both clisp-2.33.2 from Debian as well as clisp-cvs (a few days old), using libsigsegv-dev 2.1-1 packaged for Debian by Will Newton. I'll have to locate those sigsegv patches and see how I can put them into my current Debian system (replacing the Debian pre-built package). ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2005-04-11 02:22 Message: Logged In: YES user_id=5735 There have been patches on clisp-devel recently which were supposed to fix this or something similar. the patches have to be applied both to clisp and libsigsegv. presumably, Bruno will review them and apply to clisp and libsigsegv... ---------------------------------------------------------------------- Comment By: David Reiss (dreiss) Date: 2005-04-11 00:39 Message: Logged In: YES user_id=887335 I got and error from the file attachment. I'll try to attach it again. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=1180386&group_id=1355 |