hughperman / pure-lang

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

Test 46+58 segfault on MinGW with llvm 3.0/final #64

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
More specifically:

$ pure
Pure 0.50 (i686-pc-mingw32) Copyright (c) 2008-2011 by Albert Graef
(Type 'help' for help, 'help copying' for license information.)
Loaded prelude from D:/MinGW/msys/1.0/local/lib/pure/prelude.pure.

> foo x x x = x;
> foo x x y = x,y;
> let x,x = foo a a a,foo a a b; 
segfault

Both llvm and Pure freshly downloaded and compiled.
MinGW gcc version 4.6.1
llvm 3.0 final
Does not happen on Linux...

Original issue reported on code.google.com by jiri.spitz@gmail.com on 5 Dec 2011 at 10:15

GoogleCodeExporter commented 8 years ago
Merged issue 65 concerning test 58:

$ pure
Pure 0.50 (i686-pc-mingw32) Copyright (c) 2008-2011 by Albert Graef
(Type 'help' for help, 'help copying' for license information.)
Loaded prelude from D:/MinGW/msys/1.0/local/lib/pure/prelude.pure.

> type List = rlistp;
> let x::List = #[1,2,3]; 
segfault

Original comment by aggraef@gmail.com on 5 Dec 2011 at 9:42

GoogleCodeExporter commented 8 years ago
Issue 65 has been merged into this issue.

Original comment by aggraef@gmail.com on 5 Dec 2011 at 9:43

GoogleCodeExporter commented 8 years ago
Hi Jiri,

I'm running mingw 4.5.2 and LLVM 2.9 here, and I can't reproduce this issue.

Can you please check whether installing LLVM 2.9 makes the failed tests go away 
for you?

Original comment by aggraef@gmail.com on 5 Dec 2011 at 9:47

GoogleCodeExporter commented 8 years ago
Both tests passed with LLVM 2.9 under otherwise identical environment.

I had the issue with gcc 4.5.2 as well - it was the reason for upgrading my 
MinGW installation.

Before LLVM 3.0/final I had some pre-release (I think rc-3) and everything was 
OK. It appeared really with the final release of LLVM 3.0.

Original comment by jiri.spitz@gmail.com on 5 Dec 2011 at 11:11

GoogleCodeExporter commented 8 years ago
Bad luck. :( So it looks like there's a regression in the Windows version of 
LLVM, not a Pure bug. Considering the failed tests, it seems to be something 
related to the linearity and type tag checking code in interpreter.cc.

Can you debug it? If I know exactly where in interpreter.cc it segfaults, it 
might be possible to work around this in some way. (But then again, the easiest 
way is probably to just go back to the working LLVM release candidate and hope 
that the problem will be fixed in LLVM 3.1.)

Original comment by aggraef@gmail.com on 6 Dec 2011 at 9:55

GoogleCodeExporter commented 8 years ago
It seems to be the dark side of the power. The debug build of Pure passes all 
tests, the -O2 build segfaults on tests 11, 15, 17, 20 and 47 :-( .

I'll stay with llvm 2.9 and I think we should abandon this issue for now.

Original comment by jiri.spitz@gmail.com on 6 Dec 2011 at 11:39

GoogleCodeExporter commented 8 years ago
Oh dear, a Heisenbug. :( The code for generating the code to check the type 
guards and inequality on the Pure side is really pretty simple, I can't find 
anything in there which might be uninitialized. So my best guess is that it's 
some weird Windows-specific bug in the LLVM JIT. To really track this down, 
we'd have to bisect from the last release candidate known to work until the 
revision of the final release.

I close this issue for now, but feel free to reopen it when you have any new 
information.

Original comment by aggraef@gmail.com on 6 Dec 2011 at 12:18