Project

General

Profile

Bug #13412 » bug13412.r58331.patch

wanabe (_ wanabe), 04/16/2017 03:05 AM

View differences:

signal.c
if (sp_page == fault_page || sp_page == fault_page + 1 ||
sp_page <= fault_page && fault_page <= bp_page) {
rb_thread_t *th = ruby_current_thread;
fprintf(stderr, "stack_overflow detected\n");
if ((uintptr_t)th->tag->buf / pagesize == sp_page) {
/* drop the last tag if it is close to the fault,
* otherwise it can cause stack overflow again at the same
* place. */
fprintf(stderr, "use prev tag\n");
th->tag = th->tag->prev;
}
clear_received_signal();
(4-4/13)