dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/libgc/doc leak.html,NONE,1.1 README,1.2


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/libgc/doc leak.html,NONE,1.1 README,1.2,1.3 README.changes,1.2,1.3 README.environment,1.2,1.3 README.linux,1.1.1.1,1.2 README.win32,1.2,1.3debugging.html,1.2,1.3
Date: Wed, 05 Feb 2003 20:35:48 -0500

Update of /cvsroot/dotgnu-pnet/pnet/libgc/doc
In directory subversions:/tmp/cvs-serv32390/libgc/doc

Modified Files:
        README README.changes README.environment README.linux 
        README.win32 debugging.html 
Added Files:
        leak.html 
Log Message:


Update the libgc library using gc6.2alpha3 from the libgc ftp site.


--- NEW FILE ---
<HTML>
<HEAD>
<TITLE>Using the Garbage Collector as Leak Detector</title>
</head>
<BODY>
<H1>Using the Garbage Collector as Leak Detector</h1>
The garbage collector may be used as a leak detector.
In this case, the primary function of the collector is to report
objects that were allocated (typically with <TT>GC_MALLOC</tt>),
not deallocated (normally with <TT>GC_FREE</tt>), but are
no longer accessible.  Since the object is no longer accessible,
there in normally no way to deallocate the object at a later time;
thus it can safely be assumed that the object has been "leaked".
<P>
This is substantially different from counting leak detectors,
which simply verify that all allocated objects are eventually
deallocated.  A garbage-collector based leak detector can provide
somewhat more precise information when an object was leaked.
More importantly, it does not report objects that are never
deallocated because they are part of "permanent" data structures.
Thus it does not require all objects to be deallocated at process
exit time, a potentially useless activity that often triggers
large amounts of paging.
<P>
All non-ancient versions of the garbage collector provide
leak detection support.  Version 5.3 adds the following
features:
<OL>
<LI> Leak detection mode can be initiated at run-time by
setting GC_find_leak instead of building the collector with FIND_LEAK
defined.  This variable should be set to a nonzero value
at program startup.
<LI> Leaked objects should be reported and then correctly garbage collected.
Prior versions either reported leaks or functioned as a garbage collector.
</ol>
For the rest of this description we will give instructions that work
with any reasonable version of the collector.
<P>
To use the collector as a leak detector, follow the following steps:
<OL>
<LI> Build the collector with -DFIND_LEAK.  Otherwise use default
build options.
<LI> Change the program so that all allocation and deallocation goes
through the garbage collector.
<LI> Arrange to call <TT>GC_gcollect</tt> at appropriate points to check
for leaks.
(For sufficiently long running programs, this will happen implicitly,
but probably not with sufficient frequency.)
</ol>
The second step can usually be accomplished with the
<TT>-DREDIRECT_MALLOC=GC_malloc</tt> option when the collector is built,
or by defining <TT>malloc</tt>, <TT>calloc</tt>,
<TT>realloc</tt> and <TT>free</tt>
to call the corresponding garbage collector functions.
But this, by itself, will not yield very informative diagnostics,
since the collector does not keep track of information about
how objects were allocated.  The error reports will include
only object addresses.
<P>
For more precise error reports, as much of the program as possible
should use the all uppercase variants of these functions, after
defining <TT>GC_DEBUG</tt>, and then including <TT>gc.h</tt>.
In this environment <TT>GC_MALLOC</tt> is a macro which causes
at least the file name and line number at the allocation point to
be saved as part of the object.  Leak reports will then also include
this information.
<P>
Many collector features (<I>e.g</i> stubborn objects, finalization,
and disappearing links) are less useful in this context, and are not
fully supported.  Their use will usually generate additional bogus
leak reports, since the collector itself drops some associated objects.
<P>
The same is generally true of thread support.  However, as of 6.0alpha4,
correct leak reports should be generated with linuxthreads.
<P>
On a few platforms (currently Solaris/SPARC, Irix, and, with -DSAVE_CALL_CHAIN,
Linux/X86), <TT>GC_MALLOC</tt>
also causes some more information about its call stack to be saved
in the object.  Such information is reproduced in the error
reports in very non-symbolic form, but it can be very useful with the
aid of a debugger.
<H2>An Example</h2>
The following header file <TT>leak_detector.h</tt> is included in the
"include" subdirectory of the distribution:
<PRE>
#define GC_DEBUG
#include "gc.h"
#define malloc(n) GC_MALLOC(n)
#define calloc(m,n) GC_MALLOC((m)*(n))
#define free(p) GC_FREE(p)
#define realloc(p,n) GC_REALLOC((p),(n))
#define CHECK_LEAKS() GC_gcollect()
</pre>
<P>
Assume the collector has been built with -DFIND_LEAK.  (For very
new versions of the collector, we could instead add the statement
<TT>GC_find_leak = 1</tt> as the first statement in <TT>main</tt>.
<P>
The program to be tested for leaks can then look like:
<PRE>
#include "leak_detector.h"

main() {
    int *p[10];
    int i;
    /* GC_find_leak = 1; for new collector versions not         */
    /* compiled with -DFIND_LEAK.                               */
    for (i = 0; i < 10; ++i) {
        p[i] = malloc(sizeof(int)+i);
    }
    for (i = 1; i < 10; ++i) {
        free(p[i]);
    }
    for (i = 0; i < 9; ++i) {
        p[i] = malloc(sizeof(int)+i);
    }
    CHECK_LEAKS();
}       
</pre>
<P>
On an Intel X86 Linux system this produces on the stderr stream:
<PRE>
Leaked composite object at 0x806dff0 (leak_test.c:8, sz=4)
</pre>
(On most unmentioned operating systems, the output is similar to this.
If the collector had been built on Linux/X86 with -DSAVE_CALL_CHAIN,
the output would be closer to the Solaris example. For this to work,
the program should not be compiled with -fomit_frame_pointer.)
<P>
On Irix it reports
<PRE>
Leaked composite object at 0x10040fe0 (leak_test.c:8, sz=4)
        Caller at allocation:
                ##PC##= 0x10004910
</pre>
and on Solaris the error report is
<PRE>
Leaked composite object at 0xef621fc8 (leak_test.c:8, sz=4)
        Call chain at allocation:
                args: 4 (0x4), 200656 (0x30FD0)
                ##PC##= 0x14ADC
                args: 1 (0x1), -268436012 (0xEFFFFDD4)
                ##PC##= 0x14A64
</pre>
In the latter two cases some additional information is given about
how malloc was called when the leaked object was allocated.  For
Solaris, the first line specifies the arguments to <TT>GC_debug_malloc</tt>
(the actual allocation routine), The second the program counter inside
main, the third the arguments to <TT>main</tt>, and finally the program
counter inside the caller to main (i.e. in the C startup code).
<P>
In the Irix case, only the address inside the caller to main is given.
<P>
In many cases, a debugger is needed to interpret the additional information.
On systems supporting the "adb" debugger, the <TT>callprocs</tt> script
can be used to replace program counter values with symbolic names.
As of version 6.1, the collector tries to generate symbolic names for
call stacks if it knows how to do so on the platform.  This is true on
Linux/X86, but not on most other platforms.
<H2>Simplified leak detection under Linux</h2>
Since version 6.1, it should be possible to run the collector in leak
detection mode on a program a.out under Linux/X86 as follows:
<OL>
<LI> Ensure that a.out is a single-threaded executable.  This doesn't yet work
for multithreaded programs.
<LI> If possible, ensure that the addr2line program is installed in
/usr/bin.  (It comes with RedHat Linux.)
<LI> If possible, compile a.out with full debug information.
This will improve the quality of the leak reports.  With this approach, it is
no longer necessary to call GC_ routines explicitly, though that can also
improve the quality of the leak reports.
<LI> Build the collector and install it in directory <I>foo</i> as follows:
<UL>
<LI> configure --prefix=<I>foo</i> --enable-full-debug --enable-redirect-malloc
--disable-threads
<LI> make
<LI> make install
</ul>
<LI> Set environment variables as follows:
<UL>
<LI> LD_PRELOAD=<I>foo</i>/lib/libgc.so
<LI> GC_FIND_LEAK
<LI> You may also want to set GC_PRINT_STATS (to confirm that the collector
is running) and/or GC_LOOP_ON_ABORT (to facilitate debugging from another
window if something goes wrong).
</ul
<LI> Simply run a.out as you normally would.  Note that if you run anything
else (<I>e.g.</i> your editor) with those environment variables set,
it will also be leak tested.  This may or may not be useful and/or
embarrassing.  It can generate
mountains of leak reports if the application wasn't designed to avoid leaks,
<I>e.g.</i> because it's always short-lived.
</ol>
This has not yet been thropughly tested on large applications, but it's known
to do the right thing on at least some small ones.
</body>
</html>

Index: README
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/libgc/doc/README,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** README      8 Apr 2002 23:36:50 -0000       1.2
--- README      6 Feb 2003 01:35:46 -0000       1.3
***************
*** 10,15 ****
  Copyright (c) 2001 by Red Hat Inc. All rights reserved.
  
! The files config.guess and a few others are copyrighted by the Free
! Software Foundation.
  
  THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
--- 10,16 ----
  Copyright (c) 2001 by Red Hat Inc. All rights reserved.
  
! Several files supporting GNU-style builds are copyrighted by the Free
! Software Foundation, and carry a different license from that given
! below.
  
  THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
***************
*** 28,32 ****
  at the notice in config.guess or ltmain.sh.)
  
! This is version 6.1alpha4 of a conservative garbage collector for C and C++.
  
  You might find a more recent version of this at
--- 29,33 ----
  at the notice in config.guess or ltmain.sh.)
  
! This is version 6.2alpha3 of a conservative garbage collector for C and C++.
  
  You might find a more recent version of this at
***************
*** 229,236 ****
  files.
  
!   Dynamic libraries are completely supported only under SunOS
  (and even that support is not functional on the last Sun 3 release),
! Linux, IRIX 5&6, HP-PA, Win32 (not Win32S) and OSF/1 on DEC AXP machines.
! On other machines we recommend that you do one of the following:
  
    1) Add dynamic library support (and send us the code).
--- 230,239 ----
  files.
  
!   Dynamic libraries are completely supported only under SunOS/Solaris,
  (and even that support is not functional on the last Sun 3 release),
! Linux, FreeBSD, NetBSD, IRIX 5&6, HP/UX, Win32 (not Win32S) and OSF/1
! on DEC AXP machines plus perhaps a few others listed near the top
! of dyn_load.c.  On other machines we recommend that you do one of
! the following:
  
    1) Add dynamic library support (and send us the code).
***************
*** 246,249 ****
--- 249,254 ----
  enforced by the standard C compilers.  If you use a nonstandard compiler
  you may have to adjust the alignment parameters defined in gc_priv.h.
+ Note that this may also be an issue with packed records/structs, if those
+ enforce less alignment for pointers.
  
    A port to a machine that is not byte addressed, or does not use 32 bit

Index: README.changes
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/libgc/doc/README.changes,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** README.changes      8 Apr 2002 23:36:50 -0000       1.2
--- README.changes      6 Feb 2003 01:35:46 -0000       1.3
***************
*** 1477,1481 ****
   - Use NPRGREG in solaris_threads.c, thus printing all registers if things
     go wrong.
!  - Added GC_MARKERS envronment variable to allow use of a single marker
     thread on an MP without confusing the lock implementation.
   - Collect much less aggressively in incremental mode with GC_TIME_UNLIMITED.
--- 1477,1481 ----
   - Use NPRGREG in solaris_threads.c, thus printing all registers if things
     go wrong.
!  - Added GC_MARKERS environment variable to allow use of a single marker
     thread on an MP without confusing the lock implementation.
   - Collect much less aggressively in incremental mode with GC_TIME_UNLIMITED.
***************
*** 1564,1568 ****
--- 1564,1766 ----
     compiling to an ARM processor from Margaret Fleck.
  
+ Since 6.1alpha4:
+  - Added GC_finalizer_mem_freed, and changed some of the code that
+    decided on heap expansion to look at it.  Memory explicitly
+    deallocated by finalizers essentially needs to be counted as reclaimed
+    by the GC.  Otherwise there are cases in which the heap can grow
+    unboundedly.  (Thanks to Mark Reichert for the test case.)
+  - Integrated Adam Megacz patches to not scan dynamic libraries if
+    we are compiling with gcc on win32.  Otherwise we need structured
+    exception handling to deal with asynchronously unmapped root
+    segments, and gcc doesn't directly support that.
+  - Integrated Anthony Green's patch to support Wine.
+  - GC_OPERATOR_NEW_ARRAY was misspelled OPERATOR_NEW_ARRAY in several
+    places, including gc_cpp.cc.  (Thanks to Wink Saville for pointing
+    this out.)
+  - Integrated Loren James Rittle's Alpha FreeBSD patches.  In
+    response to Richard Henderson's suggestion, these also
+    changed the declarations of symbols like _end on many platforms to
+    that they wouldn't mistakenly be declared as short data symbols.
+  - Integrated changes from the Debian distribution.  (Thanks to Ryan Murray
+    for pointing these out.)  Fix C++ comments in POWERPC port.  Add ARM32
+    incremental GC support.  Get rid of USE_GENERIC_PUSH_REGS for alpha/Linux,
+    this time for real.  Use va_copy to get rid of cord printf problems
+    (finally).
+  - Close file descriptor used to count cpus.  Thanks to Jeff Sturm for
+    pointing out the omission.
+  - Don't just drop gcj free lists in GC_start_reclaim, since that can
+    eventually cause the marker to see a bogus mark descriptor in the 
+    dropped objects.  The usual symptom was a very intermittent segmentation
+    fault in the marker.  This mattered only if one of the GC_gcj_malloc
+    variants was used.  (Thanks to Michael Smith, Jeff Sturm, Bryce
+    McKinley and Tom Tromey for helping to track this down.)
+  - Fixed Linux and Solaris/64 SPARC configuration.  (Thanks to David Miller,
+    Jeff Sturm, Tom Tromey, and Christian Joensson.)
+  - Fixed a typo in strdup definition.  (Thanks to Gerard A Allan.)
+  - Changed Makefile.direct to invoke $(CC) to assemble alpha_mach_dep.S.
+    This is needed on Linux.  I'm not sure whether it's better or worse
+    on Tru64.
+  - Changed gc_cpp.h once more to declare operator new and friends only in
+    a Microsoft environment.  This may need further fine tuning.  (Thanks to
+    Johannes Schmidt for pointing out that the older code breaks on gcc3.0.4.)
+  - Don't ever override strdup if it's already macro defined.  (Thanks to
+    Adnan Ali for pointing out the problem.)
+  - Changed gc_cpp.h yet again to also overload placement new.  Due to the
+    C++ overloading rules, the other overloaded new operations otherwise hide
+    placement new, which causes many STL uses to break.  (Thanks to Reza
+    Shahidi for reporting this, and to Matt Austern for proposing a fix.)
+  - Integrated cygwin pthreads support from Dan Bonachea.
+  - Turn on DYNAMIC_LOADING for NetBSD.  (Thanks to Krister Walfridsson.)
+  - Changed printing code to print more complete GC times.
+  - Applied Mark Mitchell's Irix patch to correct some bitrot.
+  - Clarified which object-printing routines in dbg_mlc.c should hold
+    the allocation lock.  Restructured the code to allow reasonable object
+    printing with -DREDIRECT_MALLOC.
+  - Fix the Linux mmap code to always start with 0x1000 as the initial hint.
+    Minor patches for 64-bit AIX, particularly to STACKBOTTOM.
+    (Thanks again to Jeffrey Mark Siskind.)
+  - Renamed "SUSPENDED" flag for Solaris threads support to avoid a conflict
+    with a system header. (Thanks to Philp Brown.)
+  - Cause win32_threads.c to handle an out of range stack pointer correctly,
+    though currently with a warning.  (Thanks to Jonathan Clark for
+    observing that win32 applications may temporarily use the stack
+    pointer for other purposes, and suggesting a fix.  Unfortunately, it's
+    not clear that there is a complete solution to this problem.)
+ 
+ Since 6.1alpha5:
+  - Added GC_MAXIMUM_HEAP_SIZE environment variable.
+  - Fix configure.in for MIPS/LINUX. (Thanks to H.J. Lu.)
+  - Double page hash table size for -DLARGE_CONFIG.
+  - Integrated Bo Thorsen's X86-64 support.
+  - STACKBOTTOM definition for LINUX/MIPS was partially changed back.
+    (Thanks to H.J. Lu and Hiroshi Kawashima for resolving this.)
+  - Replaced all occurrences of LINUX_DATA_START in gcconfig.h with
+    SEARCH_FOR_DATA_START.  It doesn't hurt to falll back to a search.
+    And __data_start doesn't seem to get defined correctly of the GC
+    library is loaded with LD_PRELOAD, e.g. for leak detection.
+  - If the GC_find_leak environment variable is set, do a
+    atexit(GC_gcollect) to give us at least one chance to detect leaks.
+    This may report some very benign leaks, but ...
+  - Addeded REDIRECT_FREE.  It's necessary if we want leak detection with
+    LD_PRELOAD.
+  - Defer printing of leaked objects, as for smashed objects.
+  - Fixed process and descriptor leak in GC_print_callers.  Try for
+    line number even if we got function name.)
+  - Ported parallel GC support and thread local allocation to Alpha.
+    Not yet well-tested.
+  - Added GC_DUMP_REGULARLY and added finalization statistics to GC_dump().
+  - Fixed Makefile.am to mention alpha_mach_dep.S instead of the defunct
+    alpha_mach_dep.s.  (Thanks to Fergus Henderson.)
+  - Incorporated a change to new_gc_alloc.h, suggested by Johannes Schmidt,
+    which should make it work with gcc3.1.  (I would still like to encourage
+    use of gc_allocator.h instead.) 
+  - Use alpha_mach_dep.S only on Linux.  (It's not clear that this is
+    optimal, but it otherwise didn't build on Tru64.  Thanks to Fergus
+    Henderson.)
+  - Added ifdef to guard free() in os_dep.c.  Otherwise we get a
+    compilation error on Irix.  (Thanks to Dai Sato.)
+  - Added an experimental version of GC_memalign to mallocx.c.  This can't
+    always work, since we don't handle alignment requests in the hblk-level
+    allocator, and we can't handle arbitrary pointer displacements unless
+    GC_all_interior_pointers is enabled.  But it should work for alignment
+    requests up to HBLKSIZE.  This is not yet documented in the standard
+    places.
+  - Finally debugged the OSF1/Tru64 thread support.  This needs more testing,
+    since I needed to add a somewhat unconvincing workaround for signal
+    delivery issues that I don't yet completely understand.  But it does
+    pass my tests, even in parallel GC mode.  Incremental GC support is
+    disabled if thread support is enabled, due to the signal issues.
+  - Eliminated name-space-incorrect definition of _cdecl from gc_cpp.h.
+  - Added GC_debug_malloc_replacement and GC_debug_realloc_replacement
+    declarations to gc.h.  On IA64, this is required for REDIRECT_MALLOC
+    to work correctly with these.
+  - Fixed Linux USE_PROC_FOR_LIBRARIES to work with a 64-bit /proc format.
+ 
+ Since 6.1:
+  - Guard the test for GC_DUMP_REGULARLY in misc.c with
+    "#ifndef NO_DEBUGGING".  Otherwise it fails to build with NO_DEBUGGING
+    defined.  (Thanks to Manuel Serrano.)
+  - Message about retrying suspend signals was incorrectly generated even when
+    flag was not set.
+  - Cleaned up MACOSX/NEXT root registration code.  There was apparently a
+    separate ifdef case in GC_register_data_segments() for no reason.
+  - Removed MPROTECT_VDB for MACOSX port, based on one negative report.
+  - Arrange for gc.h and friends to be correctly installed with GNU-style
+    "make install".
+  - Enable the GNU-style build facility include C++ support in the library
+    with --enable-cplusplus. (Thanks to Thomas Maier for some of the patch.)
+  - Mark from GC_thread_key in linux_threads.c, in case that's allocated
+    from the garbage collected heap, as it is with our own thread-specific
+    storage implementation.  (Thanks to Jeff Sturm.)
+  - Mark all free list header blocks if they are heap allocated.  This avoids
+    some unnecessary tracing.  And it remains correct if we turn clear the
+    root set. (Thanks to Jeff Sturm for identifying the bug.)
+  - Improved S390/Linux support.  Add S390/Linux 64-bit support.  (Thanks
+    to Ulrich Weigand.)
+  - Corrected the spelling of GC_{M,C}ALLOC_EXPLICTLY_TYPED to
+    GC_{M,C}ALLOC_EXPLICITLY_TYPED in gc_typed.h.  This is technically
+    an interface change.  Based on the fact that nobody reported this,
+    I suspect/hope there were no clients.
+  - Cleaned up gc_typed.h so that (1) it adds an extern "C" declaration
+    when appropriate, (2) doesn't generate references to undefined internal
+    macros, and (3) allows easier manual construction of descriptors.
+  - Close the file descriptor used by GC_print_address_map().
+  - Set the "close-on-exec" bit for various file descriptors maintained
+    for the collector's internal use.
+  - Added a hack to find memory segments owned by the system allocator
+    under win32.  Based on my tests, this tends to eventually find all
+    segments, though it may take a while.  There appear to be cleaner,
+    but slower solutions under NT/XP.  But they rely on an API that's
+    unsupported under 9X.
+  - Changed Linux PowerPC stack finding to LINUX_STACKBOTTOM.  (Thanks
+    to Akira Tagoh for pointing out that HEURISTIC1 doesn't work on
+    64-bit kernels.)
+  - Added GC_set_free_space_divisor to avoid some Windows dll issues.
+  - Added FIXUP_POINTER, POINTER_SHIFT, POINTER_MASK to allow preprocessing
+    of candidate pointers for tagging, etc.
+  - Always lock around GC_notify_full_gc().  Simplified code for
+    invoking GC_notify_full_gc().
+  - Changed the way DATASTART is defined on FreeBSD to be robust against
+    an unmapped page after etext.  (Thanks to Hironori Sakamoto for
+    tracking down the intermittent failure.)
+  - Made GC_enable() and GC_disable() official.  Deprecated direct update
+    of GC_dont_gc.  Changed GC_gcollect to be a noop when garbage collection
+    is disabled.
+  - Call GC_register_dynamic_libraries before stopping the world on Linux,
+    in order to avoid a potential deadlock due to the dl_iterate_phdr lock.
+  - Introduced a more general mechanism for platform-dependent code to
+    decide whether the main data segment should be handled separately
+    from dynamic libraries, or registered by GC_register_dynamic_libraries.
+    The latter is more reliable and easier on Linux with dl_iterate_phdr. 
+ 
+ Since 6.2alpha1:
+  - Fixed the completely broken FreeBSD code in 6.2alpha1.  (Thanks to
+    Hironori Sakamoto for the patch.)
+  - Changed IRIX reference in dbg_mlc.c to IRIX5. (Thanks to Marcus Herbert.)
+  - Attempted to work around the problems with .S filenames and the SGI
+    compiler.  (Reported by several people. Untested.)
+  - Worked around an HP/UX make issue with the GNU-style build process.
+  - Fixed the --enable-cplusplus build machinery to allow builds without
+    a C++ compiler.  (That was always the intent ...)
+  - Changed the debugging allocation macros to explicitly pass the return
+    address for Linux and XXXBSD on hardware for which we can't get stack
+    traces.  Use __builtin_return_address(0) to generate it when possible.
+    Some of the configuration work was cleaned up (good) and moved to gc.h
+    (bad, but necessary).  This should make leak detection more useful
+    on a number of platforms.  (Thanks to Fabian Thylman for the suggestion.)
+  - Fixed compilation problems in dbg_mlc.c with GC_ADD_CALLER.
+  - Bumped revision number for dynamic library.
+ 
+ Since 6.2alpha2:
+  - Don't include execinfo.h in os_dep.c when it's not needed, and may not 
exist.
+ 
  To do:
