Skip to content

Instantly share code, notes, and snippets.

@shyouhei
Created May 9, 2017 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shyouhei/43da0ac64b3b8f697109676b59d95d18 to your computer and use it in GitHub Desktop.
Save shyouhei/43da0ac64b3b8f697109676b59d95d18 to your computer and use it in GitHub Desktop.
% lldb -- ./miniruby -I/Users/urabe.shyouhei/data/src/ci.ruby-lang.org/ruby/branches/ruby_2_3/lib /Users/urabe.shyouhei/data/src/ci.ruby-lang.org/ruby/branches/ruby_2_3/enc/make_encmake.rb enc.mk
(lldb) target create "./miniruby"
Current executable set to './miniruby' (x86_64).
(lldb) settings set -- target.run-args "-I/Users/urabe.shyouhei/data/src/ci.ruby-lang.org/ruby/branches/ruby_2_3/lib" "/Users/urabe.shyouhei/data/src/ci.ruby-lang.org/ruby/branches/ruby_2_3/enc/make_encmake.rb" "enc.mk"
(lldb) env DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib
(lldb) env MALLOC_PROTECT_BEFORE=1
(lldb) env MALLOC_CHECK_HARDER=1
(lldb) run
Process 43554 launched: './miniruby' (x86_64)
GuardMalloc[miniruby-43554]: Allocations will be placed on 16 byte boundaries.
GuardMalloc[miniruby-43554]: - Some buffer overruns may not be noticed.
GuardMalloc[miniruby-43554]: - Applications using vector instructions (e.g., SSE) should work.
GuardMalloc[miniruby-43554]: version 108
Process 43554 stopped
* thread #1: tid = 0x6c944, 0x000000010008187e miniruby`rb_gc_writebarrier_unprotect [inlined] RVALUE_WB_UNPROTECTED(obj=<unavailable>) + 62 at gc.c:1075, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x48)
frame #0: 0x000000010008187e miniruby`rb_gc_writebarrier_unprotect [inlined] RVALUE_WB_UNPROTECTED(obj=<unavailable>) + 62 at gc.c:1075
1072 RVALUE_WB_UNPROTECTED(VALUE obj)
1073 {
1074 check_rvalue_consistency(obj);
-> 1075 return RVALUE_WB_UNPROTECTED_BITMAP(obj) != 0;
1076 }
1077
1078 static inline int
(lldb) bt
* thread #1: tid = 0x6c944, 0x000000010008187e miniruby`rb_gc_writebarrier_unprotect [inlined] RVALUE_WB_UNPROTECTED(obj=<unavailable>) + 62 at gc.c:1075, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x48)
* frame #0: 0x000000010008187e miniruby`rb_gc_writebarrier_unprotect [inlined] RVALUE_WB_UNPROTECTED(obj=<unavailable>) + 62 at gc.c:1075
frame #1: 0x0000000100081840 miniruby`rb_gc_writebarrier_unprotect(obj=4310517360)
frame #2: 0x000000010002969b miniruby`rb_include_class_new [inlined] rb_obj_wb_unprotect(filename=<unavailable>, line=<unavailable>, x=<unavailable>) + 187 at ruby.h:1501
frame #3: 0x0000000100029693 miniruby`rb_include_class_new(module=4310517360, super=4310518320) + 179
frame #4: 0x0000000100029a9c miniruby`include_modules_at(klass=4310518200, c=<unavailable>, module=4310517360, search_super=1) + 348 at class.c:909
frame #5: 0x0000000100029d98 miniruby`rb_include_module(klass=4310518200, module=4310517360) + 152 at class.c:867
frame #6: 0x00000001000d3764 miniruby`InitVM_Object + 292 at object.c:3413
frame #7: 0x000000010009507d miniruby`rb_call_inits + 29 at inits.c:23
frame #8: 0x0000000100062f8e miniruby`ruby_setup + 190 at eval.c:60
frame #9: 0x0000000100062fb9 miniruby`ruby_init + 9 at eval.c:76
frame #10: 0x000000010020fe79 miniruby`main(argc=<unavailable>, argv=<unavailable>) + 57 at main.c:35
frame #11: 0x00007fff972a35ad libdyld.dylib`start + 1
(lldb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment