simplecov: Segfault on Ruby 2.5.0 and Rails 5.1.4
Howdy! Updating two Rails 5.1.4 apps to Ruby 2.5.0 and getting a simplecov segfault on both of them.
Occurs after the minitest suite finishes. The segfault sometimes references different simplecov files (even when just rerunning the suite, which is fun) I’ve attached two crash reports from the same project. Working on coming up with a sample project to upload as well. Happy to provide any additional information.
Rails 5.1.4 Ruby 2.5.0p0 Minitest 5.11.3 Simplecov 0.15.1
Tried rebundling, reinstalling 2.5.0. Only change made to the project was updating the Ruby version to 2.5.0, bundling, then running the tests; that was enough to cause the segfault.
Finished in 14.991489s, 17.2765 runs/s, 31.7513 assertions/s.
259 runs, 476 assertions, 0 failures, 0 errors, 0 skips
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/filter.rb:52: [BUG] Segmentation fault at 0x0000700006fdb4b0
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0013 p:0023 s:0059 e:000057 METHOD /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/filter.rb:52
c:0012 p:0008 s:0053 e:000052 BLOCK /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:111 [FINISH]
c:0011 p:---- s:0049 e:000048 CFUNC :reject
c:0010 p:0007 s:0045 e:000044 BLOCK /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:111 [FINISH]
c:0009 p:---- s:0041 e:000040 CFUNC :each
c:0008 p:0015 s:0037 e:000036 METHOD /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:110
c:0007 p:0014 s:0031 e:000030 METHOD /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/result.rb:83
c:0006 p:0042 s:0027 e:000026 METHOD /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/result.rb:31 [FINISH]
c:0005 p:---- s:0022 e:000021 CFUNC :new
c:0004 p:0049 s:0017 e:000016 METHOD /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:82
c:0003 p:0011 s:0013 e:000012 BLOCK /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/configuration.rb:180 [FINISH]
c:0002 p:0095 s:0010 e:000009 BLOCK /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/defaults.rb:68 [FINISH]
c:0001 p:0000 s:0003 E:000270 (none) [FINISH]
Finished in 14.715983s, 17.5999 runs/s, 32.3458 assertions/s.
259 runs, 476 assertions, 0 failures, 0 errors, 0 skips
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/source_file.rb:85: [BUG] Segmentation fault at 0x00007000064e54b0
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0014 p:0029 s:0064 e:000061 METHOD /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/source_file.rb:85
c:0013 p:0005 s:0058 e:000057 METHOD /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/filter.rb:52
c:0012 p:0008 s:0053 e:000052 BLOCK /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:111 [FINISH]
c:0011 p:---- s:0049 e:000048 CFUNC :reject
c:0010 p:0007 s:0045 e:000044 BLOCK /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:111 [FINISH]
c:0009 p:---- s:0041 e:000040 CFUNC :each
c:0008 p:0015 s:0037 e:000036 METHOD /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:110
c:0007 p:0014 s:0031 e:000030 METHOD /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/result.rb:83
c:0006 p:0042 s:0027 e:000026 METHOD /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/result.rb:31 [FINISH]
c:0005 p:---- s:0022 e:000021 CFUNC :new
c:0004 p:0049 s:0017 e:000016 METHOD /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:82
c:0003 p:0011 s:0013 e:000012 BLOCK /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/configuration.rb:180 [FINISH]
c:0002 p:0095 s:0010 e:000009 BLOCK /Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/defaults.rb:68 [FINISH]
c:0001 p:0000 s:0003 E:001690 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/defaults.rb:68:in `block in <top (required)>'
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/configuration.rb:180:in `block in at_exit'
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:82:in `result'
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:82:in `new'
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/result.rb:31:in `initialize'
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/result.rb:83:in `filter!'
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:110:in `filtered'
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:110:in `each'
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:111:in `block in filtered'
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:111:in `reject'
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov.rb:111:in `block (2 levels) in filtered'
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/filter.rb:52:in `matches?'
/Users/chris/galley/admin/.bundle/gems/simplecov-0.15.1/lib/simplecov/source_file.rb:85:in `project_filename'
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 33
Hey guys, I recently came across this same issue, running SimpleCov version 0.16.1 and Rails 5.1.5 and RSpec 3.7.
I noticed that every time I wanted to run coverage locally it crashed with the SegFault metioned above… After trying to solve that issue I noticed that if I moved the SimpleCov config block from the
spec_helper.rbto therails_helper.rbit wouldn’t crash, and that’s what I’m using ever since.Hope this is useful.