+  - A dynamic libgc.so references dlopen unconditionally, but doesn't link
+    against libdl.
+  - GC_proc_fd for Solaris is not correctly updated in response to a
+    fork() call.  Thus incremental collection in the child won't work
+    correctly.  (Thanks to Ben Cottrell for pointing this out.)
+  - --enable-redirect-malloc is mostly untested and known not to work
+    on some platforms. 
   - There seem to be outstanding issues on Solaris/X86, possibly with
     finding the data segment starting address.  Information/patches would
***************
*** 1582,1587 ****
     it looks like the whole object is treated as dirty if any part of it
     is.
!  - Cord/cordprnt.c doesn't build on a few platforms (notably PowerPC), since
!    we make some unwarranted assumptions about how varargs are handled.  This
!    currently makes the cord-aware versions of printf unusable on some 
platforms.
!    Fixing this is unfortunately not trivial.
--- 1780,1782 ----
     it looks like the whole object is treated as dirty if any part of it
     is.
!  

Index: README.environment
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/libgc/doc/README.environment,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** README.environment  8 Apr 2002 23:36:50 -0000       1.2
--- README.environment  6 Feb 2003 01:35:46 -0000       1.3
***************
*** 6,9 ****
--- 6,11 ----
                                process start-up.
  
+ GC_MAXIMUM_HEAP_SIZE=<bytes> - Maximum collected heap size.
+ 
  GC_LOOP_ON_ABORT - Causes the collector abort routine to enter a tight loop.
                   This may make it easier to debug, such a process, especially
