u3: protect guard page if necessary after remapping loom
@@ -943,6 +943,19 @@ _ce_loom_mapf_north(c3_i fid_i, c3_w pgs_w, c3_w old_w)
c3_assert(0);
}
+ // protect guard page if clobbered
+ //
+ // NB: < pgs_w is precluded by assertion in _ce_patch_compose()
+ //
+ if ( (gar_pag_p >> u3a_page) < old_w ) {
+ fprintf(stderr, "loom: guard on remap\r\n");
+ if ( 0 != mprotect(u3a_into(gar_pag_p), pag_siz_i, PROT_NONE) ) {
+ fprintf(stderr, "loom: failed to protect guard page: %s\r\n",
+ strerror(errno));
+ c3_assert(0);
+ }
+ }
+
_ce_loom_track_north(pgs_w, dif_w);
}
else {
