[pypy-commit] stmgc c8-new-page-handling: fix

Raemi noreply at buildbot.pypy.org
Wed Sep 24 14:51:43 CEST 2014


Author: Remi Meier <remi.meier at inf.ethz.ch>
Branch: c8-new-page-handling
Changeset: r1422:4e346ae8add2
Date: 2014-09-24 14:51 +0200
http://bitbucket.org/pypy/stmgc/changeset/4e346ae8add2/

Log:	fix

diff --git a/c8/stm/core.c b/c8/stm/core.c
--- a/c8/stm/core.c
+++ b/c8/stm/core.c
@@ -64,8 +64,6 @@
 {
     if (from == to)
         return;
-    abort();  // XXX I think it's broken, ignoring the other segment's
-              // 'modified_old_objects'; but is that reachable anyway?
 
     /* walk FORWARDS the commit log and update the page 'pagenum',
        initially at revision 'from', until we reach the revision 'to'. */
@@ -77,6 +75,8 @@
 
         import_objects(from->segment_num, pagenum, undo, end);
     }
+
+    copy_bk_objs_in_page_from(to->segment_num, pagenum);
 }
 
 static void go_to_the_past(uintptr_t pagenum,
diff --git a/c8/test/test_basic.py b/c8/test/test_basic.py
--- a/c8/test/test_basic.py
+++ b/c8/test/test_basic.py
@@ -224,6 +224,35 @@
         py.test.raises(Conflict, self.commit_transaction) # 'a' is outdated, fail to commit
         assert res == 'a'
 
+    @py.test.mark.parametrize("only_bk", [0, 1])
+    def test_read_write_14(self, only_bk):
+        lp1 = stm_allocate_old(16) # allocated in seg0
+        stm_get_real_address(lp1)[HDR] = 'a' #setchar
+        # S|P|P|P|P
+        #
+        # NO_ACCESS in all segments except seg0 (shared page holder)
+        #
+        #
+        self.switch(2)
+        self.start_transaction() # stm_validate()
+        #
+        self.switch(1) # with private page
+        self.start_transaction()
+        stm_set_char(lp1, 'C')
+        self.commit_transaction()
+        assert last_commit_log_entries() == [lp1] # commit 'C'
+        #
+        if only_bk:
+            self.start_transaction()
+            stm_set_char(lp1, 'y') # '1' is only in bk_copy
+        #
+        #
+        self.switch(2, validate=False)
+        res = stm_get_char(lp1) # should be 'a'
+        py.test.raises(Conflict, self.commit_transaction)
+        assert res == 'a'
+
+
 
     def test_commit_fresh_objects(self):
         self.start_transaction()


More information about the pypy-commit mailing list