Bug #13412 » bug13412.r58367.patch
signal.c | ||
---|---|---|
rb_bug_errno(STRINGIZE(ruby_sigunmask)":unblock", errno);
|
||
}
|
||
#endif
|
||
{
|
||
char buf[4096];
|
||
snprintf(buf, 4095, "gdb -batch -p %d -ex 'bt 10' -ex q 1>&2", getpid());
|
||
system(buf);
|
||
}
|
||
ruby_thread_stack_overflow(th);
|
||
}
|
||
... | ... | |
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 <= fault_page + 1) {
|
||
/* 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;
|
||
}
|
||
raise_stack_overflow(sig, th);
|