jjames pushed to polyml (master). "Update -5.5.2-fixes.patch. (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Sun May 3 00:39:01 UTC 2015


>From 48e0a662964b44ede6824557116940e90cc5c76f Mon Sep 17 00:00:00 2001
From: Jerry James <loganjerry at gmail.com>
Date: Sat, 2 May 2015 18:37:50 -0600
Subject: Update -5.5.2-fixes.patch.

This update adds the following:
- Initialise the largeObjectCache fully in the constructor.  When
  MTGCProcessMarkPointers is subclassed in RescanMarked the resulting
  object is created on the stack and the largeObjectCache can contain
  invalid data if it is not cleared (trunc commit 2007).

diff --git a/polyml-5.5.2-fixes.patch b/polyml-5.5.2-fixes.patch
index ffd952a..2831e5e 100644
--- a/polyml-5.5.2-fixes.patch
+++ b/polyml-5.5.2-fixes.patch
@@ -1,4 +1,10 @@
 This patch currently contains the following subversion commits:
+- r2009
+Initialise the largeObjectCache fully in the constructor.  When MTGCProcessMarkPointers is
+subclassed in RescanMarked the resulting object is created on the stack
+and the largeObjectCache can contain invalid data if it is not cleared.
+
+Backport fix 2007 from trunk.
 - r2007
 Backport commit 2006.
 Ensure the large object cache pointer is cleared when processing the roots as well as for the marking tasks.
@@ -12,7 +18,7 @@ Fix missing close quote in EXTRALDFLAGS.
 Index: polyml/basis/Array.sml
 ===================================================================
 --- polyml/basis/Array.sml	(revision 1924)
-+++ polyml/basis/Array.sml	(revision 1954)
++++ polyml/basis/Array.sml	(revision 2009)
 @@ -129,7 +129,7 @@
       
      fun array(len, a) =
@@ -22,10 +28,54 @@ Index: polyml/basis/Array.sml
              val vec = System_alloc(len+1, 0wx40, RunCall.unsafeCast a)
          in
              System_setw(vec, 0, RunCall.unsafeCast len);
+Index: polyml/libpolyml/gc_mark_phase.cpp
+===================================================================
+--- polyml/libpolyml/gc_mark_phase.cpp	(revision 1924)
++++ polyml/libpolyml/gc_mark_phase.cpp	(revision 2009)
+@@ -130,13 +130,6 @@
+                     if (locPtr == LARGECACHE_SIZE) locPtr = 0;
+                     largeObjectCache[locPtr].base = obj;
+                     largeObjectCache[locPtr].current = currentPtr;
+-                    // To try to narrow down a bug that results in the ASSERT failing,
+-                    // add these extra checks.
+-                    POLYUNSIGNED lengthWord = obj->LengthWord();
+-                    ASSERT (OBJ_IS_LENGTH(lengthWord));
+-                    POLYUNSIGNED length = OBJ_OBJECT_LENGTH(lengthWord);
+-                    ASSERT(length == originalLength);
+-                    ASSERT(currentPtr > (PolyWord*)obj && currentPtr < ((PolyWord*)obj)+length);
+                 }
+             }
+             else StackOverflow(obj);
+@@ -183,6 +176,16 @@
+     // Clear the mark stack
+     for (unsigned i = 0; i < MARK_STACK_SIZE; i++)
+         markStack[i] = 0;
++    // Clear the large object cache.  Actually only largeObjectCache[0].base
++    // needs to be set to zero and for the objects allocated on the heap it is
++    // cleared before each GC in either MarkRoots or MarkPointersTask.
++    // The remianing case is the RescanMarked sub-class which is allocated on the stack
++    // but it doesn't hurt to clear it in all cases.
++    for (unsigned j = 0; j < LARGECACHE_SIZE; j++)
++    {
++        largeObjectCache[locPtr].base = 0;
++        largeObjectCache[locPtr].current = 0;
++    }
+ }
+ 
+ // Called when the stack has overflowed.  We need to include this
+@@ -579,6 +582,8 @@
+     ASSERT(nInUse == 0);
+     MTGCProcessMarkPointers *marker = &markStacks[0];
+     marker->active = true;
++    marker->locPtr = 0;
++    marker->largeObjectCache[0].base = 0;
+     nInUse = 1;
+ 
+     // Scan the permanent mutable areas.
 Index: polyml/libpolyml/foreign.cpp
 ===================================================================
 --- polyml/libpolyml/foreign.cpp	(revision 1924)
