[pypy-commit] stmgc default: Next test failure

arigo noreply at buildbot.pypy.org
Sun Jun 16 11:51:14 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r142:3f512083c4c1
Date: 2013-06-16 11:48 +0200
http://bitbucket.org/pypy/stmgc/changeset/3f512083c4c1/

Log:	Next test failure

diff --git a/c4/test/model.py b/c4/test/model.py
--- a/c4/test/model.py
+++ b/c4/test/model.py
@@ -179,3 +179,10 @@
     def __init__(self, current_revision, numrefs):
         self.created_in_revision = current_revision
         current_revision.content[self] = [None] * numrefs
+
+    def __repr__(self):
+        if hasattr(self, 'identity') and hasattr(self, 'ffi'):
+            return '<StmObject 0x%x>' % (
+                int(self.ffi.cast('intptr_t', self.identity)),)
+        else:
+            return '<StmObject at 0x%x>' % (id(self),)
diff --git a/c4/test/test_nursery.py b/c4/test/test_nursery.py
--- a/c4/test/test_nursery.py
+++ b/c4/test/test_nursery.py
@@ -276,3 +276,23 @@
     p2b = lib.stm_pop_root()
     p2c = lib.stm_pop_root()
     assert p2a == p2b == p2c
+
+def test_backup_ptr_update():
+    p1 = nalloc_refs(1)
+    p2 = nalloc(HDR + WORD)
+    lib.setlong(p2, 0, 389719)
+    lib.setptr(p1, 0, p2)
+    lib.stm_push_root(p1)
+    assert lib.in_nursery(p1)
+
+    @perform_transaction
+    def run(retry_counter):
+        if retry_counter == 0:
+            lib.stm_write_barrier(p1)
+            minor_collect()
+            abort_and_retry()
+
+    p1 = lib.stm_pop_root()
+    assert not lib.in_nursery(p1)
+    p2 = lib.getptr(p1, 0)
+    assert lib.getlong(p2, 0) == 389719
diff --git a/c4/test/test_random.py b/c4/test/test_random.py
--- a/c4/test/test_random.py
+++ b/c4/test/test_random.py
@@ -57,7 +57,7 @@
         text = '%d.%d$ %s\n' % (self.seed, self.counter, text)
         sys.stderr.write(text)
         self.counter += 1
-        #if text.startswith('261225.987$'):
+        #if text.startswith('3970.539$'):
         #    import pdb; pdb.set_trace()
 
     def check_not_free(self, ptr):
@@ -78,6 +78,7 @@
         assert self.current_rev is not None
         obj = model.StmObject(self.current_rev, 2)
         obj.identity = pid
+        obj.ffi = ffi
         self.sync.id2stmobj[pid] = obj
         return pair(obj, nptr)
 
@@ -216,6 +217,7 @@
             p = lst.pop()
             if p == emptypair:
                 continue
+            self.dump(repr(p))
             self.check(p)
 
             ptr = self.nonrecord_barrier(p.ptr)
@@ -241,10 +243,12 @@
                 qobj = content[i]
                 qptr = lib.rawgetptr(ptr, i)
                 q = pair(qobj, qptr)
+                self.dump('[%d] = %r' % (i, q))
                 self.check(q)
                 if q not in seen:
                     lst.append(q)
                     seen.add(q)
+        self.dump('ok')
 
     def transaction_break(self):
         if self.interruptible_transaction:
@@ -412,7 +416,7 @@
 
 def test_more_single_thread():
     #py.test.skip("more random tests")
-    for i in range(100):
+    for i in range(70, 100):
         yield test_single_thread, i + 3900
 
 


More information about the pypy-commit mailing list