https://github.com/kyrylo/rb_compile_string_bug
Demonstration of rb_compile_string from parse.y which segfaults
https://github.com/kyrylo/rb_compile_string_bug
Last synced: about 1 month ago
JSON representation
Demonstration of rb_compile_string from parse.y which segfaults
- Host: GitHub
- URL: https://github.com/kyrylo/rb_compile_string_bug
- Owner: kyrylo
- Created: 2015-06-06T23:58:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-07T05:22:43.000Z (over 10 years ago)
- Last Synced: 2025-01-11T15:09:38.999Z (12 months ago)
- Language: C
- Homepage: https://bugs.ruby-lang.org/issues/11232
- Size: 121 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a repo to demonstrate a bug filed here:
[https://bugs.ruby-lang.org/issues/11232](https://bugs.ruby-lang.org/issues/11232)
What to do.
```
bundle
rake compile
ruby bug.rb
```
If Ruby is compiled with default flags `bug.rb` segfaults.
```
ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
```
Segfaults with: [segfault](/segfault222.txt)
GDB output: [gdb](/gdb222.txt)
If Ruby is compiled with `-O0 -g`, then `bug.rb` doesn't segfault.
When the GC is disabled, it works as supposed to. To test:
```
ruby nobug.rb
```