ruby-changes:34418
From: nobu <ko1@a...>
Date: Mon, 23 Jun 2014 11:11:45 +0900 (JST)
Subject: [ruby-changes:34418] nobu:r46499 (trunk): signal.c: drop dangerous tag
nobu 2014-06-23 11:11:31 +0900 (Mon, 23 Jun 2014) New Revision: 46499 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46499 Log: 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] Modified files: trunk/ChangeLog trunk/signal.c Index: ChangeLog =================================================================== --- ChangeLog (revision 46498) +++ ChangeLog (revision 46499) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Jun 23 11:11:16 2014 Nobuyoshi Nakada <nobu@r...> + + * 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@r...> * lib/uri/generic.rb: remove registry. Index: signal.c =================================================================== --- signal.c (revision 46498) +++ signal.c (revision 46499) @@ -738,6 +738,12 @@ check_stack_overflow(const uintptr_t add https://github.com/ruby/ruby/blob/trunk/signal.c#L738 * 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); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/