ruby-changes:26320
From: naruse <ko1@a...>
Date: Fri, 14 Dec 2012 10:40:06 +0900 (JST)
Subject: [ruby-changes:26320] naruse:r38371 (trunk): * vm_trace.c (exec_hooks): add volatile to avoid segv.
naruse 2012-12-14 10:38:14 +0900 (Fri, 14 Dec 2012) New Revision: 38371 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38371 Log: * vm_trace.c (exec_hooks): add volatile to avoid segv. On test-all with -j, it may crash in TH_POP_TAG. Detailed mechanism is not known but this fixes it. Modified files: trunk/ChangeLog trunk/vm_trace.c Index: ChangeLog =================================================================== --- ChangeLog (revision 38370) +++ ChangeLog (revision 38371) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Dec 14 10:36:10 2012 NARUSE, Yui <naruse@r...> + + * vm_trace.c (exec_hooks): add volatile to avoid segv. + On test-all with -j, it may crash in TH_POP_TAG. + Detailed mechanism is not known but this fixes it. + Fri Dec 14 04:08:05 2012 NARUSE, Yui <naruse@r...> * test/ruby/envutil.rb (EnvUtil::Unit::Assertionsassert_separately): Index: vm_trace.c =================================================================== --- vm_trace.c (revision 38370) +++ vm_trace.c (revision 38371) @@ -244,7 +244,7 @@ clean_hooks(rb_hook_list_t *list) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L244 static int exec_hooks(rb_thread_t *th, rb_hook_list_t *list, const rb_trace_arg_t *trace_arg, int can_clean_hooks) { - int state; + volatile int state; volatile int raised; if (UNLIKELY(list->need_clean > 0) && can_clean_hooks) { @@ -275,6 +275,9 @@ exec_hooks(rb_thread_t *th, rb_hook_list https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L275 if (raised) { rb_threadptr_set_raised(th); } + { + rb_thread_t volatile *tmp = th; + } return state; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/