Skip to content

Instantly share code, notes, and snippets.

@brixen
Last active February 10, 2018 21:49
Show Gist options
  • Save brixen/d3aeff1607fa354d00b60d5fc0e0bec8 to your computer and use it in GitHub Desktop.
Save brixen/d3aeff1607fa354d00b60d5fc0e0bec8 to your computer and use it in GitHub Desktop.
(lldb) t 5
* thread #5, name = 'ruby.5', stop reason = breakpoint 1.1
frame #0: 0x000000010003b99f rbx`rubinius::capi::Handle::as_rdata(this=0x00000001155375d0, env=0x0000000100a42bd0) at data.cpp:18
15 Data* data = c_as<Data>(object_);
16
17 if(data->freed_p()) {
-> 18 rb_raise(rb_eArgError, "Data object has already been freed");
19 }
20
21 if(type_ == cRData) {
(lldb) bt 10
* thread #5, name = 'ruby.5', stop reason = breakpoint 1.1
* frame #0: 0x000000010003b99f rbx`rubinius::capi::Handle::as_rdata(this=0x00000001155375d0, env=0x0000000100a42bd0) at data.cpp:18
frame #1: 0x000000010003bb9e rbx`::capi_rdata_struct(data_handle=4652758480) at data.cpp:69
frame #2: 0x000000010359d6db ffi_c.bundle`inline_array_initialize(self=4652758480, rbMemory=4315989632, rbField=4323211728) at Struct.c:531
frame #3: 0x00000001000f74f8 rbx`rubinius::TwoArguments::invoke(state=0x0000000100a42bd0, nm=0x000000010a24da98, env=0x0000000100a42bd0, args=0x0000700007a05b30) at native_method.cpp:270
frame #4: 0x00000001000f3c77 rbx`rubinius::Object* rubinius::NativeMethod::executor_implementation<rubinius::TwoArguments>(state=0x0000000100a42bd0, exec=0x000000010a24da98, mod=0x000000010a24a8a0, args=0x0000700007a05b30) at native_method.cpp:717
frame #5: 0x0000000100073d84 rbx`rubinius::CallSite::Cache::poly_execute(state=0x0000000100a42bd0, call_site=0x0000000103217750, args=0x0000700007a05b30) at call_site.hpp:234
frame #6: 0x000000010019bae7 rbx`rubinius::instructions::send_stack_with_splat(rubinius::State*, rubinius::CallFrame*, long, long) [inlined] rubinius::CallSite::execute(this=<unavailable>, state=0x0000000100a42bd0, args=0x000000000000378e) at call_site.hpp:323 [opt]
frame #7: 0x000000010019badd rbx`rubinius::instructions::send_stack_with_splat(state=0x0000000100a42bd0, call_frame=0x0000700007a05d00, literal=4347492176, count=<unavailable>) at send_stack_with_splat.hpp:28 [opt]
frame #8: 0x000000010019b9ec rbx`rubinius::interpreter::send_stack_with_splat(state=0x0000000100a42bd0, call_frame=0x0000700007a05d00, opcodes=0x0000000103217630) at send_stack_with_splat.cpp:9 [opt]
frame #9: 0x0000000100196ea8 rbx`rubinius::Interpreter::execute(state=0x0000000100a42bd0, machine_code=0x00000001032173b0) at interpreter.cpp:303
(lldb) f 3
frame #3: 0x00000001000f74f8 rbx`rubinius::TwoArguments::invoke(state=0x0000000100a42bd0, nm=0x000000010a24da98, env=0x0000000100a42bd0, args=0x0000700007a05b30) at native_method.cpp:270
267 VALUE a1 = env->get_handle(args.get_argument(0));
268 VALUE a2 = env->get_handle(args.get_argument(1));
269
-> 270 return env->get_object(nm->func()(receiver, a1, a2));
271 }
272 };
273
(lldb) p state->vm_->call_frame_->print_backtrace(state, 0, 0)
0x700007a05580: capi:initialize at Struct.c
0x700007a05d00: Class#new in core/alpha.rb:93 (+15)
0x700007a06260: capi:get at StructLayout.c
0x700007a06a60: capi:[] at Struct.c
0x700007a071c0: __block__ in /source/repros/ruby-io/lib/io/platforms/common/select.rb:43 (+18)
0x700007a076a0: Integer#times in core/integer.rb:194 (+39)
0x700007a07af0: IO::Platforms::FDSetStruct#copy_to in /source/repros/ruby-io/lib/io/platforms/common/select.rb:42 (+88)
0x700007a07f60: IO::Platforms::SelectPoller#poll in /source/repros/ruby-io/lib/io/platforms/common/select_poller.rb:48 (+129)
0x700007a08410: IO::Async::Private::IOLoop#flush_immediate in /source/repros/ruby-io/lib/io/async/private/io_loop.rb:141 (+4)
0x700007a08840: IO::Async::Private::IOLoop#io_loop in /source/repros/ruby-io/lib/io/async/private/io_loop.rb:56 (+74)
0x700007a08cf0: __block__ in /source/repros/ruby-io/lib/io/async/private/io_loop.rb:30 (+0)
0x700007a096b0: Proc#call in core/proc.rb:20 (+247)
(lldb) f 2
frame #2: 0x000000010359d6db ffi_c.bundle`inline_array_initialize(self=4652758480, rbMemory=4315989632, rbField=4323211728) at Struct.c:531
528 {
529 InlineArray* array;
530
-> 531 Data_Get_Struct(self, InlineArray, array);
532 array->rbMemory = rbMemory;
533 array->rbField = rbField;
534
(lldb) p self
(intptr_t) $0 = 4652758480
(lldb) p (rubinius::Handle*)$0
error: no member named 'Handle' in namespace 'rubinius'
error: expected expression
(lldb) p (rubinius::capi::Handle*)$0
(rubinius::capi::Handle *) $1 = 0x00000001155375d0
(lldb) p *$1
(rubinius::capi::Handle) $2 = {
object_ = 0x00000001178ac998
type_ = cRData
references_ = 1
checksum_ = 65535
flush_ = 0x0000000000000000
update_ = 0x0000000000000000
as_ = {
rarray = 0x0000000103728160
rstring = 0x0000000103728160
rdata = 0x0000000103728160
rtypeddata = 0x0000000103728160
rfloat = 0x0000000103728160
rio = 0x0000000103728160
rfile = 0x0000000103728160
next_index_ = 4352803168
cache_data = 4352803168
}
}
(lldb) p $2.object_
(rubinius::Object *) $3 = 0x00000001178ac998
(lldb) p *$3
(rubinius::Object) $4 = {
rubinius::ObjectHeader = {
header = {
f = {
obj_type = DataType
zone = MatureObjectZone
age = 17
meaning = eAuxWordHandle
Forwarded = 0
Remember = 0
Marked = 5
InImmix = 1
InLarge = 0
Pinned = 0
Frozen = 0
Tainted = 0
LockContended = 0
unused = 0
aux_word = 109567
}
flags64 = 470586736657689
}
_klass_ = 0x000000010a24acb0
_ivars_ = 0x000000000000001a
__body__ = {}
}
}
(lldb) p (rubinius::Data*)$2.object_
(rubinius::Data *) $5 = 0x00000001178ac998
(lldb) p *$5
(rubinius::Data) $6 = {
rubinius::Object = {
rubinius::ObjectHeader = {
header = {
f = {
obj_type = DataType
zone = MatureObjectZone
age = 17
meaning = eAuxWordHandle
Forwarded = 0
Remember = 0
Marked = 5
InImmix = 1
InLarge = 0
Pinned = 0
Frozen = 0
Tainted = 0
LockContended = 0
unused = 0
aux_word = 109567
}
flags64 = 470586736657689
}
_klass_ = 0x000000010a24acb0
_ivars_ = 0x000000000000001a
__body__ = {}
}
}
_internal_ = 0x0000000103728160
_freed_ = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment