From: Doug C. <e...@fl...> - 2005-03-24 19:19:32
|
Following up my earlier report (below) of a crash running cl-bench's (ackermann 3 11) when clisp is compiled with libsigsegv 2.2 on WinXP with MinGW/MSYS... I rebuilt libsigsegv with the debug switch in handler-win32.c on. Here is what results by simply launching clisp.exe and entering: (defun ackermann (m n) (declare (type integer m n)) (cond ((zerop m) (1+ n)) ((zerop n) (ackermann (1- m) 1)) (t (ackermann (1- m) (ackermann m (1- n)))))) (ackermann 3 11) This is different from the last report where I had to run (ackermann 3 11) twice before there was a crash. I assume all the "Code = 0xc0000005" exceptions below are normal Generational GC write barriers. The stack after the first stack overflow trap is at 0x32fe0 whereas the stack starts out at about 0x22fb38. Some observations: 1. the fault occurs at 0x30ffc which looks a lot like the stack wasn't really unwound 2. register ebx is 0x31000 after the second trap (0x32000 after the first) 3. I notice that non-windows platforms set STACK (%ebx) back to something else from the CONTEXT inside stackoverflow_handler(). The syntax of the UNIX_CYGWIN32 case should work in WIN32_NATIVE -- what is this supposed to do? The value (e.g., 0x32000) doesn't look too useful for STACK to me. e Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x47c2c6 Params: 0x1, 0x2215d498, Registers: eip = 0x47c2c6 eax = 0x2215d445, ebx = 0xbd1008, ecx = 0x0, edx = 0x0 esi = 0x2215d445, edi = 0x5d03f45b, ebp = 0x22fb48, esp = 0x22fb38 Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x47c2c6 Params: 0x1, 0x2213c428, Registers: eip = 0x47c2c6 eax = 0x2213c3d5, ebx = 0xbd1008, ecx = 0x0, edx = 0x0 esi = 0x2213c3d5, edi = 0x5d049d63, ebp = 0x22fb48, esp = 0x22fb38 Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x47c2c6 Params: 0x1, 0x2213b2fc, Registers: eip = 0x47c2c6 eax = 0x2213b2a9, ebx = 0xbd1008, ecx = 0x0, edx = 0x0 esi = 0x2213b2a9, edi = 0x5d049d6b, ebp = 0x22fb48, esp = 0x22fb38 Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x4928e4 Params: 0x1, 0x2201f8a8, Registers: eip = 0x4928e4 eax = 0x4000031, ebx = 0xbd1008, ecx = 0x2201f8a5, edx = 0x58cd30 esi = 0x2215f495, edi = 0x0, ebp = 0x22be28, esp = 0x22be00 i i i i i i i ooooo o ooooooo ooooo ooooo I I I I I I I 8 8 8 8 8 o 8 8 I \ `+' / I 8 8 8 8 8 8 \ `-+-' / 8 8 8 ooooo 8oooo `-__|__-' 8 8 8 8 8 | 8 o 8 8 o 8 8 ------+------ ooooo 8oooooo ooo8ooo ooooo 8 Copyright (c) Bruno Haible, Michael Stoll 1992, 1993 Copyright (c) Bruno Haible, Marcus Daniels 1994-1997 Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998 Copyright (c) Bruno Haible, Sam Steingold 1999-2000 Copyright (c) Sam Steingold, Bruno Haible 2001-2005 Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x433ad5 Params: 0x1, 0x220232dc, Registers: eip = 0x433ad5 eax = 0x4dc201, ebx = 0xbd1054, ecx = 0xbd1048, edx = 0x220232d5 esi = 0x22028e65, edi = 0x220289fa, ebp = 0x22bbe8, esp = 0x22ba60 Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x433a7f Params: 0x1, 0x22074b6c, Registers: eip = 0x433a7f eax = 0x4dc201, ebx = 0xbd100c, ecx = 0x2215d2dd, edx = 0x22074b65 esi = 0x22bba0, edi = 0x22074b2d, ebp = 0x22bb68, esp = 0x22ba30 [1]> Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x49fc2a Params: 0x1, 0x2201dbc0, Registers: eip = 0x49fc2a eax = 0x2201dbad, ebx = 0xbd1098, ecx = 0x1, edx = 0xbd1094 esi = 0xbd1080, edi = 0x22b590, ebp = 0x22b478, esp = 0x22b470 (defun ackermann (m n) (declare (type integer m n)) (cond ((zerop m) (1+ n)) ((z erop n) (ackermann (1- m) 1)) (t (ackermann (1- m) (ackermann m (1- n)))))) Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x425980 Params: 0x1, 0x2210cfb8, Registers: eip = 0x425980 eax = 0x28, ebx = 0xbd1098, ecx = 0x2201dbad, edx = 0xc80 esi = 0x0, edi = 0x2210cfb1, ebp = 0x22b438, esp = 0x22b430 Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x425980 Params: 0x1, 0x2210d000, Registers: eip = 0x425980 eax = 0x6d, ebx = 0xbd1098, ecx = 0x2201dbad, edx = 0xc80 esi = 0x12, edi = 0x2210cfb1, ebp = 0x22b438, esp = 0x22b430 Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x425c24 Params: 0x1, 0x22030fcc, Registers: eip = 0x425c24 eax = 0x0, ebx = 0xbd1120, ecx = 0x2201dbc5, edx = 0xd esi = 0x64, edi = 0x22030fc5, ebp = 0x22b2b8, esp = 0x22b2a0 Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x4afb8b Params: 0x1, 0x22010cd0, Registers: eip = 0x4afb8b eax = 0x22010bdd, ebx = 0xbd1118, ecx = 0x3f, edx = 0x3b esi = 0x22010ce1, edi = 0x2216567d, ebp = 0x22b2d8, esp = 0x22b2b0 Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x4587cf Params: 0x1, 0x2201c5d0, Registers: eip = 0x4587cf eax = 0xd9944738, ebx = 0xbd10d0, ecx = 0x0, edx = 0xec4cb9ca esi = 0x2201c5c9, edi = 0x2201c5d0, ebp = 0x22aec8, esp = 0x22aea0 Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x433ad5 Params: 0x1, 0x2202617c, Registers: eip = 0x433ad5 eax = 0x4dc201, ebx = 0xbd10e0, ecx = 0xbd10d4, edx = 0x22026175 esi = 0x220281d1, edi = 0x220281c5, ebp = 0x22b058, esp = 0x22af20 Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x433ad5 Params: 0x1, 0x22025f78, Registers: eip = 0x433ad5 eax = 0x4dc201, ebx = 0xbd10ec, ecx = 0xbd10e0, edx = 0x22025f71 esi = 0x220281d1, edi = 0x220281c8, ebp = 0x22b058, esp = 0x22af20 ACKERMANN [2]> (ackermann 3 11) Exception! Code = 0xc00000fd Flags = 0x0 Address = 0x435637 Params: 0x1, 0x32ffc, Registers: eip = 0x435637 eax = 0x221656a9, ebx = 0xc21428, ecx = 0x0, edx = 0x4daaa2 esi = 0x5d03e2b3, edi = 0x4daaa2, ebp = 0x33048, esp = 0x32fe0 *** - Program stack overflow. RESET Exception! Code = 0xc00000fd Flags = 0x0 Address = 0x42d4f0 Params: 0x0, 0x31ffc, Registers: eip = 0x42d4f0 eax = 0x42d4c0, ebx = 0x32000, ecx = 0x77c3ef3b, edx = 0x0 esi = 0x1, edi = 0x0, ebp = 0x22fdb0, esp = 0x22fd98 *** - Program stack overflow. RESET Exception! Code = 0xc0000005 Flags = 0x0 Address = 0x42d4f0 Params: 0x0, 0x30ffc, Registers: eip = 0x42d4f0 eax = 0x42d4c0, ebx = 0x31000, ecx = 0x77c3ef3b, edx = 0x0 esi = 0x1, edi = 0x0, ebp = 0x22fdb0, esp = 0x22fd98 *** - handle_fault error2 ! address = 0x30ffc not in [0x22010000,0x2215e538) ! SIGSEGV cannot be cured. Fault address = 0x30ffc. Permanently allocated: 88384 bytes. Currently in use: 1733100 bytes. Free space: 491252 bytes. Wednesday, March 23, 2005, 11:10:41 AM, you wrote: > [This picks up a thread started with Bruno re: libsigsegv 2.2 -- the > problems are (a) stack overflow when there is plenty of memory, and > (b) an Access Violation crash on the 2nd stack overflow.] > I tried getting more info by running a debug version of CLISP built with > ./configure --with-debug --with-mingw --build build-g ; > but built this way, there is no crash, but the stack doesn't grow > enough to compute (ackermann 3 11). > On the other hand, I got a strange error, as you can see in the > console dribble below > EVAL: variable L has no value > in the evaluation of (run-ackermann). > It looks like the GENERATIONAL_GC is not used in the debug version; > perhaps this is a clue. > e > $ uname -a > MINGW32_NT-5.1 DAWNE 1.0.11(0.46/3/2) 2004-04-30 18:55 i686 unknown > $ ./clisp --version > GNU CLISP 2.33.83 (2005-03-14) (built 3320580763) (memory 3320581251) > Software: GNU C 3.4.2 (mingw-special) > gcc -mno-cygwin -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit > -Wreturn-type -Wno-sign-compare -falign-functions=4 -D_WIN32 -g > -DDEBUG_OS_ERROR -DDEBUG_SPVW -DDEBUG_BYTECODE -DSAFETY=3 -DUNICODE > -DNO_TERMCAP_NCURSES -DDYNAMIC_FFI -DNO_GETTEXT -I. -x none > libcharset.a libavcall.a libcallback.a -luser32 -lws2_32 -lole32 > -loleaut32 -luuid -L/usr/local/lib -lsigsegv > SAFETY=3 HEAPCODES STANDARD_HEAPCODES SPVW_BLOCKS SPVW_MIXED TRIVIALMAP_MEMORY > libsigsegv 2.2 > Features: > (REGEXP SYSCALLS LOOP COMPILER CLOS MOP CLISP ANSI-CL COMMON-LISP LISP=CL > INTERPRETER SOCKETS GENERIC-STREAMS LOGICAL-PATHNAMES SCREEN FFI UNICODE > BASE-CHAR=CHARACTER PC386 WIN32) > Installation directory: C:\dev\clisp\clisp\build-g\ > User language: ENGLISH > Machine: PC/386 (PC/686) dawne [192.168.168.26] > Reserved address range 0x22010000-0x5d08ffff . > STACK depth: 16363 > SP depth: 1073612826 > i i i i i i i ooooo o ooooooo ooooo ooooo > I I I I I I I 8 8 8 8 8 o 8 8 > I \ `+' / I 8 8 8 8 8 8 > \ `-+-' / 8 8 8 ooooo 8oooo > `-__|__-' 8 8 8 8 8 > | 8 o 8 8 o 8 8 > ------+------ ooooo 8oooooo ooo8ooo ooooo 8 > Copyright (c) Bruno Haible, Michael Stoll 1992, 1993 > Copyright (c) Bruno Haible, Marcus Daniels 1994-1997 > Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998 > Copyright (c) Bruno Haible, Sam Steingold 1999-2000 > Copyright (c) Sam Steingold, Bruno Haible 2001-2005 > [1]> (defun ackermann (m n) > (declare (type integer m n)) > (cond > ((zerop m) (1+ n)) > ((zerop n) (ackermann (1- m) 1)) > (t (ackermann (1- m) (ackermann m (1- n)))))) > ACKERMANN > [2]> (defun run-ackermann () > (ackermann 3 11)) > RUN-ACKERMANN > [3]> (run-ackermann) > *** - EVAL: variable L has no value > The following restarts are available: > USE-VALUE :R1 You may input a value to be used instead of L. > STORE-VALUE :R2 You may input a new value for L. > ABORT :R3 ABORT > Break 1 [4]> :r3 > [5]> (run-ackermann) > *** - EVAL: variable L has no value > The following restarts are available: > USE-VALUE :R1 You may input a value to be used instead of L. > STORE-VALUE :R2 You may input a new value for L. > ABORT :R3 ABORT > Break 1 [6]> (ackermann 3 11) > *** - Program stack overflow. RESET > Break 1 [6]> (ackermann 3 11) > *** - Program stack overflow. RESET > Break 1 [6]> (ackermann 3 11) > *** - Program stack overflow. RESET > Break 1 [6]> :abort > :ABORT > Break 1 [6]> (reset) > *** - EVAL: undefined function RESET > The following restarts are available: > USE-VALUE :R1 You may input a value to be used instead of (FDEFINITIO > 'RESET). > RETRY :R2 Retry > STORE-VALUE :R3 You may input a new value for (FDEFINITION 'RESET). > ABORT :R4 ABORT > ABORT :R5 ABORT > Break 2 [7]> :r5 > [8]> (ackermann 3 11) > *** - Program stack overflow. RESET > [9]> (ackermann 3 11) > *** - Program stack overflow. RESET > [10]> (ackermann 3 11) > *** - Program stack overflow. RESET > [11]> (ackermann 3 11) > *** - Program stack overflow. RESET > [12]> *features* > (:REGEXP :SYSCALLS :LOOP :COMPILER :CLOS :MOP :CLISP :ANSI-CL :COMMON-LISP > :LISP=CL :INTERPRETER :SOCKETS :GENERIC-STREAMS :LOGICAL-PATHNAMES :SCREEN > :FFI :UNICODE :BASE-CHAR=CHARACTER :PC386 :WIN32) > [13]> > Tuesday, March 22, 2005, 7:03:36 PM, I wrote: >> I can generate this problem simply by defining >> (defun ackermann (m n) >> (declare (type integer m n)) >> (cond >> ((zerop m) (1+ n)) >> ((zerop n) (ackermann (1- m) 1)) >> (t (ackermann (1- m) (ackermann m (1- n)))))) >> (defun run-ackermann () >> (ackermann 3 11)) >> and entering >> (run-ackermann) >> in a clisp console twice. The first time it gives the >> *** - Program stack overflow. RESET >> message. The second time it gives the message, and crashes. >> GNU CLISP 2.33.83 (2005-03-14) (built 3320497605) (memory 3320497960) >> Software: GNU C 3.4.2 (mingw-special) >> gcc -mno-cygwin -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit >> -Wreturn-type -Wno-sign-compare -O2 -fexpensive-optimizations >> -D_WIN32 -DUNICODE -DNO_TERMCAP_NCURSES -DDYNAMIC_FFI -DNO_GETTEXT >> -I. -x none libcharset.a libavcall.a libcallback.a -luser32 >> -lws2_32 -lole32 -loleaut32 -luuid -L/usr/local/lib -lsigsegv >> SAFETY=0 HEAPCODES STANDARD_HEAPCODES GENERATIONAL_GC >> SPVW_BLOCKS SPVW_MIXED TRIVIALMAP_MEMORY >> libsigsegv 2.2 >> Features: >> (REGEXP SYSCALLS LOOP COMPILER CLOS MOP CLISP ANSI-CL COMMON-LISP LISP=CL >> INTERPRETER SOCKETS GENERIC-STREAMS LOGICAL-PATHNAMES SCREEN FFI UNICODE >> BASE-CHAR=CHARACTER PC386 WIN32) >> Installation directory: C:\Dev\clisp\clisp\build-mingw\ >> User language: ENGLISH >> Machine: PC/386 (PC/686) dawne [192.168.168.26] >> Whereas in 2.33.2 I get no crash... >> [1]> *features* >> (:CLOS :LOOP :COMPILER :CLISP :ANSI-CL :COMMON-LISP :LISP=CL >> :INTERPRETER :SOCKETS :GENERIC-STREAMS >> :LOGICAL-PATHNAMES :SCREEN :FFI :UNICODE :BASE-CHAR=CHARACTER :PC386 :WIN32) >> [2]> (defun ackermann (m n) >> (declare (type integer m n)) >> (cond >> ((zerop m) (1+ n)) >> ((zerop n) (ackermann (1- m) 1)) >> (t (ackermann (1- m) (ackermann m (1- n)))))) >> ACKERMANN >> [3]> (defun run-ackermann () >> (ackermann 3 11)) >> RUN-ACKERMANN >> [4]> (RUN-ACKERMANN) >> *** - Lisp stack overflow. RESET >> [5]> (RUN-ACKERMANN) >> *** - Lisp stack overflow. RESET >> [6]> (RUN-ACKERMANN) >> *** - Lisp stack overflow. RESET >> [7]> (RUN-ACKERMANN) >> *** - Lisp stack overflow. RESET >> [8]> >> Regards, >> e >> Earlier I wrote... >> Monday, March 14, 2005, 8:17:59 AM, you wrote: >>>> libsigsegv: i386-pc-mingw32 | yes | yes | 2.2 >>> Thanks, I'm adding this to the PORTING file. >> Hmm. I just tried running cl-bench with clisp built from CVS using >> libsigsegv 2.2 and got an Access Violation crash. Below is the DrMinGW >> dump. The console said: >> === running #<benchmark FIB-RATIO for 500 runs> >> === running #<benchmark ACKERMANN for 1 runs> >> *** - Program stack overflow. RESET >> *** - Program stack overflow. RESET >> <crash> >> There were no ACKERMANN results in the cl-bench report. >> Regards, >> e >> lisp.exe caused an Access Violation at location 0041b948 in >> module lisp.exe Reading from location 00030ffc. >> Registers: >> eax=004dc201 ebx=00031000 ecx=0041b930 edx=00000000 esi=00000000 edi=00030000 >> eip=0041b948 esp=0022fd98 ebp=0022fdb0 iopl=0 nv up ei pl zr na po nc >> cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246 >> Call stack: >> 0041B948 lisp.exe:0041B948 >> 0041BC6D lisp.exe:0041BC6D >> 0041BC92 lisp.exe:0041BC92 >> 004D0E15 lisp.exe:004D0E15 stack_overflow_handler handler-win32.c:116 >> static void stack_overflow_handler( >> long unsigned int faulting_page_address = 2292428, >> stackoverflow_context_t context = &{ >> DWORD ContextFlags = , >> DWORD Dr0 = , >> DWORD Dr1 = , >> DWORD Dr2 = , >> DWORD Dr3 = , >> DWORD Dr6 = , >> DWORD Dr7 = , >> FLOATING_SAVE_AREA FloatSave = { >> DWORD ControlWord = , >> DWORD StatusWord = , >> DWORD TagWord = , >> DWORD ErrorOffset = , >> DWORD ErrorSelector = , >> DWORD DataOffset = , >> DWORD DataSelector = , >> BYTEuint32[] RegisterArea = (array), >> DWORD Cr0NpxState = >> }, >> DWORD SegGs = , >> DWORD SegFs = , >> DWORD SegEs = , >> DWORD SegDs = , >> DWORD Edi = , >> DWORD Esi = , >> DWORD Ebx = , >> DWORD Edx = , >> DWORD Ecx = , >> DWORD Eax = , >> DWORD Ebp = , >> DWORD Eip = , >> DWORD SegCs = , >> DWORD EFlags = , >> DWORD Esp = , >> DWORD SegSs = , >> BYTEuint32[] ExtendedRegisters = (array) >> } >> ) >> ... >> ok: >> for (;;) >>> (*stk_user_handler) (0, context); >> } >> ... > ------------------------------------------------------------------------ > The information in this email and its attachment(s) are intended for > the exclusive use of the addressee(s) and should be assumed to contain > confidential and/or privileged information. If you are not an intended > recipient be aware that any review, disclosure, copying, modifying, > distribution, or use of this information is prohibited. If you have > received this email in error, please forward this message and notify > Flavors Inc immediately at pos...@fl... > ------------------------------------------------------- > This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 > Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows > Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register > by 3/29 & save $300 > http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click > _______________________________________________ > clisp-list mailing list > cli...@li... > https://lists.sourceforge.net/lists/listinfo/clisp-list > ------------------------------------------------------------------------ > The information in this email and its attachment(s) are intended for > the exclusive use of the addressee(s) and should be assumed to contain > confidential and/or privileged information. If you are not an intended > recipient be aware that any review, disclosure, copying, modifying, > distribution, or use of this information is prohibited. If you have > received this email in error, please forward this message and notify > Flavors Inc immediately at pos...@fl... |