hughperman / pure-lang

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

Fault during Fibonacci #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load pure: pure -i
Pure 0.35 (i386-apple-darwin10.0.0) Copyright (c) 2009 by Albert Graef
This program is free software distributed under the GNU Public License
(GPL V3 or later). Type 'help copying' for details.
Loaded prelude from /opt/local/lib/pure/prelude.pure.

2. Run the Fibonacci sequence example:
> fib n = if n<=1 then n else fib (n-2) + fib (n-1);
> map fib (0..10);

Actually occurs on any simple map:
> plus_one n = n + 1;
> map plus_one (0..10);
or
> map plus_one [1,2,3];

What is the expected output? What do you see instead?
Expected is: function is mapped to range
Actual is: Segmentation fault

What version of the product are you using? On what operating system?
Pure 0.35 (i386-apple-darwin10.0.0) (macosx 10.6)

Please provide any additional information below.
LLVM version: 2.5_1

Original issue reported on code.google.com by netgh...@gmail.com on 5 Oct 2009 at 12:37

GoogleCodeExporter commented 8 years ago
Sorry, I can't seem to rename it, it's really a fault during map :)

Original comment by netgh...@gmail.com on 5 Oct 2009 at 12:38

GoogleCodeExporter commented 8 years ago
I suspect that this is a duplicate of issue #9, i.e., a miscompiled LLVM. Can 
you
please provide information about how LLVM was configured, or what LLVM package 
you
use on darwin?

Original comment by aggraef@gmail.com on 5 Oct 2009 at 2:33

GoogleCodeExporter commented 8 years ago
I used macports to install pure with the defaults:
* pure @0.35_0+macosx
* llvm @2.5_1

Here is the port file for llvm:
http://trac.macports.org/browser/trunk/dports/lang/llvm/Portfile

The two patches it lists don't seem to be anything major (just directory 
locations).

Original comment by netgh...@gmail.com on 5 Oct 2009 at 3:46

GoogleCodeExporter commented 8 years ago
Well, the portfile looks more or less ok, but of course it depends on which 
options
were actually used in the build. Try compiling LLVM yourself as described in 
Pure's
INSTALL file or the wiki: http://code.google.com/p/pure-lang/wiki/GettingStarted

In particular, make sure that LLVM is configured with --enable-optimized
--disable-assertions --disable-expensive-checks --disable-pic (assuming that 
you're
on a 32 bit system, otherwise --enable-pic will be needed). You can also speed 
up
compilation of LLVM by adding --enable-targets=host-only, so that only the 
backend
for your specific cpu will be built.

If that doesn't help either, please post the results of 'make check'.

Original comment by aggraef@gmail.com on 6 Oct 2009 at 12:59

GoogleCodeExporter commented 8 years ago
No response, so I'm closing this issue now.

Original comment by aggraef@gmail.com on 17 Nov 2009 at 11:47