diff --git a/cont.c b/cont.c index d16c9a5838..61726f12c2 100644 --- a/cont.c +++ b/cont.c @@ -568,9 +568,10 @@ fiber_machine_stack_alloc(size_t size) void *page; STACK_GROW_DIR_DETECTION; + errno = 0; ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, FIBER_STACK_FLAGS, -1, 0); if (ptr == MAP_FAILED) { - rb_raise(rb_eFiberError, "can't alloc machine stack to fiber"); + rb_raise(rb_eFiberError, "can't alloc machine stack to fiber errno: %d", errno); } /* guard page setup */