[ruby-core:86470] [Ruby trunk Bug#14653] Bootsnap gets segmentation fault

From: s.wanabe@...
Date: 2018-04-06 20:05:03 UTC
List: ruby-core #86470
Issue #14653 has been updated by wanabe (_ wanabe).


I guess it is fixed at [Bug #14553] r63040.
(And it also needs [Bug #14660] r63103 to pass all tests, but although it is not directly related to this issue.)

Would you please retry with latest trunk ruby?

An Execution result of my environment is here.

```
$ bundle exec bin/testunit && ruby -v
/work/bootsnap/.bundle/ruby/2.6.0/gems/mocha-1.5.0/lib/mocha/return_values.rb:19: warning: mismatched indentations at 'when' with 'case' at 18
/work/bootsnap/.bundle/ruby/2.6.0/gems/mocha-1.5.0/lib/mocha/return_values.rb:20: warning: mismatched indentations at 'when' with 'case' at 18
/work/bootsnap/.bundle/ruby/2.6.0/gems/mocha-1.5.0/lib/mocha/return_values.rb:21: warning: mismatched indentations at 'else' with 'case' at 18
/work/bootsnap/.bundle/ruby/2.6.0/gems/mocha-1.5.0/lib/mocha/yield_parameters.rb:15: warning: mismatched indentations at 'when' with 'case' at 14
/work/bootsnap/.bundle/ruby/2.6.0/gems/mocha-1.5.0/lib/mocha/yield_parameters.rb:16: warning: mismatched indentations at 'when' with 'case' at 14
/work/bootsnap/.bundle/ruby/2.6.0/gems/mocha-1.5.0/lib/mocha/yield_parameters.rb:17: warning: mismatched indentations at 'else' with 'case' at 14
/work/bootsnap/.bundle/ruby/2.6.0/gems/mocha-1.5.0/lib/mocha/cardinality.rb:23: warning: mismatched indentations at 'when' with 'case' at 22
/work/bootsnap/.bundle/ruby/2.6.0/gems/mocha-1.5.0/lib/mocha/cardinality.rb:24: warning: mismatched indentations at 'else' with 'case' at 22
/work/bootsnap/.bundle/ruby/2.6.0/gems/mocha-1.5.0/lib/mocha/cardinality.rb:82: warning: mismatched indentations at 'when' with 'case' at 81
/work/bootsnap/.bundle/ruby/2.6.0/gems/mocha-1.5.0/lib/mocha/cardinality.rb:83: warning: mismatched indentations at 'when' with 'case' at 81
/work/bootsnap/.bundle/ruby/2.6.0/gems/mocha-1.5.0/lib/mocha/cardinality.rb:84: warning: mismatched indentations at 'when' with 'case' at 81
/work/bootsnap/.bundle/ruby/2.6.0/gems/mocha-1.5.0/lib/mocha/cardinality.rb:85: warning: mismatched indentations at 'else' with 'case' at 81
Run options: --seed 31648

# Running:

.....................................................................................................................

Finished in 0.118636s, 986.2100 runs/s, 1711.1165 assertions/s.

117 runs, 203 assertions, 0 failures, 0 errors, 0 skips
ruby 2.6.0dev (2018-04-07 trunk 63107) [x86_64-linux]
```

----------------------------------------
Bug #14653: Bootsnap gets segmentation fault
https://bugs.ruby-lang.org/issues/14653#change-71408

* Author: yahonda (Yasuo Honda)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.0dev (2018-03-29 trunk 63037) [x86_64-linux]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
# Steps to reproduce

~~~ ruby
$ rbenv install 2.6.0-dev
$ rbenv global 2.6.0-dev
$ gem install bundler
$ git clone https://github.com/Shopify/bootsnap
$ cd bootsnap
$ bundle
$ rake
$ bundle exec bin/testunit
~~~

### Expected result
bundle exec bin/testunit should pass. Ruby 2.5.1 passes all tests.

### Actual result
~~~ ruby
$ ruby -v
ruby 2.6.0dev (2018-03-29 trunk 63037) [x86_64-linux]
$ rake
install -c tmp/x86_64-linux/bootsnap/2.6.0/bootsnap.so lib/bootsnap/bootsnap.so
cp tmp/x86_64-linux/bootsnap/2.6.0/bootsnap.so tmp/x86_64-linux/stage/lib/bootsnap/bootsnap.so
$ bundle exec bin/testunit
/home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/return_values.rb:19: warning: mismatched indentations at 'when' with 'case' at 18
/home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/return_values.rb:20: warning: mismatched indentations at 'when' with 'case' at 18
/home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/return_values.rb:21: warning: mismatched indentations at 'else' with 'case' at 18
/home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/yield_parameters.rb:15: warning: mismatched indentations at 'when' with 'case' at 14
/home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/yield_parameters.rb:16: warning: mismatched indentations at 'when' with 'case' at 14
/home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/yield_parameters.rb:17: warning: mismatched indentations at 'else' with 'case' at 14
/home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/cardinality.rb:23: warning: mismatched indentations at 'when' with 'case' at 22
/home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/cardinality.rb:24: warning: mismatched indentations at 'else' with 'case' at 22
/home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/cardinality.rb:82: warning: mismatched indentations at 'when' with 'case' at 81
/home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/cardinality.rb:83: warning: mismatched indentations at 'when' with 'case' at 81
/home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/cardinality.rb:84: warning: mismatched indentations at 'when' with 'case' at 81
/home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/cardinality.rb:85: warning: mismatched indentations at 'else' with 'case' at 81
Run options: --seed 8304

# Running:

...../home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/object_methods.rb:79: [BUG] Segmentation fault at 0x000055d682994898
ruby 2.6.0dev (2018-03-29 trunk 63037) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0027 p:---- s:0149 e:000148 CFUNC  :caller
c:0026 p:0053 s:0145 e:000142 BLOCK  /home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/object_methods.rb:79
c:0025 p:0032 s:0137 e:000136 METHOD /home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/argument_iterator.rb:15
c:0024 p:0108 s:0132 e:000131 METHOD /home/yahonda/.rbenv/versions/2.6.0-dev/lib/ruby/gems/2.6.0/gems/mocha-1.4.0/lib/mocha/object_methods.rb:74
Segmentation fault (core dumped)
$
~~~

# Related

I have reported these issues at Rails and Bootsnap and disucssed it should be filed to bugs.ruby-lang.org. 
https://github.com/rails/rails/issues/32339
https://github.com/Shopify/bootsnap/issues/148 

Also, I have found this report. It looks like similar with mine but not sure it is duplicate.
https://bugs.ruby-lang.org/issues/14596




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next