Project

General

Profile

Actions

Bug #14957

closed

MinGW, gcc 8.2.0, bootstraptest test_thread.rb - failure ?

Added by MSP-Greg (Greg L) over 5 years ago. Updated 7 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0dev (2018-08-01 trunk 64156) [x64-mingw32] ?
[ruby-core:88260]
Tags:

Description

Very recently MSYS/MinGW updated gcc from 7.3.0 to 8.2.0. For the most part, every test suite runs fine except the bootstraptest test, which has a single failure on Appveyor:

#1379 test_thread.rb: 
     Thread.new("foo", &Object.method(:class_eval)).join
  #=> killed by SIGSEGV (signal 11)  [ruby-dev:34128]

I believe the test is here bootstraptest/test_thread.rb:L334, code below:

assert_normal_exit %q{
  Thread.new("foo", &Object.method(:class_eval)).join
}, '[ruby-dev: 34128]'

This is the first time I recall seeing an error in btest, so I haven't really looked at the code. assert_normal_exit saves the string in a file, then runs it. When I use the string with ruby -e, I get:

#<Thread:0x0000000002e7e5a8 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
-e:1:in `class_eval': Can't eval on top of Fiber or Thread (RuntimeError)

Not sure if that implies anything...

Four of the builds using gcc 8.2.0 are on Appveyor, downloading and running locally, the following passes (from bootstraptest):

ruby -v runner.rb --ruby=C:/Greg/Ruby99-x64b/bin/ruby.exe -v --sets=thread

Let's say I'm confused, fails on Appveyor, passes locally, etc. If anyone has any suggestions...

Thanks, Greg

Updated by MSP-Greg (Greg L) over 5 years ago

Done some more investigating. The following code I've run four ways.

Using two versions of ruby 2.6.0dev (2018-08-03 trunk 64164) [x64-mingw32], one built with gcc 7.3.0, and one with gcc 8.2.0. I've run the same code on Appveyor & locally on Windows 10.

Both local runs and the 7.3.0 Appveyor run are identical, with STDERR showing and status.signaled? is false. The Appveyor 8.2.0 run does not show STDERR, and reports status.signaled? is true.

io = IO.popen("ruby -W0 -e 'Thread.new(\"foo\", &Object.method(:class_eval)).join'")
pid = io.pid
th = Thread.new {
  io_read = io.read
  io.close
  $?
}
Process.kill(:KILL, pid) unless th.join
status = th.value
puts "\nstatus.signaled? #{status.signaled?}"
puts status

Run on Appveyor:

----------------------------------------------- Run build with gcc 7.3.0
>ruby bootstrap_thread.rb
#<Thread:0x00000000025f1138 run> terminated with exception (report_on_exception is true):
-e:1:in `class_eval': Can't eval on top of Fiber or Thread (RuntimeError)
-e:1:in `class_eval': Can't eval on top of Fiber or Thread (RuntimeError)

status.signaled? false
pid 2616 exit 1

----------------------------------------------- Run build with gcc 8.2.0
>ruby bootstrap_thread.rb

status.signaled? true
pid 3052 SIGSEGV (signal 11)

Not being a thread guru, I don't know if this would be considered a bug, a breaking change, etc.

@normalperson (Eric Wong) Eric - I'm sure you're busy, but if you have chance to look at this, I'd appreciate it.

Actions #2

Updated by MSP-Greg (Greg L) over 5 years ago

  • Subject changed from MinGW, gcc 8.2.0, bootstraptest - failure ? to MinGW, gcc 8.2.0, bootstraptest test_thread.rb - failure ?
Actions #3

Updated by jeremyevans0 (Jeremy Evans) 7 months ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0