-+++ polyml/libpolyml/foreign.cpp	(revision 1954)
++++ polyml/libpolyml/foreign.cpp	(revision 2009)
 @@ -4,7 +4,7 @@
  
      Copyright (c) 2000-7
@@ -134,37 +184,10 @@ Index: polyml/libpolyml/foreign.cpp
      if (ffi_prep_cif(cif, abi, num_args, result_type, arg_types) != FFI_OK)
          RAISE_EXN("libffi error: ffi_prep_cif failed");
  
-Index: polyml/libpolyml/gc_mark_phase.cpp
-===================================================================
---- polyml/libpolyml/gc_mark_phase.cpp	(revision 2006)
-+++ polyml/libpolyml/gc_mark_phase.cpp	(revision 2007)
-@@ -130,13 +130,6 @@
-                     if (locPtr == LARGECACHE_SIZE) locPtr = 0;
-                     largeObjectCache[locPtr].base = obj;
-                     largeObjectCache[locPtr].current = currentPtr;
--                    // To try to narrow down a bug that results in the ASSERT failing,
--                    // add these extra checks.
--                    POLYUNSIGNED lengthWord = obj->LengthWord();
--                    ASSERT (OBJ_IS_LENGTH(lengthWord));
--                    POLYUNSIGNED length = OBJ_OBJECT_LENGTH(lengthWord);
--                    ASSERT(length == originalLength);
--                    ASSERT(currentPtr > (PolyWord*)obj && currentPtr < ((PolyWord*)obj)+length);
-                 }
-             }
-             else StackOverflow(obj);
-@@ -579,6 +572,8 @@
-     ASSERT(nInUse == 0);
-     MTGCProcessMarkPointers *marker = &markStacks[0];
-     marker->active = true;
-+    marker->locPtr = 0;
-+    marker->largeObjectCache[0].base = 0;
-     nInUse = 1;
- 
-     // Scan the permanent mutable areas.
 Index: polyml/polyc.in
 ===================================================================
 --- polyml/polyc.in	(revision 1924)
-+++ polyml/polyc.in	(revision 1954)
++++ polyml/polyc.in	(revision 2009)
 @@ -19,7 +19,7 @@
  @NATIVE_WINDOWS_FALSE at SUFFIX="o"
  
diff --git a/polyml.spec b/polyml.spec
index c873efa..cb799f4 100644
--- a/polyml.spec
+++ b/polyml.spec
@@ -3,7 +3,7 @@
 
 Name:           polyml
 Version:        5.5.2
-Release:        6%{?dist}
+Release:        7%{?dist}
 Summary:        Poly/ML compiler and runtime system
 
 License:        LGPLv2+
@@ -102,6 +102,13 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
 %{_libdir}/libpolyml.so.*
 
 %changelog
+* Sat May  2 2015 Jerry James <loganjerry at gmail.com> - 5.5.2-7
+- Update -5.5.2-fixes.patch to add the following:
+  o Initialise the largeObjectCache fully in the constructor.  When
+    MTGCProcessMarkPointers is subclassed in RescanMarked the resulting object
+    is created on the stack and the largeObjectCache can contain invalid data
+    if it is not cleared (trunc commit 2007)
+
 * Mon Apr 20 2015 Jerry James <loganjerry at gmail.com> - 5.5.2-6
 - Update -5.5.2-fixes.patch to add the following:
   o Ensure the large object cache pointer is cleared when processing the roots
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/polyml.git/commit/?h=master&id=48e0a662964b44ede6824557116940e90cc5c76f


More information about the scm-commits mailing list