Author: Remi Meier <remi.me...@inf.ethz.ch>
Branch: 
Changeset: r1732:df5b285c6f57
Date: 2015-03-12 17:44 +0100
http://bitbucket.org/pypy/stmgc/changeset/df5b285c6f57/

Log:    we actually hit these asserts, because there is stuff running in the
        safe-point

diff --git a/c8/stm/core.c b/c8/stm/core.c
--- a/c8/stm/core.c
+++ b/c8/stm/core.c
@@ -1107,16 +1107,6 @@
     STM_PSEGMENT->shadowstack_at_start_of_transaction = tl->shadowstack;
     STM_PSEGMENT->threadlocal_at_start_of_transaction = tl->thread_local_obj;
 
-    enter_safe_point_if_requested();
-    dprintf(("> start_transaction\n"));
-
-    s_mutex_unlock();   // XXX it's probably possible to not acquire this here
-
-    uint8_t old_rv = STM_SEGMENT->transaction_read_version;
-    STM_SEGMENT->transaction_read_version = old_rv + 1;
-    if (UNLIKELY(old_rv == 0xff)) {
-        reset_transaction_read_version();
-    }
 
     assert(list_is_empty(STM_PSEGMENT->modified_old_objects));
     assert(list_is_empty(STM_PSEGMENT->large_overflow_objects));
@@ -1135,6 +1125,19 @@
 
     check_nursery_at_transaction_start();
 
+    /* Warning: this safe-point may run light finalizers and register
+       commit/abort callbacks if a major GC is triggered here */
+    enter_safe_point_if_requested();
+    dprintf(("> start_transaction\n"));
+
+    s_mutex_unlock();   // XXX it's probably possible to not acquire this here
+
+    uint8_t old_rv = STM_SEGMENT->transaction_read_version;
+    STM_SEGMENT->transaction_read_version = old_rv + 1;
+    if (UNLIKELY(old_rv == 0xff)) {
+        reset_transaction_read_version();
+    }
+
     stm_validate();
 }
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to