***************
*** 20,23 ****
--- 22,30 ----
                 was built without -DSILENT.
  
+ GC_DUMP_REGULARLY - Generate a GC debugging dump GC_dump() on startup
+                   and during every collection.  Very verbose.  Useful
+                   if you have a bug to report, but please include only the
+                   last complete dump.
+ 
  GC_PRINT_ADDRESS_MAP - Linux only.  Dump /proc/self/maps, i.e. various address
                       maps for the process, to stderr on every GC.  Useful for
***************
*** 38,42 ****
  
  GC_NO_BLACKLIST_WARNING - Prevents the collector from issuing
!               "Needed to allocate blacklisted block at ..." warnings.
  
  GC_IGNORE_GCJ_INFO - Ignore the type descriptors implicitly supplied by
--- 45,58 ----
  
  GC_NO_BLACKLIST_WARNING - Prevents the collector from issuing
!               warnings about allocations of very large blocks.
!               Deprecated.  Use GC_LARGE_ALLOC_WARN_INTERVAL instead.
! 
! GC_LARGE_ALLOC_WARN_INTERVAL=<n> - Print every nth warning about very large
!               block allocations, starting with the nth one.  Small values
!               of n are generally benign, in that a bounded number of
!               such warnings generally indicate at most a bounded leak.
!               For best results it should be set at 1 during testing.
!               Default is 5.  Very large numbers effectively disable the
!               warning.
  
  GC_IGNORE_GCJ_INFO - Ignore the type descriptors implicitly supplied by
