hughperman / pure-lang

Automatically exported from code.google.com/p/pure-lang
0 stars 0 forks source link

[i|i=1..2]; causes SIGSEGV on Mac 64-bit Intel Snow Leopard 0.43 and latest SVN #25

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Execute `[1|i=1..2];` in pure console. Causes:
Segmentation fault

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000000015fbfe940
0x0000000100f8021c in ?? ()
(gdb) bt
#0  0x0000000100f8021c in ?? ()
#1  0x0000000100086224 in interpreter::doeval (this=0x1018d3300, x=@0x0, 
e=@0x7fff5fbfc168, keep=false) at interpreter.cc:7707
#2  0x0000000100097d94 in interpreter::eval (this=0x7fff5fbfe2e0, 
x=@0x102a0ab60, 
e=@0x7fff5fbfc168, keep=<value temporarily unavailable, due to optimizations>) 
at 
interpreter.cc:1817
#3  0x0000000100097f31 in interpreter::exec (this=0x7fff5fbfe2e0, 
x=0x102a0ab60) at 
interpreter.cc:2640
#4  0x00000001001c3c10 in yy::parser::parse (this=0x7fff5fbfddf0) at 
parser.yy:241
#5  0x0000000100087ea6 in std::list<expr, std::allocator<expr> >::clear () at 
/usr/include/c++/4.2.1/bits/stl_list.h:1624
#6  0x0000000100087ea6 in interpreter::run (this=0x7fff5fbfe2e0, _s=<value 
temporarily 
unavailable, due to optimizations>, check=false, sticky=true) at 
interpreter.cc:1625
#7  0x0000000100002ed7 in std::string::_M_rep () at 
/usr/include/c++/4.2.1/bits/basic_string.h:759
#8  0x0000000100002ed7 in ~basic_string [inlined] () at pure.cc:493
#9  ~basic_string [inlined] () at /usr/include/c++/4.2.1/bits/basic_string.h:493
#10 0x0000000100002ed7 in main (argc=<value temporarily unavailable, due to 
optimizations>, argv=0x7fff5fbff8e0) at pure.cc:759

$ llvm-config --version
2.6

$ gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646) (dot 1)

$ uname -a
Darwin macono 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26 11:58:09 PST 
2010; root:xnu-
1504.3.12~1/RELEASE_I386 i386

GCC builds 64-bit executables, LLVM is compiles as 64-bit. Tried both with 
FastCC and with --
disable-fastcc.
Crashes both latest SVN and 0.43 version.

Regards,
Adam

Original issue reported on code.google.com by i...@nanoant.com on 9 Apr 2010 at 3:47

GoogleCodeExporter commented 8 years ago
Yes, this is a known issue using the LLVM 2.6 JIT with 64 bit on OSX. Can you 
try the
LLVM 2.7 release candidate please? Reportedly this works now, although there 
are a
few gotchas:
http://groups.google.com/group/pure-lang/browse_thread/thread/63c64025d01321f

(The issue with the configure script detecting the wrong target triple should be
fixed in Pure svn now, but if your compiler produces 32 bit binaries by default 
then
you might still need the --build option as described in the cited mailing list
thread, in order to make the batch compiler work.)

Please let me know how it goes.

Original comment by aggraef@gmail.com on 13 Apr 2010 at 12:58

GoogleCodeExporter commented 8 years ago
Indeed LLVM 2.7 solves the problem, so this issue can be closed.

Original comment by i...@nanoant.com on 14 Apr 2010 at 3:08

GoogleCodeExporter commented 8 years ago

Original comment by aggraef@gmail.com on 14 Apr 2010 at 5:21