Mercury Bugs - mercury
View Issue Details
0000109mercuryBugpublic2009-10-09 18:282010-09-14 12:23
Reporterjanicek 
Assigned Tozs 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformDarwinOSMac OS XOS Version10.5.8
Product Version 
Target VersionFixed in Version 
Summary0000109: rotd-2009-10-05's library install fails for grade hlc
DescriptionI'm installing Mercury rotd-2009-10-05, with libgrade hlc. "make" seems to run without problems, but while in "make install", I get the following message and the install terminates:

-- BEGIN SNIPPET
...
mmc --compile-to-c --grade hlc --mercury-linkage shared --flags LIB_FLAGS --flags INTER_FLAGS -R/Users/sandius/Developer/mercury-rotd-2009-10-05/lib/mercury/lib/hlc -R/Users/sandius/Developer/mercury-rotd-2009-10-05/lib/mercury/lib bit_buffer.read > bit_buffer.read.err 2>&1
mmc --make-optimization-interface --grade hlc --mercury-linkage shared --flags LIB_FLAGS --flags INTER_FLAGS -R/Users/sandius/Developer/mercury-rotd-2009-10-05/lib/mercury/lib/hlc -R/Users/sandius/Developer/mercury-rotd-2009-10-05/lib/mercury/lib bit_buffer.write
mmc --make-transitive-optimization-interface --grade hlc --mercury-linkage shared --flags LIB_FLAGS --flags INTER_FLAGS -R/Users/sandius/Developer/mercury-rotd-2009-10-05/lib/mercury/lib/hlc -R/Users/sandius/Developer/mercury-rotd-2009-10-05/lib/mercury/lib bit_buffer.write
mmc --compile-to-c --grade hlc --mercury-linkage shared --flags LIB_FLAGS --flags INTER_FLAGS -R/Users/sandius/Developer/mercury-rotd-2009-10-05/lib/mercury/lib/hlc -R/Users/sandius/Developer/mercury-rotd-2009-10-05/lib/mercury/lib bit_buffer.write > bit_buffer.write.err 2>&1
mmc --compile-to-c --grade hlc --mercury-linkage shared --flags LIB_FLAGS --flags INTER_FLAGS -R/Users/sandius/Developer/mercury-rotd-2009-10-05/lib/mercury/lib/hlc -R/Users/sandius/Developer/mercury-rotd-2009-10-05/lib/mercury/lib --no-warn-insts-without-matching-type --no-erlang-native-code bitmap > bitmap.err 2>&1
gmake[2]: *** [bitmap.c_date] Error 1
gmake[2]: Leaving directory `/Users/sandius/tmp/mercury-compiler-rotd-2009-10-05/install_grade_dir.hlc/library'
To clean up from failed install, remove /Users/sandius/tmp/mercury-compiler-rotd-2009-10-05/install_grade_dir.hlc
gmake[1]: *** [install_grades] Error 1
gmake[1]: Leaving directory `/Users/sandius/tmp/mercury-compiler-rotd-2009-10-05'
make: *** [install] Error 2

-- END SNIPPET --

$ cat install_grade_dir.hlc/library/bitmap.err
Uncaught Mercury exception:
Software Error: ml_disj_gen.m: Unexpected: ml_gen_disj: single disjunct

$ gcc --version
i686-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5566)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ uname -a
Darwin dfki-guestpool8.dfki.uni-sb.de 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386

Configure command:
$ ./configure --prefix=$HOME/Developer/mercury-rotd-2009-10-05 --enable-libgrades=hlc

config.log attached.
TagsNo tags attached.
Attached Fileslog config.log (235,981) 2009-10-09 18:28
https://bugs.mercurylang.org/file_download.php?file_id=81&type=bug
? bug109.m (1,611) 2009-10-12 12:34
https://bugs.mercurylang.org/file_download.php?file_id=82&type=bug

Notes
(0000198)
wangp   
2009-10-09 21:25   
(Last edited: 2009-10-09 21:26)
What about grade "hlc.gc"? It worked for me on Linux. (Nonetheless it does look like a bug.)

(0000199)
janicek   
2009-10-09 21:34   
hlc.gc works. However, I wanted to suppress garbage collection as it randomly causes SIGBUSes in my code (which is my fault, I suppose, probably some stray pointers caused by sloppy interfacing to C++...)
(0000200)
janicek   
2009-10-09 21:41   
Is there perhaps a way to *delay* garbage collection as much as possible? That would also be helpful (to me right now, not solving this issue of course).
(0000201)
wangp   
2009-10-09 21:59   
You can use hlc.gc but set the GC_DONT_GC environment variable to switch it off completely. There are other environment variables (from Boehm GC) which let you set the initial heap size, etc.
(0000202)
janicek   
2009-10-09 22:43   
That helped, thanks!
(0000203)
juliensf   
2009-10-12 10:23   
What is the reason you are using the hlc grade? Grades without
garbage collection are not generally useful. (It should still
work of course.)
(0000205)
juliensf   
2009-10-12 10:30   
Sorry, didn't see the above.
(0000206)
juliensf   
2009-10-12 12:34   
I have uploaded a cut-down test case for this bug.
It appears to be a problem with --reclaim-heap-on-failure.
(0000287)
zs   
2010-09-14 12:23   
Fix committed 14 sep 2010.

Issue History
2009-10-09 18:28janicekNew Issue
2009-10-09 18:28janicekFile Added: config.log
2009-10-09 21:25wangpNote Added: 0000198
2009-10-09 21:26wangpNote Edited: 0000198
2009-10-09 21:34janicekNote Added: 0000199
2009-10-09 21:41janicekNote Added: 0000200
2009-10-09 21:59wangpNote Added: 0000201
2009-10-09 22:43janicekNote Added: 0000202
2009-10-12 10:23juliensfNote Added: 0000203
2009-10-12 10:23juliensfStatusnew => acknowledged
2009-10-12 10:30juliensfNote Added: 0000205
2009-10-12 12:34juliensfFile Added: bug109.m
2009-10-12 12:34juliensfNote Added: 0000206
2009-10-12 12:34juliensfStatusacknowledged => confirmed
2010-09-13 14:23zsStatusconfirmed => assigned
2010-09-13 14:23zsAssigned To => zs
2010-09-14 12:23zsNote Added: 0000287
2010-09-14 12:23zsStatusassigned => resolved
2010-09-14 12:23zsResolutionopen => fixed