Author: Armin Rigo <[email protected]>
Branch:
Changeset: r103:8fc7970d87ba
Date: 2013-06-12 21:56 +0200
http://bitbucket.org/pypy/stmgc/changeset/8fc7970d87ba/
Log: Next fix
diff --git a/c4/et.c b/c4/et.c
--- a/c4/et.c
+++ b/c4/et.c
@@ -193,6 +193,7 @@
/*assert(P->h_revision & 1);*/
}
+ fprintf(stderr, "readobj: %p\n", P);
gcptrlist_insert(&d->list_of_read_objects, P);
add_in_recent_reads_cache:
@@ -231,6 +232,7 @@
static gcptr _match_public_to_private(gcptr P, gcptr pubobj, gcptr privobj)
{
+ gcptr org_pubobj = pubobj;
while ((pubobj->h_revision & 3) == 0)
{
assert(pubobj != P);
@@ -238,8 +240,11 @@
}
if (pubobj == P)
{
+ assert(!(org_pubobj->h_tid & GCFLAG_STUB));
assert(!(privobj->h_tid & GCFLAG_PUBLIC));
assert(is_private(privobj));
+ if (P != org_pubobj)
+ fprintf(stderr, "| actually %p ", org_pubobj);
fprintf(stderr, "-public_to_private-> %p private\n", privobj);
return privobj;
}
@@ -305,6 +310,7 @@
{
if (v & 2)
{
+ fprintf(stderr, "stub ");
gcptr L = _find_public_to_private(P);
if (L != NULL)
return L;
@@ -337,12 +343,12 @@
if (STUB_THREAD(P) == d->public_descriptor)
{
P = (gcptr)(v - 2);
- fprintf(stderr, "stub -> %p ", P);
+ fprintf(stderr, "-> %p ", P);
}
else
{
P = (gcptr)(v - 2);
- fprintf(stderr, "stub -foreign-> %p ", P);
+ fprintf(stderr, "-foreign-> %p ", P);
if (P->h_tid & GCFLAG_PRIVATE_FROM_PROTECTED)
{
P = (gcptr)P->h_revision; /* the backup copy */
@@ -550,6 +556,16 @@
{
d->start_time = GetGlobalCurTime(d); // copy from the global time
fprintf(stderr, "et.c: ValidateNow: %ld\n", (long)d->start_time);
+
+ /* subtle: we have to normalize stolen objects, because doing so
+ might add a few extra objects in the list_of_read_objects */
+ if (d->public_descriptor->stolen_objects.size != 0)
+ {
+ spinlock_acquire(d->public_descriptor->collection_lock, 'N');
+ stm_normalize_stolen_objects(d);
+ spinlock_release(d->public_descriptor->collection_lock);
+ }
+
if (!ValidateDuringTransaction(d, 0))
AbortTransaction(ABRT_VALIDATE_INFLIGHT);
}
diff --git a/c4/steal.c b/c4/steal.c
--- a/c4/steal.c
+++ b/c4/steal.c
@@ -183,6 +183,14 @@
assert(!(B->h_tid & GCFLAG_BACKUP_COPY)); /* already removed */
g2l_insert(&d->public_to_private, B, L);
+
+ /* to be on the safe side */
+ fxcache_remove(&d->recent_reads_cache, B);
+
+ /* but this is definitely needed: all keys in public_to_private
+ must appear in list_of_read_objects */
+ fprintf(stderr, "n.readobj: %p\n", B);
+ gcptrlist_insert(&d->list_of_read_objects, B);
}
gcptrlist_clear(&d->public_descriptor->stolen_objects);
}
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('261035.184$'):
+ #if text.startswith('261225.987$'):
# import pdb; pdb.set_trace()
def check_not_free(self, ptr):
@@ -107,8 +107,9 @@
self.current_rev.write(r.obj, index, p.obj)
if not self.is_private(r.ptr):
self.current_rev.check_not_outdated(r.obj)
- except (model.Deleted, model.Conflict):
+ except (model.Deleted, model.Conflict), e:
# abort! try to reproduce with C code
+ self.dump('expecting abort: %r' % (e,))
self.expected_abort()
lib.setptr(r.ptr, index, p.ptr) # should abort
raise MissingAbort
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit