hughperman / pure-lang

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

test047 failure on FreeBSD #35

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. svn co http://pure-lang.googlecode.com/svn/trunk/ && cd trunk/pure
2. FLEX=/usr/local/bin/flex ./configure --with-libgmp-prefix=/usr/local
3. gmake check

What is the expected output? What do you see instead?

--- ./test/test047.log  2010-04-28 08:45:10.000000000 +0200
+++ -   2010-04-28 08:52:37.070663448 +0200
@@ -106,9 +106,9 @@
 r!x;
 7
 update r x 3;
-{x=>5,y=>12,x=>3}
+{x=>5,y=>12,x=>7,x=>3}
 delete r x;
-{x=>5,y=>12}
+{x=>5,y=>12,x=>7}
 record {};
 {}
 record {x=>5,y=>12};

What version of the product are you using? On what operating system?

HEAD of pure trunk on "FreeBSD 9.0-CURRENT i386" (as of last October).

Please provide any additional information below.

Dropping the alignment attribute in runtime.cc as suggested in
http://groups.google.com/group/pure-lang/browse_thread/thread/b06449aaaa77aa97
helps or not depending on the compiler used:  g++ 4.2 passes the test, g++
4.4 and 4.5 fail.  The latter are somewhat dated prerelease/experimental
snapshots though, so I'll need to update and recheck.

g++ (GCC) 4.2.1 20070719  [FreeBSD]
g++44 (GCC) 4.4.3 20091027 (prerelease)
g++45 (GCC) 4.5.0 20091029 (experimental)

Original issue reported on code.google.com by neuhau...@sigpipe.cz on 30 Apr 2010 at 11:13

GoogleCodeExporter commented 8 years ago
Updated the compilers except the system one, and commenting out the align 
attribute
doesn't help with any of them:

g++42 (GCC) 4.2.5 20090325 (prerelease)
g++43 (GCC) 4.3.5 20100404 (prerelease)
g++44 (GCC) 4.4.4 20100420 (prerelease)
g++45 (GCC) 4.5.1 20100422 (prerelease)
g++46 (GCC) 4.6.0 20100424 (experimental)

I'm somewhat baffled by another thing: since the compiler update, the system
compiler, which is still 4.2.1 20070719  [FreeBSD], isn't helped by the 
attribute
removal.  As part of the update, libgmp went from libgmp-4.3.2 to gmp-5.0.1 
(it's
probably irrelevant but i'm clutching at straws).

Original comment by neuhau...@sigpipe.cz on 2 May 2010 at 10:33

GoogleCodeExporter commented 8 years ago
i'm using 8.0-STABLE amd64 (from 29.4.) with g++ 4.2.1 20070719 - all ports 
up2date.
(libgmp has version 5.0.1, llvm-2.7 portbuild).

r3400 fails on test020 and test047 - same happens under pure-0.43. also happened
with llvm-2.6. perhaps a libm/libc-related problem under FreeBSD?

Original comment by goo...@s3.enemy.org on 3 May 2010 at 9:25

GoogleCodeExporter commented 8 years ago
re the test020 failure:
http://code.google.com/p/pure-lang/source/browse/trunk/pure/INSTALL says

Please note that MSYS 1.0.11 (or at least the diffutils package from that
version) is required to make 'make check' work on Windows. Also note that
under MS Windows this step is expected to fail on some math tests in
test020.pure; this is nothing to worry about, it just indicates that some math
routines in Microsoft's C library aren't fully POSIX-compatible. The same
applies to *BSD systems.

Original comment by neuhau...@sigpipe.cz on 3 May 2010 at 11:38

GoogleCodeExporter commented 8 years ago
Unfortunately, I can't reproduce this on my 32 bit Linux system, so it looks 
like
it's a gcc-on-*BSD-specific issue. I'll have to look at the code (and maybe 
install
FreeBSD) to see what can go wrong there. In the meantime, if you have any 
further
ideas on the cause of this issue or maybe even a workaround or a fix, please 
let me know.

The relevant code is at runtime.cc, line 14433 ff., in case you want to play 
around
with it. I guess that the issue has to do with the way that the index_entry_t 
vector
is allocated inside the index_t struct. Maybe it's necessary to malloc two 
separate
pointers there, instead of making idx->ix an alias of &idx->align. The alignment
attribute is supposed to eliminate any potential alignment issues with 
&idx->align
but apparently this doesn't work on all platforms.

Original comment by aggraef@gmail.com on 17 May 2010 at 4:52

GoogleCodeExporter commented 8 years ago
memory-alignment-induced problems are *way* over my head, so don't hold your 
breath
waiting for a fix from me.

> it looks like it's a gcc-on-*BSD-specific issue

that was my hunch from the beginning; i wasn't expecting you to reproduce it on 
linux.

> I'll have to look at the code (and maybe install FreeBSD) to see what can go 
wrong
there.

i think the most productive thing would be to ask on hackers@freebsd.org, and 
i've
been meaning to do just that since i've stumbled upon the issue.  feel free to 
do so
yourself if you want to have the issue fixed promptly (every time i asked there 
the
committers were very nice, more interested in the question material than its 
fitness
for the written ml charter).

Original comment by neuhau...@sigpipe.cz on 17 May 2010 at 7:40

GoogleCodeExporter commented 8 years ago
Hi Roman, this should be fixed in r3450. Can you please give it another go?

Original comment by aggraef@gmail.com on 16 Jun 2010 at 10:01

GoogleCodeExporter commented 8 years ago
test047.pure: passed
(on freebsd8/amd64)

Original comment by goo...@s3.enemy.org on 21 Jun 2010 at 8:33

GoogleCodeExporter commented 8 years ago
test047.pure in r3464 passes for me on FreeBSD-9 i386

Original comment by neuhau...@sigpipe.cz on 21 Jun 2010 at 11:05

GoogleCodeExporter commented 8 years ago
Ok, so this is fixed. Thanks for reporting!

Original comment by aggraef@gmail.com on 22 Jun 2010 at 12:27