Created
December 20, 2015 12:43
-
-
Save rhenium/e3a179b0cac87606c183 to your computer and use it in GitHub Desktop.
Bug #11851: rb_profile_frames() causes segmentation fault - Ruby trunk - Ruby Issue Tracking System https://bugs.ruby-lang.org/issues/11851
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ruby.h" | |
#include "ruby/debug.h" | |
VALUE | |
xxx(VALUE self) | |
{ | |
VALUE buf[10]; | |
int lines[10]; | |
int n; | |
n = rb_profile_frames(0, 10, buf, lines); | |
return INT2FIX(n); | |
} | |
void | |
Init_bug(void) | |
{ | |
rb_define_global_function("xxx", xxx, 0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "./bug.so" | |
class A | |
def x | |
p xxx | |
end | |
end | |
def a | |
[A.new].each(&:x) | |
end | |
a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "mkmf" | |
create_makefile("bug") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git clone https://gist.github.com/e3a179b0cac87606c183.git cd e3a179b0cac87606c183 ruby extconf.rb make ruby bug.rb