mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
signal.c: drop dangerous tag
* signal.c (check_stack_overflow): drop the last tag too close to the fault page, to get rid of stack overflow deadlock. [Bug #9971] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2af4240fbb
commit
2bd9a19895
2 changed files with 12 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
Mon Jun 23 11:11:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* signal.c (check_stack_overflow): drop the last tag too close to
|
||||
the fault page, to get rid of stack overflow deadlock.
|
||||
[Bug #9971]
|
||||
|
||||
Sun Jun 22 09:11:15 2014 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* lib/uri/generic.rb: remove registry.
|
||||
|
|
6
signal.c
6
signal.c
|
@ -738,6 +738,12 @@ check_stack_overflow(const uintptr_t addr, const ucontext_t *ctx)
|
|||
* the fault page can be the next. */
|
||||
if (sp_page == fault_page || sp_page == fault_page + 1) {
|
||||
rb_thread_t *th = ruby_current_thread;
|
||||
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. */
|
||||
th->tag = th->tag->prev;
|
||||
}
|
||||
ruby_thread_stack_overflow(th);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue