Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault on Struct #3177

Closed
ksss opened this issue Jul 22, 2016 · 0 comments
Closed

Segmentation fault on Struct #3177

ksss opened this issue Jul 22, 2016 · 0 comments

Comments

@ksss
Copy link
Contributor

ksss commented Jul 22, 2016

This code failed.

Struct.new(:foo) {
  def initialize(*)
    self.foo
  end
}.new
$ lldb mruby t.rb
(lldb) target create "mruby"
Current executable set to 'mruby' (x86_64).
(lldb) settings set -- target.run-args  "t.rb"
(lldb) r
Process 52549 launched: '/Users/yuki/bin/mruby' (x86_64)
Process 52549 stopped
* thread #1: tid = 0xcfdafb, 0x0000000100050527 mruby`mrb_struct_ref0(mrb=0x00000001002029f0, obj=mrb_value @ 0x00007fff5fbfd700) + 23 at struct.c:128, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000100050527 mruby`mrb_struct_ref0(mrb=0x00000001002029f0, obj=mrb_value @ 0x00007fff5fbfd700) + 23 at struct.c:128
   125    return mrb_struct_getmember(mrb, obj, mrb->c->ci->mid);
   126  }
   127
-> 128  static mrb_value mrb_struct_ref0(mrb_state* mrb, mrb_value obj) {return RSTRUCT_PTR(obj)[0];}
   129  static mrb_value mrb_struct_ref1(mrb_state* mrb, mrb_value obj) {return RSTRUCT_PTR(obj)[1];}
   130  static mrb_value mrb_struct_ref2(mrb_state* mrb, mrb_value obj) {return RSTRUCT_PTR(obj)[2];}
   131  static mrb_value mrb_struct_ref3(mrb_state* mrb, mrb_value obj) {return RSTRUCT_PTR(obj)[3];}
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant