From: Hoehle, Joerg-C. <Joe...@t-...> - 2006-04-28 08:36:56
|
Hi, CLISP uses two stacks: a STACK for Lisp objects and the C program stack. I'm not aware of problems with stack overflow recovery of the Lisp stack. CLISP will reset to a REPL when this happens. There were several problems with program stack overflow. They should belong to the past now that I just fixed something in CVS (related to UNIX). CLISP depends on libsigsegv to provide program stack overflow recovery. Without libsigsegv, CLISP will just crash. Beginners (those who are likely to write endless recursive functions) are advised to use a distribution of CLISP that has been compiled with libsigsegv. If your's does not contain it, please complain to the distribution's maintainer. In a new recent enough clisp, you can use (SOFTWARE-TYPE) to inquire about libsigsegv. E.g. [1]> (software-type) "cl -G5 -Ot -Oy -Ob1 -Gs -Gf -Gy -Og -W4 -DUNICODE -DDYNAMIC_FFI -DNO_GETTEXT - I. charset.lib avcall.lib callback.lib user32.lib ws2_32.lib advapi32.lib ole3 2.lib shell32.lib sigsegv.lib SAFETY=0 HEAPCODES STANDARD_HEAPCODES GENERATIONAL_GC SPVW_BLOCKS SPVW_MIXED TRI VIALMAP_MEMORY libsigsegv 2.2" Or you can use [2]> (defun fact(n)(if (zerop n) 1 (* n (fact (1- n))))) FACT ; interpreted, not compiled [3]> (fact -1) *** - Program stack overflow. RESET [4]> (fact -1) *** - Program stack overflow. RESET [5]> With libsigsegv, CLISP should exhibit the above behaviour. However, there were two bugs: 1) gcc4 causes libsigsegv to misconfigure and not provide stack overflow detection. This can be seen in the include file sigsegv.h. If it does not say #if 1 # define HAVE_STACK_OVERFLOW_RECOVERY 1 and your Linux is new enough and gcc4 was used to compile it, it's misconfigured. This bug affects Ubuntu Breezy Debian, among other distributions. Ubuntu Hoary used gcc-3.4 and was not affected. A patch is available at http://sourceforge.net/tracker/index.php?func=detail&aid=1452072&group_id=61267&atid=496662 2) CLISP did not reset signals after stack overflow on UNIX, leading to the "CLISP dumps core after second stack overflow" symptom. This is what I just fixed in CVS. In summary there are no known issues left that I know of. CLISP + libsigsegv (current is 2.2) will work fine if o on MS-Windows-XP, you use libsigsegv from CVS o on other MS-Windows, you can use the 2.2 release o on Unix with gcc4, you use my patch to libsigsegv 2.2 o on Unix with another gcc, you can use the 2.2 release. I hope that the libsigsegv maintainer will find time to release 2.3 ASAP. In the meantime, I think I'll file a bug report to Debian to have the patch applied independently. Regards, Jorg Hohle |
From: Yaroslav K. <kav...@je...> - 2006-04-28 09:00:51
|
Hoehle, Joerg-Cyril wrote: > CLISP + libsigsegv (current is 2.2) will work fine if > o on MS-Windows-XP, you use libsigsegv from CVS > o on other MS-Windows, you can use the 2.2 release Version of the clisp? libsigsegv with[out] patch? [1]> (VERSION) #<VERSION :MAJOR 5 :MINOR 0 :BUILD 2195 :PLATFORM :NT :SERVICE-PACK "Service Pack 4" :SERVICE-PACK-MAJOR 4 :SERVICE-PACK-MINOR 0 :SUITES NIL :PRODUCT-TYPE :WORKSTATION> [2]> (SOFTWARE-VERSION) "GNU C 3.4.5 (mingw special)" [3]> (LISP-IMPLEMENTATION-VERSION) "2.38 (2006-01-24) (built 3350973001) (memory 3350973673)" [4]> (software-type) "gcc -mno-cygwin -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -Wmissing-declarations -Wno-sign-compare -O2 -fexpensive-optimizations -D_WIN32 -DUNICODE -DDYNAMIC_FFI -I. -x none -lintl libcharset.a libavcall.a libcallback.a /usr/local/lib/libreadline.a -ltermcap -luser32 -lws2_32 -lole32 -loleaut32 -luuid /usr/local/lib/libiconv.a -L/usr/local/lib -lsigsegv SAFETY=0 HEAPCODES STANDARD_HEAPCODES GENERATIONAL_GC SPVW_BLOCKS SPVW_MIXED TRIVIALMAP_MEMORY libsigsegv 2.2 libiconv 1.9 libreadline 5.0" [5]> (defun fact(n)(if (zerop n) 1 (* n (fact (1- n))))) FACT [6]> (fact -1) Instant segfault -- WBR, Yaroslav Kavenchuk. |
From: Bruno H. <br...@cl...> - 2006-04-28 12:37:51
|
Joerg-Cyril Hoehle wrote: > CLISP + libsigsegv (current is 2.2) will work fine if > o on MS-Windows-XP, you use libsigsegv from CVS > o on other MS-Windows, you can use the 2.2 release > o on Unix with gcc4, you use my patch to libsigsegv 2.2 > o on Unix with another gcc, you can use the 2.2 release. > > I hope that the libsigsegv maintainer will find time to release 2.3 ASAP. GNU libsigsegv-2.3 is released, in http://ftp.gnu.org/gnu/libsigsegv/ . New in 2.3: * Support for GCC 4 contributed by Paolo Bonzini. * Support for MacOS X i386 contributed by Bruno Haible. * Improved support for Woe32 contributed by Doug Currie. Bruno |