summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2021-10-20 12:42:40 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2021-10-20 15:06:40 -0700
commitb0c3f18ec519d505527e1929e25ec264c831a89e (patch)
treeddc3cde1a16b5c906e407f3a40dc2f11a3b75574 /gc.c
parent030b1892d5cc6f4c14b08d67d4ee60c202edc183 (diff)
Print errno when mprotect fails
Trying to figure out the problem on s390x.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4996
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index fdd4ac5eb3..4451218f71 100644
--- a/gc.c
+++ b/gc.c
@@ -4870,7 +4870,7 @@ lock_page_body(rb_objspace_t *objspace, struct heap_page_body *body)
#else
if (mprotect(body, HEAP_PAGE_SIZE, PROT_NONE)) {
#endif
- rb_bug("Couldn't protect page %p", (void *)body);
+ rb_bug("Couldn't protect page %p, errno: %s", (void *)body, strerror(errno));
}
else {
gc_report(5, objspace, "Protecting page in move %p\n", (void *)body);
@@ -4887,7 +4887,7 @@ unlock_page_body(rb_objspace_t *objspace, struct heap_page_body *body)
#else
if (mprotect(body, HEAP_PAGE_SIZE, PROT_READ | PROT_WRITE)) {
#endif
- rb_bug("Couldn't unprotect page %p", (void *)body);
+ rb_bug("Couldn't unprotect page %p, errno: %s", (void *)body, strerror(errno));
}
else {
gc_report(5, objspace, "Unprotecting page in move %p\n", (void *)body);