Comment 12 for bug 2067313

Revision history for this message
Douglas Katzman (dougk) wrote :

yes I'm running 14.5

From the sound of it, there is a situation where a store to a protected page gets handled in the sigsegv handler by unprotecting the page and marking it as touched for GC, then resuming at the faulting instruction, which gets another fault right away, forever. It is as if page fault handling does not work until after the main thread is fully initialized in Lisp, which we can confirm via the following diff. Mind you this "should not" make a difference, but I think it will:

diff --git a/src/runtime/immobile-space.c b/src/runtime/immobile-space.c
index 95d6acee7..f231f680f 100644
--- a/src/runtime/immobile-space.c
+++ b/src/runtime/immobile-space.c
@@ -1185,8 +1185,6 @@ void immobile_space_coreparse(uword_t fixedobj_len,
                 sword_t size = object_size2(obj, header);
                 fixedobj_pages[page].attr.parts.obj_align = size;
                 fixedobj_pages[page].gens |= 1 << immobile_obj_gen_bits(obj);
- if (gen != 0 && ENABLE_PAGE_PROTECTION)
- fixedobj_pages[page].attr.parts.flags = WRITE_PROTECT;
                 break;
             }
         }
diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c
index 274687c8f..ea1315bb8 100644
--- a/src/runtime/runtime.c
+++ b/src/runtime/runtime.c
@@ -778,10 +778,6 @@ initialize_lisp(int argc, char *argv[], char *envp[])
     extern void callback_wrapper_trampoline();
     SYMBOL(CALLBACK_WRAPPER_TRAMPOLINE)->value = (lispobj)callback_wrapper_trampoline;
 #endif
- /* Delayed until after dynamic space has been mapped, fixups made,
- * and/or immobile-space linkage entries written,
- * since it was too soon earlier to handle write faults. */
- write_protect_immobile_space();
 #endif

     /* Requires STATIC_SPACE_START to have been calculated. */