From 402823c45e9aa790ccbe0e4ce1cac4acdebe02a8 Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Wed, 10 May 2000 21:59:16 +0000 Subject: [PATCH] Imported 5.0 release version. 2000-05-11 Bryce McKinlay Imported 5.0 release version. * acinclude.m4: Increment version to 5.0. From-SVN: r33832 --- boehm-gc/ChangeLog | 5 +++++ boehm-gc/README | 14 ++++++++++++-- boehm-gc/acinclude.m4 | 2 +- boehm-gc/aclocal.m4 | 2 +- boehm-gc/mark.c | 25 +++++++++++++++++++++++++ boehm-gc/os_dep.c | 2 +- boehm-gc/threadlibs.c | 8 ++++---- boehm-gc/version.h | 5 +---- 8 files changed, 50 insertions(+), 13 deletions(-) diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index ba8abd13a07..628559087a0 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,8 @@ +2000-05-11 Bryce McKinlay + + Imported 5.0 release version. + * acinclude.m4: Increment version to 5.0. + 2000-05-07 Bryce McKinlay Imported version 5.0alpha7. diff --git a/boehm-gc/README b/boehm-gc/README index b89779034fb..083c7a7259d 100644 --- a/boehm-gc/README +++ b/boehm-gc/README @@ -3,7 +3,7 @@ Copyright (c) 1991-1996 by Xerox Corporation. All rights reserved. Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. Copyright (c) 1999 by Hewlett-Packard Company. All rights reserved. - [ This version of the collector modified by Cygnus Solutions. + [ This version of the collector modified for use in libgcj. See the file ChangeLog for details ] THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED @@ -15,7 +15,7 @@ Permission to modify the code and to distribute modified code is granted, provided the above notices are retained, and a notice that the code was modified is included with the above copyright notice. -This is version 5.0alpha7 of a conservative garbage collector for C and C++. +This is version 5.0 of a conservative garbage collector for C and C++. You might find a more recent version of this at @@ -1602,7 +1602,17 @@ Since 5.0alpha6: be done on other platforms, too. Since I can't test those, that'll wait until after 5.0. +Since 5.0alpha7: + - Fixed threadlibs.c for linux threads. -DUSE_LD_WRAP was broken and + -ldl was omitted. Fixed Linux stack finding code to handle + -DUSE_LD_WRAP correctly. + - Added MSWIN32 exception handler around marker, so that the collector + can recover from root segments that are unmapped during the collection. + This caused occasional failures under Windows 98, and may also be + an issue under Windows NT/2000. + To do: + - Integrate Linux/SPARC fixes. - Very large root set sizes (> 16 MB or so) could cause the collector to abort with an unexpected mark stack overflow. (Thanks again to Peter Chubb.) NOT YET FIXED. Workaround is to increase the initial diff --git a/boehm-gc/acinclude.m4 b/boehm-gc/acinclude.m4 index c9e36ceeb38..27478584e6d 100644 --- a/boehm-gc/acinclude.m4 +++ b/boehm-gc/acinclude.m4 @@ -31,7 +31,7 @@ AC_SUBST(boehm_gc_basedir) AC_CANONICAL_HOST -AM_INIT_AUTOMAKE(boehm-gc, 5.0a7, no-define) +AM_INIT_AUTOMAKE(boehm-gc, 5.0, no-define) # FIXME: We temporarily define our own version of AC_PROG_CC. This is # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We diff --git a/boehm-gc/aclocal.m4 b/boehm-gc/aclocal.m4 index 879db9632fb..797bddc1665 100644 --- a/boehm-gc/aclocal.m4 +++ b/boehm-gc/aclocal.m4 @@ -43,7 +43,7 @@ AC_SUBST(boehm_gc_basedir) AC_CANONICAL_HOST -AM_INIT_AUTOMAKE(boehm-gc, 5.0a6, no-define) +AM_INIT_AUTOMAKE(boehm-gc, 5.0, no-define) # FIXME: We temporarily define our own version of AC_PROG_CC. This is # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We diff --git a/boehm-gc/mark.c b/boehm-gc/mark.c index d77e6acd8da..461d9897957 100644 --- a/boehm-gc/mark.c +++ b/boehm-gc/mark.c @@ -252,6 +252,17 @@ static void alloc_mark_stack(); GC_bool GC_mark_some(cold_gc_frame) ptr_t cold_gc_frame; { +#ifdef MSWIN32 + /* Windows 98 appears to asynchronously create and remove writable */ + /* memory mappings, for reasons we haven't yet understood. Since */ + /* we look for writable regions to determine the root set, we may */ + /* try to mark from an address range that disappeared since we */ + /* started the collection. Thus we have to recover from faults here. */ + /* This code does not appear to be necessary for Windows 95/NT/2000. */ + /* Note that this code should never generate an incremental GC write */ + /* fault. */ + __try { +#endif switch(GC_mark_state) { case MS_NONE: return(FALSE); @@ -342,6 +353,20 @@ ptr_t cold_gc_frame; ABORT("GC_mark_some: bad state"); return(FALSE); } +#ifdef MSWIN32 + } __except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? + EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) { +# ifdef PRINTSTATS + GC_printf0("Caught ACCESS_VIOLATION in marker. " + "Memory mapping disappeared.\n"); +# endif /* PRINTSTATS */ + /* We have bad roots on the stack. Discard mark stack. */ + /* Rescan from marked objects. Redetermine roots. */ + GC_invalidate_mark_state(); + scan_ptr = 0; + return FALSE; + } +#endif /* MSWIN32 */ } diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c index 636495ed039..b169eebcbcf 100644 --- a/boehm-gc/os_dep.c +++ b/boehm-gc/os_dep.c @@ -667,7 +667,7 @@ ptr_t GC_get_stack_base() size_t i, buf_offset = 0; f = open("/proc/self/stat", O_RDONLY); - if (f < 0 || read(f, stat_buf, STAT_BUF_SIZE) < 2 * STAT_SKIP) { + if (f < 0 || STAT_READ(f, stat_buf, STAT_BUF_SIZE) < 2 * STAT_SKIP) { ABORT("Couldn't read /proc/self/stat"); } c = stat_buf[buf_offset++]; diff --git a/boehm-gc/threadlibs.c b/boehm-gc/threadlibs.c index b2e6a10b0b9..7379454c420 100644 --- a/boehm-gc/threadlibs.c +++ b/boehm-gc/threadlibs.c @@ -5,11 +5,11 @@ int main() { # if defined(LINUX_THREADS) # ifdef USE_LD_WRAP - printf("-Wl,\"--wrap read\" -Wl,\"--wrap dlopen\" " - "-Wl,\"--wrap pthread_create\" -Wl,\"--wrap pthread_join\" " - "-Wl,\"--wrap pthread_sigmask\" -lpthread\n"); + printf("-Wl,--wrap -Wl,read -Wl,--wrap -Wl,dlopen " + "-Wl,--wrap -Wl,pthread_create -Wl,--wrap -Wl,pthread_join " + "-Wl,--wrap -Wl,pthread_sigmask -lpthread -ldl\n"); # else - printf("-lpthread\n"); + printf("-lpthread -ldl\n"); # endif # endif # if defined(IRIX_THREADS) diff --git a/boehm-gc/version.h b/boehm-gc/version.h index 2aedacce531..2c69e44dd31 100644 --- a/boehm-gc/version.h +++ b/boehm-gc/version.h @@ -1,12 +1,9 @@ #define GC_VERSION_MAJOR 5 #define GC_VERSION_MINOR 0 -#define GC_ALPHA_VERSION 7 +#define GC_ALPHA_VERSION GC_NOT_ALPHA # define GC_NOT_ALPHA 0xff -/* This is really an unreleased version which doesn't have a real version */ -/* number. */ - #ifndef GC_NO_VERSION_VAR unsigned GC_version = ((GC_VERSION_MAJOR << 16) | (GC_VERSION_MINOR << 8) | GC_ALPHA_VERSION);