Patch: 2nd of N --enable-checking=gc,gcac failures: clear GC free list on PCH read

Laurynas Biveinis laurynas.biveinis@gmail.com
Wed Aug 29 00:05:00 GMT 2007


Hello,

The second --enable-checking=gc,gcac failure is that after a PCH read,
GC tries to allocate memory belonging to the objects on the free list.
The PCH read frees all the objects allocated earlier and the free list
does not make any sense afterwards. So fixed by validating the free
object list right before the PCH read, which clears the list as well.

Two bootstraps on i686-pc-linux-gnu with --enable-checking=gc,gcac and
without it are underway. OK for mainline assuming clean bootstraps and
no testsuite regressions?

:ADDPATCH pch:

2007-08-28  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

    * ggc-page.c (ggc_pch_read): Call validate_free_objects().

-- 
Laurynas

Index: ggc-page.c
===================================================================
--- ggc-page.c  (revision 127867)
+++ ggc-page.c  (working copy)
@@ -2243,6 +2243,7 @@
 #ifdef ENABLE_GC_CHECKING
   poison_pages ();
 #endif
+  validate_free_objects();

   /* No object read from a PCH file should ever be freed.  So, set the
      context depth to 1, and set the depth of all the currently-allocated



More information about the Gcc-patches mailing list