[pypy-commit] stmgc default: A test for this "abort();//XXX".

arigo noreply at buildbot.pypy.org
Sun May 26 19:38:48 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r26:16ed97ae9fa2
Date: 2013-05-26 19:38 +0200
http://bitbucket.org/pypy/stmgc/changeset/16ed97ae9fa2/

Log:	A test for this "abort();//XXX".

diff --git a/c3/nursery.c b/c3/nursery.c
--- a/c3/nursery.c
+++ b/c3/nursery.c
@@ -627,8 +627,8 @@
             /* first case: untrack it.  Note that this case can occur
                without aborting the transaction.  See gcpage's
                cleanup_for_thread() for an explanation how. */
-            abort();//XXX
             items[i] = items[--d->list_of_read_objects.size];
+            /*mark*/
         }
         else {
             /* second case */
diff --git a/c3/test/test_nursery.py b/c3/test/test_nursery.py
--- a/c3/test/test_nursery.py
+++ b/c3/test/test_nursery.py
@@ -370,3 +370,17 @@
         # don't read getptr(p2, 0) here, so that it remains as a stub
         r.set(3)
     run_parallel(f1, f2)
+
+def test_remove_from_list_of_read_objects():
+    p1 = nalloc(HDR)
+    #
+    lib.stm_push_root(p1)
+    lib.stm_commit_transaction()
+    lib.stm_begin_inevitable_transaction()
+    p1 = lib.stm_pop_root()
+    #
+    assert lib.in_nursery(p1)
+    p2 = lib.stm_read_barrier(p1)
+    assert p2 == p1
+    # but now, p1 is no longer a root
+    minor_collect()


More information about the pypy-commit mailing list