Odd. If I rebuild neko 1.6.0 with these flags, it runs to completion
without error:

 CFLAGS = -Wall -g -fPIC -fno-strict-aliasing -Ivm \
          -I$(GCDIR)/include -DCOMPACT_TABLE

But if I add -O1 or -O2 to CFLAGS you get this segfault:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210504816 (LWP 4615)]
0xb7e6582a in memcpy () from /lib/i686/libc.so.6
(gdb) where
#0  0xb7e6582a in memcpy () from /lib/i686/libc.so.6
#1  0xb7f60a65 in neko_module_jit (m=0x809cf88) at vm/jit_x86.c:2616
#2  0xb7f5da21 in neko_read_module (r=0xb7f5cf10 <neko_file_reader>,
    p=0x807b038, loader=0x8060fc0) at vm/module.c:510
#3  0xb7f5afb6 in loader_loadmodule (mname=0x80617c0, vthis=0x8060fc0)
    at vm/load.c:349
#4  0xb7f534de in neko_val_callEx (vthis=0x8060fc0, f=0x805e960,
    args=0xbffef498, nargs=2, exc=0xbffef4a0) at vm/callback.c:76
#5  0x08049353 in ?? ()
#6  0x08060fc0 in ?? ()
#7  0x0805e960 in ?? ()
#8  0xbffef498 in ?? ()
#9  0x00000002 in ?? ()
#10 0xbffef4a0 in ?? ()
#11 0xb7f68a50 in ?? ()
#12 0xbffef554 in ?? ()
#13 0x00000005 in ?? ()
#14 0xb7e0a45e in ?? () from /lib/i686/libc.so.6
#15 0xbffef558 in ?? ()
#16 0x00000000 in ?? ()
(gdb) up
#1  0xb7f60a65 in neko_module_jit (m=0x809cf88) at vm/jit_x86.c:2616
2616                            memcpy(buf2,ctx->baseptr,curpos);
(gdb) print ctx
$1 = (jit_ctx *) 0x8276fc8
(gdb) print *ctx
$2 = {buf = {p = 0x98d29b96, b = 0x98d29b96 "", w = 0x98d29b96,
    c = 0x98d29b96 "", i = 0x98d29b96}, baseptr = 0x76a8c000,
  module = 0x809cf88, curpc = 149402, size = 573168818, pos = 0x82ae000,
  debug_wait = 28, jumps = 0x48593070, traps = 0x48593ef0}
(gdb) print curpos
$3 = 1990770688


$ gcc -v
Using built-in specs.
Target: i586-mandriva-linux-gnu
Configured with: ../configure --prefix=/usr --libexecdir=/usr/lib 
--with-slibdir=/lib
--mandir=/usr/share/man --infodir=/usr/share/info --enable-shared 
--enable-threads=posix
--enable-checking=release --enable-languages=c,c++,ada,fortran,objc,obj-c++,java
--host=i586-mandriva-linux-gnu --with-cpu=generic --with-system-zlib 
--enable-long-long
--enable-__cxa_atexit --enable-clocale=gnu --disable-libunwind-exceptions 
--enable-java-awt=gtk
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --enable-gtk-cairo 
--enable-ssp
--disable-libssp
Thread model: posix
gcc version 4.1.1 20060724 (prerelease) (4.1.1-4pclos2007)

Which version of gcc do you recommend to use to build neko?



       
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase.
http://farechase.yahoo.com/

-- 
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to