(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /Users/brian/devel/stackfull/vm/vm mspec/bin/mspec-run -e A\ constant\ on\ a\ metaclass\ raises\ a\ NameError\ for\ anonymous_module::CONST spec/frozen/language/metaclass_spec.rb
Breakpoint 3, rubinius::VMMethod::interpreter (state=0x3001a0, vmm=0x16d57e0, call_frame=0xbffeb0e0) at vm/gen/instructions.cpp:2410
2410 if(!found) {
(gdb) p found
$26 = false
(gdb) rp sym
:CONST
$27 = void
(gdb) n
2411 Message msg;
(gdb)
2412 msg.recv = under;
(gdb)
2413 msg.name = state->symbol("const_missing");
(gdb)
2414 msg.block = Qnil;
(gdb)
2415 msg.lookup_from = msg.recv->lookup_begin(state);
(gdb)
2416 Array* args = Array::create(state, 1);
(gdb)
2417 args->set(state, 0, sym);
(gdb)
2418 msg.set_arguments(state, args);
(gdb)
2420 res = msg.send(state, call_frame);
(gdb) rp args
#<Array:0x1191bec>: 1
:CONST
>
$28 = void
(gdb) p msg
$29 = {
state = 0xbffeac18,
arguments_array = 0x1191bec,
total_args = 1,
stack_args_ = 0x1191b74,
arguments_ = 0x1191c1c,
send_site = 0xce3ce,
name = 0x3d6,
recv = 0x1191038,
block = 0x1a,
priv = 65,
lookup_from = 0x1191060,
method = 0x3001a0,
module = 0x118be00,
method_missing = 117,
caller_ = 0x1191a44
}
(gdb) p call_frame
$30 = (class rubinius::CallFrame * const) 0xbffeb0e0
(gdb) p *call_frame
$31 = {
previous = 0xbffeb8e0,
saved_proxy = 0x1457960,
is_block = true,
name = 0xb0e,
cm = 0x115d760,
args = 0,
ip = 5,
stack_size = 1,
js = {
stack = 0xbffeb200,
stack_top = 0xbffeb204
},
top_scope = 0x1190edc,
scope = 0xbffeb220,
current_unwind = 0,
unwinds = {{
target_ip = 3002876,
stack_depth = 3002792,
type = rubinius::cEnsure
}, {
target_ip = 3002693,
stack_depth = 1024585,
type = 3221140232
}, {
target_ip = 679164,
stack_depth = 3146144,
type = 21330272
}, {
target_ip = 3221139792,
stack_depth = 3221140112,
type = 3221140392
}, {
target_ip = 25,
stack_depth = 3221139848,
type = 8390744
}, {
target_ip = 3221141728,
stack_depth = 25,
type = 3221139712
}, {
target_ip = 13166,
stack_depth = 24581060,
type = rubinius::cRescue
}, {
target_ip = 5,
stack_depth = 1,
type = 3221140084
}, {
target_ip = 3221140084,
stack_depth = 3221140112,
type = 3221140112
}, {
target_ip = 0,
stack_depth = 12,
type = 18139044
}, {
target_ip = 669316,
stack_depth = 19,
type = 18139044
}, {
target_ip = 3221139944,
stack_depth = 669432,
type = 3146144
}, {
target_ip = 22314688,
stack_depth = 3221139968,
type = rubinius::cEnsure
}, {
target_ip = 25,
stack_depth = 1024585,
type = 3
}, {
target_ip = 680128,
stack_depth = 3146144,
type = 22210320
}, {
target_ip = 3221139936,
stack_depth = 18422748,
type = 3221140536
}, {
target_ip = 23052416,
stack_depth = 3221139976,
type = 846736
}, {
target_ip = 18419420,
stack_depth = 2,
type = 3221139992
}, {
target_ip = 373686,
stack_depth = 18422748,
type = 22314688
}, {
target_ip = 3221140024,
stack_depth = 0,
type = 18422716
}},
stk = 0xbffeb204
}
(gdb) l
2415 msg.lookup_from = msg.recv->lookup_begin(state);
2416 Array* args = Array::create(state, 1);
2417 args->set(state, 0, sym);
2418 msg.set_arguments(state, args);
2419
2420 res = msg.send(state, call_frame);
2421 } else if(kind_of<Autoload>(res)) {
2422 Message msg;
2423 msg.recv = res;
2424 msg.name = G(sym_call);
(gdb) bt 2
#0 rubinius::VMMethod::interpreter (state=0x3001a0, vmm=0x16d57e0, call_frame=0xbffeb0e0) at vm/gen/instructions.cpp:2420
#1 0x000a36f8 in rubinius::VMMethod::run_interpreter (state=0x3001a0, vmm=0x16d57e0, call_frame=0xbffeb0e0) at vm/vmmethod.cpp:640
(More stack frames follow...)
(gdb) s
rubinius::Message::send (this=0xbffeabb8, state=0x3001a0, call_frame=0xbffeb0e0) at vm/message.cpp:186
186 Symbol* original_name = name;
(gdb) n
187 if(!GlobalCacheResolver::resolve(state, *this)) {
(gdb) rp name
:const_missing
$32 = void
(gdb) n
197 if(method_missing) {
(gdb)
198 unshift_argument(state, original_name);
(gdb) p method_missing
$33 = 117
(gdb) s
rubinius::Message::unshift_argument (this=0xbffeabb8, state=0x3001a0, val=0x3d6) at vm/message.cpp:112
112 if(arguments_array) {
(gdb) p arguments_array
$34 = (class rubinius::Array *) 0x1191bec
(gdb) n
113 arguments_array->unshift(state, val);
(gdb) rp bal
No symbol "bal" in current context.
(gdb) rp val
:const_missing
$35 = void
(gdb) n
116 use_array(arguments_array);
(gdb) rp arguments_array
#<Array:0x1191bec>: 2
:const_missing
:CONST
>
$36 = void
(gdb) s
rubinius::Message::use_array (this=0xbffeabb8, ary=0x1191bec) at message.hpp:138
138 total_args = ary->size();
(gdb) n
139 arguments_array = ary;
(gdb)
140 arguments_ = ary->tuple()->field + ary->start()->to_native();
(gdb)
141 }
(gdb) p arguments_
$37 = (class rubinius::Object **) 0x1191c7c
(gdb) p total_args
$38 = 2
(gdb) rp arguments_
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x000c2abc in rubinius::Object::show (this=0x1191c7c, state=0x3001a0, level=0) at vm/builtin/object.cpp:450
450 type_info(state)->show(state, this, level);
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (__show__) will be abandoned.
(gdb) bt 3
#0 0x000c2abc in rubinius::Object::show (this=0x1191c7c, state=0x3001a0, level=0) at vm/builtin/object.cpp:450
#1 0x000c2b04 in rubinius::Object::show (this=0x1191c7c, state=0x3001a0) at vm/builtin/object.cpp:446
#2 0x000824ac in __show__ (obj=0x1191c7c) at vm/type_info.cpp:147
(More stack frames follow...)
(gdb) bt 5
#0 0x000c2abc in rubinius::Object::show (this=0x1191c7c, state=0x3001a0, level=0) at vm/builtin/object.cpp:450
#1 0x000c2b04 in rubinius::Object::show (this=0x1191c7c, state=0x3001a0) at vm/builtin/object.cpp:446
#2 0x000824ac in __show__ (obj=0x1191c7c) at vm/type_info.cpp:147
#3 <function called from gdb>
#4 rubinius::Message::use_array (this=0xbffeabb8, ary=0x1191bec) at message.hpp:141
(More stack frames follow...)
(gdb) up 4
#4 rubinius::Message::use_array (this=0xbffeabb8, ary=0x1191bec) at message.hpp:141
141 }
(gdb) n
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x000c2abc in rubinius::Object::show (this=0x1191c7c, state=0x3001a0, level=0) at vm/builtin/object.cpp:450
450 type_info(state)->show(state, this, level);
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /Users/brian/devel/stackfull/vm/vm mspec/bin/mspec-run -e A\ constant\ on\ a\ metaclass\ raises\ a\ NameError\ for\ anonymous_module::CONST spec/frozen/language/metaclass_spec.rb
Breakpoint 3, rubinius::VMMethod::interpreter (state=0x3001a0, vmm=0x16d57e0, call_frame=0xbffeb0e0) at vm/gen/instructions.cpp:2410
2410 if(!found) {
(gdb) rp sym
:CONST
$39 = void
(gdb) p found
$40 = false
(gdb) n
2411 Message msg;
(gdb)
2412 msg.recv = under;
(gdb)
2413 msg.name = state->symbol("const_missing");
(gdb)
2414 msg.block = Qnil;
(gdb)
2415 msg.lookup_from = msg.recv->lookup_begin(state);
(gdb)
2416 Array* args = Array::create(state, 1);
(gdb)
2417 args->set(state, 0, sym);
(gdb)
2418 msg.set_arguments(state, args);
(gdb) rp args
#<Array:0x1191bec>: 1
:CONST
>
$41 = void
(gdb) n
2420 res = msg.send(state, call_frame);
(gdb) s
rubinius::Message::send (this=0xbffeabb8, state=0x3001a0, call_frame=0xbffeb0e0) at vm/message.cpp:186
186 Symbol* original_name = name;
(gdb) rp name
:const_missing
$42 = void
(gdb) n
187 if(!GlobalCacheResolver::resolve(state, *this)) {
(gdb) s
rubinius::GlobalCacheResolver::resolve (state=0x3001a0, msg=@0xbffeabb8) at vm/builtin/sendsite.cpp:252
252 entry = state->global_cache->lookup(msg.lookup_from, msg.name);
(gdb) rp msg.loo
lookup lookuptable lookuptablebucket loop_done
lookup_from lookuptableassociation loop_destroy loop_init
(gdb) rp msg.lookup_from
#<MetaClass <anonymous>:0x1191060>
$43 = void
(gdb) rp msg.name
:const_missing
$44 = void
(gdb) n
253 if(entry) {
(gdb) p entry
$45 = (rubinius::GlobalCache::cache_entry *) 0x0
(gdb) n
263 if(HierarchyResolver::resolve(state, msg)) {
(gdb) s
rubinius::HierarchyResolver::resolve (state=0x3001a0, msg=@0xbffeabb8) at vm/builtin/sendsite.cpp:185
185 Module* module = msg.lookup_from;
(gdb) n
190 entry = module->method_table()->fetch(state, msg.name);
(gdb) rp module
#<MetaClass <anonymous>:0x1191060>
$46 = void
(gdb) n
193 if(entry->nil_p()) goto keep_looking;
(gdb) n
240 module = module->superclass();
(gdb) p entry
$47 = (class rubinius::Object *) 0x1a
(gdb) n
243 if(module->nil_p()) return false;
(gdb) p module
$48 = (class rubinius::Module *) 0x17a3974
(gdb) rp module
#<MetaClass Object:0x17a3974>
$49 = void
(gdb) n
190 entry = module->method_table()->fetch(state, msg.name);
(gdb)
193 if(entry->nil_p()) goto keep_looking;
(gdb) p entry
$50 = (class rubinius::Object *) 0x1a
(gdb) n
240 module = module->superclass();
(gdb)
243 if(module->nil_p()) return false;
(gdb) rp module
#<Class(Class):0x3d3bf4>
name: :Class
superclass: #<Module(Class):0x3ccf54>
constants: #<LookupTable:0x17a5a74>
method_table: #<MethodTable:0x17a5a34>
>
$51 = void
(gdb) n
190 entry = module->method_table()->fetch(state, msg.name);
(gdb)
193 if(entry->nil_p()) goto keep_looking;
(gdb) p entry
$52 = (class rubinius::Object *) 0x1a
(gdb) n
240 module = module->superclass();
(gdb)
243 if(module->nil_p()) return false;
(gdb) rp module
#<Module(Class):0x3ccf54>
name: :Module
superclass: #<Object(Class):0x1407684>
constants: #<LookupTable:0x17a62b4>
method_table: #<MethodTable:0x17a6274>
>
$53 = void
(gdb) n
190 entry = module->method_table()->fetch(state, msg.name);
(gdb)
193 if(entry->nil_p()) goto keep_looking;
(gdb) p entry
$54 = (class rubinius::Object *) 0x17679a4
(gdb) rp entry
#<CompiledMethod:0x17679a4>
exceptions: #<Tuple:0x1818aa4>
file: :kernel/common/module.rb
iseq: #<InstructionSequence:0x1818a64>
lines: #<Tuple:0x1818ae4>: 2
#<Tuple:0x1818ae4>: 3>
#<Tuple:0x1818ae4>: 3>
>
literals: #<Tuple:0x1818b64>: 5
:NameError
nil
#<SendSite:0x3f34b4>
"Missing or uninitialized constant: "
#<SendSite:0x3da194>
>
local_count: 1
local_names: #<Tuple:0x1818b24>: 1
:name
>
name: :const_missing
required_args: 1
scope: #<StaticScope:0x17ac594>
splat: nil
stack_size: 5
total_args: 1
>
$55 = void
(gdb) bt 5
#0 rubinius::HierarchyResolver::resolve (state=0x3001a0, msg=@0xbffeabb8) at vm/builtin/sendsite.cpp:193
#1 0x000c5265 in rubinius::GlobalCacheResolver::resolve (state=0x3001a0, msg=@0xbffeabb8) at vm/builtin/sendsite.cpp:263
#2 0x00052331 in rubinius::Message::send (this=0xbffeabb8, state=0x3001a0, call_frame=0xbffeb0e0) at vm/message.cpp:187
#3 0x000fb3fd in rubinius::VMMethod::interpreter (state=0x3001a0, vmm=0x16d57e0, call_frame=0xbffeb0e0) at vm/gen/instructions.cpp:2420
#4 0x000a36f8 in rubinius::VMMethod::run_interpreter (state=0x3001a0, vmm=0x16d57e0, call_frame=0xbffeb0e0) at vm/vmmethod.cpp:640
(More stack frames follow...)
(gdb) l
188
189 do {
190 entry = module->method_table()->fetch(state, msg.name);
191
192 /* Nothing, there? Ok, keep looking. */
193 if(entry->nil_p()) goto keep_looking;
194
195 /* A 'false' method means to terminate method lookup.
196 * (eg. undef_method) */
197 if(entry == Qfalse) return false;
(gdb) n
197 if(entry == Qfalse) return false;
(gdb)
199 vis = try_as<MethodVisibility>(entry);
(gdb)
203 if(msg.priv) {
(gdb) p vis
$56 = (rubinius::MethodVisibility *) 0x0
(gdb) p msg.pri
prime_rehash_policy primitive_ printfmt
prime_table_length printf priv
primes printf_l private_mem
(gdb) p msg.priv
$57 = 65
(gdb) p msg
$58 = (class rubinius::Message &) @0xbffeabb8: {
state = 0xbffeac18,
arguments_array = 0x1191bec,
total_args = 1,
stack_args_ = 0x1191b74,
arguments_ = 0x1191c1c,
send_site = 0xce3ce,
name = 0x3d6,
recv = 0x1191038,
block = 0x1a,
priv = 65,
lookup_from = 0x1191060,
method = 0x3001a0,
module = 0x118be00,
method_missing = 117,
caller_ = 0x1191a44
}
(gdb) n
205 if(vis && vis->method()->nil_p()) goto keep_looking;
(gdb)
207 msg.method = as<Executable>(vis ? vis->method() : entry);
(gdb)
208 msg.module = module;
(gdb)
246 return true;
(gdb)
247 }
(gdb)
rubinius::GlobalCacheResolver::resolve (state=0x3001a0, msg=@0xbffeabb8) at vm/builtin/sendsite.cpp:265
265 msg.module, msg.method, msg.method_missing);
(gdb) bt 2
#0 rubinius::GlobalCacheResolver::resolve (state=0x3001a0, msg=@0xbffeabb8) at vm/builtin/sendsite.cpp:265
#1 0x00052331 in rubinius::Message::send (this=0xbffeabb8, state=0x3001a0, call_frame=0xbffeb0e0) at vm/message.cpp:187
(More stack frames follow...)
(gdb) n
266 return true;
(gdb)
270 }
(gdb)
rubinius::Message::send (this=0xbffeabb8, state=0x3001a0, call_frame=0xbffeb0e0) at vm/message.cpp:197
197 if(method_missing) {
(gdb) p method_missing
$59 = 117
(gdb) bt 2
#0 rubinius::Message::send (this=0xbffeabb8, state=0x3001a0, call_frame=0xbffeb0e0) at vm/message.cpp:197
#1 0x000fb3fd in rubinius::VMMethod::interpreter (state=0x3001a0, vmm=0x16d57e0, call_frame=0xbffeb0e0) at vm/gen/instructions.cpp:2420
(More stack frames follow...)
(gdb) l
192 tragic_failure(state, *this);
193 return NULL;
194 }
195 }
196
197 if(method_missing) {
198 unshift_argument(state, original_name);
199 }
200
201 return method->execute(state, call_frame, *this);