From: Gabor Melis Date: Mon, 16 Feb 2009 22:29:06 +0000 (+0000) Subject: 1.0.25.53: fix gencgc_handle_wp_violation on multicpu systems X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=4a205a8b2d0c08b7e95bda46ff9ae48925ae1fcc;p=sbcl.git 1.0.25.53: fix gencgc_handle_wp_violation on multicpu systems Acquire free_pages_lock around page_table accesses to be sure that the changes actually propagate to other CPUs and we don't end up losing in the else branch and also to prevent problems caused by the compiler or the processor reordering stuff. --- diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index b9bd862..3353425 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -4824,6 +4824,9 @@ gencgc_handle_wp_violation(void* fault_addr) return 0; } else { + int ret; + ret = thread_mutex_lock(&free_pages_lock); + gc_assert(ret == 0); if (page_table[page_index].write_protected) { /* Unprotect the page. */ os_protect(page_address(page_index), PAGE_BYTES, OS_VM_PROT_ALL); @@ -4841,6 +4844,8 @@ gencgc_handle_wp_violation(void* fault_addr) page_index, boxed_region.first_page, boxed_region.last_page); } + ret = thread_mutex_unlock(&free_pages_lock); + gc_assert(ret == 0); /* Don't worry, we can handle it. */ return 1; } diff --git a/version.lisp-expr b/version.lisp-expr index 67debb2..938005e 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.25.52" +"1.0.25.53"