[Gc] Boehm-GC 7.0 alpha 6 on Solaris 10/x86 and amd64

Rainer Orth ro at TechFak.Uni-Bielefeld.DE
Thu Jun 8 13:18:42 PDT 2006


Hans,

I've just tried again to build and run boehm-gc 7.0 alpha from current CVS
on Solaris 10/x86.  All tests were run on a Sun Fire V40z running Solaris
10 Update 2 Beta.

I've run four different tests:

* 32-bit compilation with gcc 4.1.1:

  boehm-gc builds and the tests run successfully.

* 32-bit compilation with Studio 11 cc:

  boehm-gc builds successfully, one test fails:

Switched to incremental mode
Reading dirty bits from /proc
List reversal produced incorrect list - collector is broken
Test failed
/bin/bash: line 1: 22549 Abort                   ${dir}$tst
FAIL: gctest
Leaked composite object at 8072fe8 (/vol/gnu/src/boehm-gc/bdwgc/tests/leak_test.c:12, sz=4, NORMAL)

PASS: leaktest
Final heap size is 65536
PASS: middletest
==================================
1 of 3 tests failed
Please report to Hans.Boehm at hp.com
==================================

* 64-bit compilation with gcc 4.1.1 -m64:

  build initially fails:

In file included from /vol/gnu/src/boehm-gc/bdwgc/include/private/gc_priv.h:64,
                 from /vol/gnu/src/boehm-gc/bdwgc/allchblk.c:19:
/vol/gnu/src/boehm-gc/bdwgc/include/private/gcconfig.h:458: error: expected identifier or '(' before '--' token
/vol/gnu/src/boehm-gc/bdwgc/include/private/gcconfig.h:2075: error: expected identifier or '(' before '--' token
make[1]: *** [allchblk.lo] Error 1

  The following patch to gcconfig.h fixes the compilation failure:

Index: gcconfig.h
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/include/private/gcconfig.h,v
retrieving revision 1.15
diff -u -p -r1.15 gcconfig.h
--- gcconfig.h	7 Jun 2006 05:35:31 -0000	1.15
+++ gcconfig.h	8 Jun 2006 20:02:42 -0000
@@ -146,6 +146,11 @@
 #    define SOLARIS
 #    define mach_type_known
 # endif
+# if defined(sun) && defined(__amd64)
+#    define X86_64
+#    define SOLARIS
+#    define mach_type_known
+# endif
 # if (defined(__OS2__) || defined(__EMX__)) && defined(__32BIT__)
 #    define I386
 #    define OS2
@@ -1888,6 +1893,47 @@
 	extern char etext[];
 #	define SEARCH_FOR_DATA_START
 #   endif
+#   ifdef SOLARIS
+#	define OS_TYPE "SOLARIS"
+#	define ELF_CLASS ELFCLASS64
+        extern int _etext[], _end[];
+  	extern ptr_t GC_SysVGetDataStart(size_t, ptr_t);
+#       define DATASTART GC_SysVGetDataStart(0x1000, (ptr_t)_etext)
+#	define DATAEND (_end)
+/*	# define STACKBOTTOM ((ptr_t)(_start)) worked through 2.7,  	*/
+/*      but reportedly breaks under 2.8.  It appears that the stack	*/
+/* 	base is a property of the executable, so this should not break	*/
+/* 	old executables.						*/
+/*  	HEURISTIC2 probably works, but this appears to be preferable.	*/
+/*	Apparently USRSTACK is defined to be USERLIMIT, but in some	*/
+/* 	installations that's undefined.  We work around this with a	*/
+/*	gross hack:							*/
+#       include <sys/vmparam.h>
+#	ifdef USERLIMIT
+	  /* This should work everywhere, but doesn't.	*/
+#	  define STACKBOTTOM USRSTACK
+#       else
+#	  define HEURISTIC2
+#       endif
+/* At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
+/* It appears to be fixed in 2.8 and 2.9.				*/
+#	ifdef SOLARIS25_PROC_VDB_BUG_FIXED
+#	  define PROC_VDB
+#	endif
+#	define DYNAMIC_LOADING
+#	if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)
+#	    define USE_MMAP
+	    /* Otherwise we now use calloc.  Mmap may result in the	*/
+	    /* heap interleaved with thread stacks, which can result in	*/
+	    /* excessive blacklisting.  Sbrk is unusable since it	*/
+	    /* doesn't interact correctly with the system malloc.	*/
+#	endif
+#       ifdef USE_MMAP
+#         define HEAP_START (ptr_t)0x40000000
+#       else
+#	  define HEAP_START DATAEND
+#       endif
+#   endif
 # endif
 
 #if defined(LINUX) && defined(USE_MMAP)

  It duplicates the Solaris/x86 section, defines ELF_CLASS as ELFCLASS64 as
  I had described at some point in the past, and duplicates the hack from
  the Solaris/SPARC section since for amd64, USERLIMIT is undefined.  (I
  could further investigate what's going on there if there's interest.)

  With this change, boehm-gc builds correctly and all tests pass.

* 64-bit compilation with Studio 11 cc -xarch=amd64:

  boehm-gc builds correctly, though I noticed a warning during the
  configure run (which was done with configure CC='cc -xarch=amd64'):

./config.status: line 396: -xarch=amd64: command not found

  I haven't further investigated this yet, though.

  Unfortunately, one test fails as in the 32-bit case with cc:

Switched to incremental mode
Reading dirty bits from /proc
/bin/bash: line 1: 15499 Segmentation Fault      ${dir}$tst
FAIL: gctest
Leaked composite object at 433fe0 (/vol/gnu/src/boehm-gc/bdwgc/tests/leak_test.c:12, sz=4, NORMAL)

PASS: leaktest
Final heap size is 65536
PASS: middletest
==================================
1 of 3 tests failed
Please report to Hans.Boehm at hp.com
==================================

Btw., I noticed in doc/README.changes that you have replaced the Solaris/UI
threads code for gc6.8 (6.9?) with pthreads.  I had posted a quick hack for
this some time ago, but I'd like to get a proper version of this integrated
into GCC for the 4.2 (or at least 4.3) release, where 7.0 alpha almost
certainly isn't appropriate.  Therefore, I'd like to know if you could make
that version available for testing and eventually release it so it becomes
appropriate for GCC integration?

Thanks in advance.

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University




More information about the Gc mailing list