***************
*** 61,64 ****
--- 77,94 ----
                     http://lib.hpl.hp.com/techpubs/2001/HPL-2001-251.html .
  
+ GC_RETRY_SIGNALS, GC_NO_RETRY_SIGNALS - Try to compensate for lost
+                    thread suspend signals in linux_threads.c.  On by
+                    default for GC_OSF1_THREADS, off otherwise.  Note 
+                    that this does not work around a possible loss of
+                    thread restart signals.  This seems to be necessary for
+                    some versions of Tru64.  Since we've previously seen
+                    similar issues on some other operating systems, it
+                    was turned into a runtime flag to enable last-minute
+                    work-arounds.
+ 
+ The following turn on runtime flags that are also program settable.  Checked
+ only during initialization.  We expect that they will usually be set through
+ other means, but this may help with debugging and testing:
+ 
  GC_ENABLE_INCREMENTAL - Turn on incremental collection at startup.  Note that,
                     depending on platform and collector configuration, this
***************
*** 81,89 ****
                     only be used with unlimited pause time.
  
! The following turn on runtime flags that are also program settable.  Checked
! only during initialization.  We expect that they will usually be set through
! other means, but this may help with debugging and testing:
! 
! GC_FIND_LEAK - Turns on GC_find_leak and thus leak detection.
  
  GC_ALL_INTERIOR_POINTERS - Turns on GC_all_interior_pointers and thus interior
