Actions
Bug #13298
closedmingw SEGV TestEnumerable#test_callcc
Description
First week in January, when I first started building, I had a SEGV in test-all occurring in TestEnumerable#test_callcc. I patched around it, but decided it was time to see if I could find a solution.
The issue occurs in test/ruby/test_enum.rb:559-570. Below is the code:
assert_raise(RuntimeError) do
c = nil
o = Object.new
class << o; self; end.class_eval do
define_method(:<=>) do |x|
callcc {|c2| c ||= c2 }
0
end
end
[o, o].sort_by {|x| x }
c.call
end
While trying to determine the problem in a separate test environment, I stumbled across an odd solution.
Add the line c.to_s
immediately before the c.call
line. My system no longer stops.
I'd be happy to do a PR, but I can only test on Windows.
Two questions --
-
Might all of tests that involve
callcc
orContinuation
be moved into another test file? Since it is considered 'obsolete'... I'd be happy to do. -
Rather odd that this fixes the issue. Any ideas?
--- test/ruby/test_enum.rb.orig Thu Mar 09 07:54:37 2017
+++ test/ruby/test_enum.rb Thu Mar 09 11:39:07 2017
@@ -568,2 +568,3 @@
[o, o].sort_by {|x| x }
+ c.to_s
c.call
Files
Actions
Like0
Like0Like0Like0Like0Like0Like0