Bug #4347: Tracing cannot be re-enabled after callcc [patch]
http://redmine.ruby-lang.org/issues/show/4347

Author: James M. Lawrence
Status: Open, Priority: Normal
Category: core, Target version: 1.9.x
ruby -v: ruby 1.9.3dev (2011-01-30 trunk 30735) [i386-darwin9.8.0]

% patch -p1 < test_continuation_tracing.patch =

patching file test/ruby/test_continuation.rb
% ./ruby -v test/ruby/test_continuation.rb =

ruby 1.9.3dev (2011-01-30 trunk 30735) [i386-darwin9.8.0]
Run options: =


# Running tests:

......FF

Finished tests in 0.080788s, 99.0246 tests/s, 148.5369 assertions/s.

  1) Failure:
test_tracing_with_set_trace_func(TestContinuation) [test/ruby/test_contin=
uation.rb:99]:
<3> expected but was
<1>.

  2) Failure:
test_tracing_with_thread_set_trace_func(TestContinuation) [test/ruby/test=
_continuation.rb:121]:
<3> expected but was
<0>.

In thread.c (thread_suppress_tracing) the code after (*func)(arg, running=
)
is not executed, causing th->tracing to not be cleared.

This two-line patch works, though it may only address a symptom.


----------------------------------------
http://redmine.ruby-lang.org
ZGlmZiAtLWdpdCBhL3Rlc3QvcnVieS90ZXN0X2NvbnRpbnVhdGlvbi5yYiBi
L3Rlc3QvcnVieS90ZXN0X2NvbnRpbnVhdGlvbi5yYgppbmRleCBjNzE5ZGI4
Li42NDM5MGQ4IDEwMDY0NAotLS0gYS90ZXN0L3J1YnkvdGVzdF9jb250aW51
YXRpb24ucmIKKysrIGIvdGVzdC9ydWJ5L3Rlc3RfY29udGludWF0aW9uLnJi
CkBAIC03Nyw1ICs3Nyw0OCBAQCBjbGFzcyBUZXN0Q29udGludWF0aW9uIDwg
VGVzdDo6VW5pdDo6VGVzdENhc2UKICAgICB9LCAnW3J1YnktZGV2OjM0ODAy
XScKICAgZW5kCiAKKyAgZGVmIHRyYWNpbmdfd2l0aF9zZXRfdHJhY2VfZnVu
YworICAgIGNvbnQgPSBuaWwKKyAgICBmdW5jID0gbGFtYmRhIGRvIHwqYXJn
c3wKKyAgICAgIEBtZW1vICs9IDEKKyAg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