Project

General

Profile

Bug #13298

mingw SEGV TestEnumerable#test_callcc

Added by MSP-Greg (Greg L) about 2 years ago. Updated about 2 years ago.

Status:
Assigned
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.5.0dev (2017-03-09 trunk 57821) [x64-mingw32]
[ruby-core:79983]

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 --

  1. Might all of tests that involve callcc or Continuation be moved into another test file? Since it is considered 'obsolete'... I'd be happy to do.

  2. 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

test_enum_559.txt (10.6 KB) test_enum_559.txt MSP-Greg (Greg L), 03/09/2017 08:56 PM

History

Updated by MSP-Greg (Greg L) about 2 years ago

Added SEGV log.

Also, listed method calls sort with two items, and faults. Next call does the same with three items. No error. Hence,

  1. Any ideas?

Updated by shyouhei (Shyouhei Urabe) about 2 years ago

  • Assignee set to nobu (Nobuyoshi Nakada)
  • Status changed from Open to Assigned

Also available in: Atom PDF