Project

General

Profile

Bug #11603

Count trace_running for internal event

Added by k0kubun (Takashi Kokubun) almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-10-19 trunk 52192) [x86_64-darwin14]
[ruby-dev:49308]

Description

https://github.com/ruby/ruby/pull/1059

I want to fix a crash: https://gist.github.com/k0kubun/86fd9fbff32423bd4974

I noticed that clean_hooks can be executed inside exec_hooks_body.
The hooks of list->hooks can be xfreed during exec_hooks_body.
That's because th->vm->trace_running is not incremented for exec_hooks_unprotected.

So I fixed rb_threadptr_exec_event_hooks_orig to count exec_hooks_unprotected as th->vm->trace_running too.

ruby_2015-10-19-221406_P607.crash (18 KB) ruby_2015-10-19-221406_P607.crash crash report k0kubun (Takashi Kokubun), 10/19/2015 02:43 PM
patch.diff (549 Bytes) patch.diff git diff k0kubun (Takashi Kokubun), 10/19/2015 02:46 PM

Associated revisions

Revision 2d4bc584
Added by ko1 (Koichi Sasada) almost 3 years ago

  • vm_trace.c (rb_threadptr_exec_event_hooks_orig): maintain trace_running counter on internal events.

This patch is made by Takashi Kokubun takashikkbn@gmail.com.
[Bug #11603] https://github.com/ruby/ruby/pull/1059

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 52476
Added by ko1 (Koichi Sasada) almost 3 years ago

  • vm_trace.c (rb_threadptr_exec_event_hooks_orig): maintain trace_running counter on internal events.

This patch is made by Takashi Kokubun takashikkbn@gmail.com.
[Bug #11603] https://github.com/ruby/ruby/pull/1059

Revision 52476
Added by ko1 (Koichi Sasada) almost 3 years ago

  • vm_trace.c (rb_threadptr_exec_event_hooks_orig): maintain trace_running counter on internal events.

This patch is made by Takashi Kokubun takashikkbn@gmail.com.
[Bug #11603] https://github.com/ruby/ruby/pull/1059

Revision 52476
Added by ko1 (Koichi Sasada) almost 3 years ago

  • vm_trace.c (rb_threadptr_exec_event_hooks_orig): maintain trace_running counter on internal events.

This patch is made by Takashi Kokubun takashikkbn@gmail.com.
[Bug #11603] https://github.com/ruby/ruby/pull/1059

Revision 52476
Added by ko1 (Koichi Sasada) almost 3 years ago

  • vm_trace.c (rb_threadptr_exec_event_hooks_orig): maintain trace_running counter on internal events.

This patch is made by Takashi Kokubun takashikkbn@gmail.com.
[Bug #11603] https://github.com/ruby/ruby/pull/1059

Revision 27635014
Added by nagachika (Tomoyuki Chikanaga) almost 3 years ago

merge revision(s) 52476,52477: [Backport #11603]

* vm_trace.c (rb_threadptr_exec_event_hooks_orig):
  maintain trace_running counter on internal events.
  This patch is made by Takashi Kokubun <takashikkbn@gmail.com>.
  [Bug #11603] https://github.com/ruby/ruby/pull/1059

* vm_trace.c (rb_threadptr_exec_event_hooks_orig):

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@52497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 52497
Added by nagachika (Tomoyuki Chikanaga) almost 3 years ago

merge revision(s) 52476,52477: [Backport #11603]

* vm_trace.c (rb_threadptr_exec_event_hooks_orig): 
  maintain trace_running counter on internal events.
  This patch is made by Takashi Kokubun <takashikkbn@gmail.com>.
  [Bug #11603] https://github.com/ruby/ruby/pull/1059

* vm_trace.c (rb_threadptr_exec_event_hooks_orig):

Revision 3233891d
Added by usa (Usaku NAKAMURA) almost 3 years ago

merge revision(s) 52476,52477: [Backport #11603]

* vm_trace.c (rb_threadptr_exec_event_hooks_orig):
  maintain trace_running counter on internal events.
  This patch is made by Takashi Kokubun <takashikkbn@gmail.com>.
  [Bug #11603] https://github.com/ruby/ruby/pull/1059

* vm_trace.c (rb_threadptr_exec_event_hooks_orig):

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@52641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 52641
Added by usa (Usaku NAKAMURA) almost 3 years ago

merge revision(s) 52476,52477: [Backport #11603]

* vm_trace.c (rb_threadptr_exec_event_hooks_orig): 
  maintain trace_running counter on internal events.
  This patch is made by Takashi Kokubun <takashikkbn@gmail.com>.
  [Bug #11603] https://github.com/ruby/ruby/pull/1059

* vm_trace.c (rb_threadptr_exec_event_hooks_orig):

History

#1 [ruby-dev:49309] Updated by sorah (Sorah Fukumori) almost 3 years ago

  • Assignee set to ko1 (Koichi Sasada)

assigning ko1 at here too, because he has self-assigned at GitHub PR

#2 [ruby-dev:49315] Updated by deivid (David Rodríguez) almost 3 years ago

Commenting here just to confirm that this change fixes the SEGVs that this patch introduces in byebug's test suite.

#3 [ruby-dev:49332] Updated by k0kubun (Takashi Kokubun) almost 3 years ago

Byebug 7.0.0 including https://github.com/deivid-rodriguez/byebug/pull/160 is released to rubygems.org the day before yesterday.
Since byebug gem is installed by Rails' default Gemfile, I guess many users may have chance to cause this SEGV.

Could you review this and point out what is a blocker to merge this patch?

#4 Updated by ko1 (Koichi Sasada) almost 3 years ago

  • Status changed from Open to Closed

Applied in changeset r52476.


  • vm_trace.c (rb_threadptr_exec_event_hooks_orig): maintain trace_running counter on internal events.

This patch is made by Takashi Kokubun takashikkbn@gmail.com.
[Bug #11603] https://github.com/ruby/ruby/pull/1059

#5 [ruby-dev:49333] Updated by deivid (David Rodríguez) almost 3 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: REQUIRED

Great! Thanks a lot, Koichi!

We need backports to 2.1 and 2.2 if possible.

#6 [ruby-dev:49335] Updated by nagachika (Tomoyuki Chikanaga) almost 3 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: DONE

Backported into ruby_2_2 branch at r52497.

#7 [ruby-dev:49366] Updated by usa (Usaku NAKAMURA) almost 3 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: DONE to 2.0.0: UNKNOWN, 2.1: DONE, 2.2: DONE

ruby_2_1 r52641 merged revision(s) 52476,52477.

Also available in: Atom PDF