Issue #12651 has been reported by Toru Iwase.

----------------------------------------
Bug #12651: SEGV in ripper: ripper/sexp.rb:33: [BUG] Segmentation fault at 0x00000000000014
https://bugs.ruby-lang.org/issues/12651

* Author: Toru Iwase
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.4.0dev (2016-08-02 trunk 55799) [x86_64-linux]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
I encountered SEGV in ripper.
OS: Ubuntu 16.04.01 LTS (xenial)

How to reproduce:

```
$ rbenv version
2.4.0-dev (set by RBENV_VERSION environment variable)
$ ruby -rripper -e 'Ripper.sexp(File.read("ripper_segv.html.erb"))'
/usr/local/anyenv/envs/rbenv/versions/2.4.0-dev/lib/ruby/2.4.0/ripper/sexp.rb:33: [BUG] Segmentation fault at 0x00000000000014
ruby 2.4.0dev (2016-08-02 trunk 55799) [x86_64-linux]
(see attached dump)
```

I know ripper cannot parse ERb files.
In Ruby 2.3, `Ripper.sexp(erb_content)` returns nil but following warnings.

```
$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
$ ruby -rripper -e 'p Ripper.sexp(File.read("ripper_segv.html.erb"))'
-:11: regexp encoding option 'e' differs from source encoding 'UTF-8'
nil
```



---Files--------------------------------
ripper_segv.html.erb (443 Bytes)
ripper_segv.dump.txt (13.7 KB)
ripper_segv.gdb.txt (5.12 KB)


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