[pypy-commit] stmgc default: fix infinite loop in segfault handler

Raemi pypy.commits at gmail.com
Fri Feb 26 05:41:32 EST 2016


Author: Remi Meier <remi.meier at gmail.com>
Branch: 
Changeset: r1983:8c9162341945
Date: 2016-02-26 11:41 +0100
http://bitbucket.org/pypy/stmgc/changeset/8c9162341945/

Log:	fix infinite loop in segfault handler

diff --git a/c8/stm/setup.c b/c8/stm/setup.c
--- a/c8/stm/setup.c
+++ b/c8/stm/setup.c
@@ -287,13 +287,15 @@
     if (addr == NULL)
         return;
     stm_thread_local_t *tl = stm_all_thread_locals;
-    while (tl != NULL) {
+    if (tl == NULL)
+        return;
+    do {
         char *trap = _shadowstack_trap_page(tl->shadowstack_base);
         if (trap <= addr && addr <= trap + 4095) {
             fprintf(stderr, "This is caused by a stack overflow.\n"
-                "Sorry, proper RuntimeError support is not implemented yet.\n");
+                    "Sorry, proper RuntimeError support is not implemented yet.\n");
             return;
         }
         tl = tl->next;
-    }
+    } while (tl != stm_all_thread_locals);
 }


More information about the pypy-commit mailing list