--- 111,117 ----
                     only be used with unlimited pause time.
  
! GC_FIND_LEAK - Turns on GC_find_leak and thus leak detection.  Forces a
!              collection at program termination to detect leaks that would
!              otherwise occur after the last GC.
  
  GC_ALL_INTERIOR_POINTERS - Turns on GC_all_interior_pointers and thus interior

Index: README.linux
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/libgc/doc/README.linux,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** README.linux        9 Nov 2001 02:22:01 -0000       1.1.1.1
--- README.linux        6 Feb 2003 01:35:46 -0000       1.2
***************
*** 1,20 ****
  See README.alpha for Linux on DEC AXP info.
  
! This file applies mostly to Linux/Intel IA32.  Ports to Linux on an M68K
! and PowerPC are also integrated.  They should behave similarly, except that
! the PowerPC port lacks incremental GC support, and it is unknown to what
! extent the Linux threads code is functional.  See below for M68K specific
! notes.
  
! Incremental GC is supported on Intel IA32 and M68K.
  
  Dynamic libraries are supported on an ELF system.  A static executable
  should be linked with the gcc option "-Wl,-defsym,_DYNAMIC=0".
  
! The collector appears to work with Linux threads.  We have seen
! intermittent hangs in sem_wait.  So far we have been unable to reproduce
! these unless the process was being debugged or traced.  Thus it's
! possible that the only real issue is that the debugger loses
! signals on rare occasions.
  
  The garbage collector uses SIGPWR and SIGXCPU if it is used with
--- 1,17 ----
  See README.alpha for Linux on DEC AXP info.
  
! This file applies mostly to Linux/Intel IA32.  Ports to Linux on an M68K, 
IA64,
! SPARC, MIPS, Alpha and PowerPC are also integrated.  They should behave
! similarly, except that the PowerPC port lacks incremental GC support, and
! it is unknown to what extent the Linux threads code is functional.
! See below for M68K specific notes.
  
! Incremental GC is generally supported.
  
  Dynamic libraries are supported on an ELF system.  A static executable
  should be linked with the gcc option "-Wl,-defsym,_DYNAMIC=0".
  
! The collector appears to work reliably with Linux threads, but beware 
! of older versions of glibc and gdb.
  
  The garbage collector uses SIGPWR and SIGXCPU if it is used with

Index: README.win32
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/libgc/doc/README.win32,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** README.win32        8 Apr 2002 23:36:50 -0000       1.2
--- README.win32        6 Feb 2003 01:35:46 -0000       1.3
***************
*** 22,25 ****
--- 22,32 ----
  the two systems, and under different versions of win32s.)
  
+ Win32 applications compiled with some flavor of gcc currently behave
+ like win32s applications, in that dynamic library data segments are
+ not scanned.  (Gcc does not directly support Microsoft's "structured
+ exception handling".  It turns out that use of this feature is
+ unavoidable if you scan arbirtray memory segments obtained from
+ VirtualQuery.)
+ 
  The collector test program "gctest" is linked as a GUI application,
  but does not open any windows.  Its output appears in the file

Index: debugging.html
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/libgc/doc/debugging.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** debugging.html      8 Apr 2002 23:36:50 -0000       1.2
--- debugging.html      6 Feb 2003 01:35:46 -0000       1.3
***************
*** 249,254 ****
  <LI> Verify that the offending object still has its correct contents at
  this point.
! The call <TT>GC_is_marked(p)</tt> from the debugger to verify that the
! object has not been marked, and is about to be reclaimed.
  <LI> Determine a path from a root, i.e. static variable, stack, or
  register variable,
--- 249,258 ----
  <LI> Verify that the offending object still has its correct contents at
  this point.
! Then call <TT>GC_is_marked(p)</tt> from the debugger to verify that the
! object has not been marked, and is about to be reclaimed.  Note that
! <TT>GC_is_marked(p)</tt> expects the real address of an object (the
! address of the debug header if there is one), and thus it may
! be more appropriate to call <TT>GC_is_marked(GC_base(p))</tt>
! instead.
  <LI> Determine a path from a root, i.e. static variable, stack, or
  register variable,





reply via email to

[Prev in Thread] Current Thread [Next in Thread]