[MacRuby-devel] [MacRuby] #342: Wrong line numbers in backtrace

2009-09-20 Thread MacRuby
#342: Wrong line numbers in backtrace
+---
 Reporter:  d...@…   |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  major   |   Milestone:  MacRuby 0.5  
Component:  MacRuby |Keywords:   
+---
 {{{
 box:Desktop $ cat raise1.rb
 p 42
 raise "ouch"
 box:Desktop $ macruby raise1.rb
 42
 core:in `raise:': ouch (RuntimeError)
 from raise1.rb:1:in `'
 box:Desktop $ cat raise2.rb
 #p 42
 raise "ouch"
 box:Desktop $ macruby raise2.rb
 core:in `raise:': ouch (RuntimeError)
 from raise2.rb:2:in `'
 }}}

 The only difference between the files is the comment char # in line 1!

 BTW, thanks for implementing the long awaited backtrace, great job!

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] How can I catch segment faults?

2009-09-20 Thread B. Ohr (dev)


Hey, after installing r2590 with backtrace support (thanks for that!)  
now I have the problem to catch segment faults.


It seems to be a problem inside of a hash#each_pair, but I have  
absolutely no idea where, and because it is foreign code a file name  
and line number would be more than useful!


---

(gdb) run ../xx.rb compile
Starting program: /usr/local/bin/macruby ../xx.rb compile
Reading symbols for shared libraries + done
Loading site data...

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x7fff60771b60
0x000100d90283 in _cache_getMethod ()

(gdb) backtrace
#0  0x000100d90283 in _cache_getMethod ()
#1  0x000100d8fa43 in look_up_method ()
#2  0x000100176c4d in __rb_vm_dispatch [inlined] () at /Users/box/ 
Documents/dev/macruby/macruby/vm.cpp:2780
#3  0x000100176c4d in rb_vm_dispatch (cache=0x108fcfac0,  
self=140734799741824, sel=0x102b8b570, block=0x0, opt=0 '\0', argc=1)  
at vm.cpp:3154

#4  0x000104152605 in ?? ()
#5  0x0001001752b6 in rb_vm_yield0 [inlined] () at /Users/box/ 
Documents/dev/macruby/macruby/vm.cpp:4207
#6  0x0001001752b6 in rb_vm_yield (argc=6687904,  
argv=0x7fff5fbf56f0) at vm.cpp:4214
#7  0x00010011a978 in rb_yield_0 [inlined] () at /Users/box/ 
Documents/dev/macruby/macruby/vm_eval.c:194
#8  0x00010011a978 in rb_yield_values (n=unavailable, due to optimizations>) at vm_eval.c:226
#9  0x000100039c68 in inject_i (i=1, p=140734799741792,  
argc=6753408, argv=0x7fff5fbf5988) at enum.c:429
#10 0x0001001741da in rb_vm_block_eval0 (b=0x2006403c0, sel=0x0,  
self=8596725184, argc=1, argv=0x10a64a860) at vm.cpp:4082
#11 0x0001001752b6 in rb_vm_yield0 [inlined] () at /Users/box/ 
Documents/dev/macruby/macruby/vm.cpp:4207
#12 0x0001001752b6 in rb_vm_yield (argc=1, argv=0x7fff5fbf5988) at  
vm.cpp:4214

#13 0x00010011a1f0 in rb_yield (val=8596688000) at vm_eval.c:194
#14 0x00010004d5f7 in each_pair_i (key=8596688000, value=0) at  
hash.c:1099
#15 0x000100050c2c in rb_hash_foreach (hash=unavailable, due to optimizations>, func=0x10004d5e0 ,  
farg=0) at hash.c:108
#16 0x000100051321 in rb_hash_each_pair (hash=8596722368,  
sel=0x102b2b400) at hash.c:1125
#17 0x0001001738e1 in rb_vm_call_with_cache2 (cache=0x102b2b490,  
block=0x2006403c0, self=8596722368, klass=4295299792, sel=0x102b2b400,  
argc=, argv=0x0)  
at vm.cpp:2336
#18 0x000100037fd8 in enum_inject (obj=8596722368, sel=temporarily unavailable, due to optimizations>, argc=temporarily unavailable, due to optimizations>, argv=temporarily unavailable, due to optimizations>) at enum.c:521
#19 0x000100177be1 in rb_vm_dispatch (cache=0x106e620b0,  
self=8596722368, sel=0x102b51b30, block=0x200640420, opt=2 '\002',  
argc=1) at vm.cpp:2679

#20 0x000104152410 in ?? ()
#21 0x000104151afe in ?? ()
#22 0x00010415173b in ?? ()
#23 0x00010006cbe7 in rb_class_new_instance_imp (klass=1,  
sel=,  
argc=6755200, argv=0x104152390) at object.c:1892
#24 0x000100177be1 in rb_vm_dispatch (cache=0x102b69670,  
self=8596901376, sel=0x102b2d8b0, block=0x0, opt=0 '\0', argc=1) at  
vm.cpp:2679

#25 0x00010414fe2f in ?? ()
#26 0x00010414f785 in ?? ()
#27 0x00010413812e in ?? ()
#28 0x00010414c561 in ?? ()
#29 0x0001040808f2 in ?? ()
#30 0x00010003f809 in ruby_run_node (n=0x200662500) at eval.c:198
#31 0x00010dd8 in main (argc=3, argv=0x102b1ba90, envp=temporarily unavailable, due to optimizations>) at main.cpp:42



___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #309: String, Hash, Array: singleton attr_accessor cannot be defined

2009-09-20 Thread MacRuby
#309: String, Hash, Array: singleton attr_accessor cannot be defined
+---
 Reporter:  d...@…   |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  minor   |   Milestone:  MacRuby 0.5  
Component:  MacRuby |Keywords:  singleton
+---

Comment(by d...@…):

 I attached a patch with 3 failing tests for that ticket!

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] [MacRuby] #343: 'IRB.conf[: MAIN_CONTEXT].to_s‘ crashes

2009-09-20 Thread MacRuby
#343: 'IRB.conf[:MAIN_CONTEXT].to_s‘ crashes
+---
 Reporter:  d...@…   |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  major   |   Milestone:  MacRuby 0.5  
Component:  MacRuby |Keywords:   
+---
 {{{
 echo 'IRB.conf[:MAIN_CONTEXT].to_s' | macirb
 }}}

 crashes:

 {{{
 Assertion failed: (l != NULL), function rb_vm_prepare_block, file vm.cpp,
 line 3587.
 Abort trap
 }}}

 With gdb:

 {{{
 $ gdb macruby
 GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul  3 01:19:56 UTC
 2009)
 Copyright 2004 Free Software Foundation, Inc.
 GDB is free software, covered by the GNU General Public License, and you
 are
 welcome to change it and/or distribute copies of it under certain
 conditions.
 Type "show copying" to see the conditions.
 There is absolutely no warranty for GDB.  Type "show warranty" for
 details.
 This GDB was configured as "x86_64-apple-darwin"...Reading symbols for
 shared libraries . done

 (gdb) run -e "load '/usr/local/bin/macirb'"
 Starting program: /usr/local/bin/macruby -e "load '/usr/local/bin/macirb'"
 Reading symbols for shared libraries .. done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries ... done
 Reading symbols for shared libraries . done
 irb(main):001:0> IRB.conf[:MAIN_CONTEXT].to_s
 Assertion failed: (l != NULL), function rb_vm_prepare_block, file vm.cpp,
 line 3587.

 Program received signal SIGABRT, Aborted.
 0x000100f83ff6 in __kill ()
 (gdb) backtrace
 #0  0x000100f83ff6 in __kill ()
 #1  0x000101025072 in abort ()
 #2  0x0001010120b4 in __assert_rtn ()
 #3  0x00010016c908 in rb_vm_prepare_block (function=0x102ed8a20,
 flags=0, self=8592355488, arity=, parent_var_uses=0x7fff5fbee8b8, parent_block=0x4,
 dvars_size=4) at vm.cpp:3587
 #4  0x000102ed88c9 in _unnamed_26_457 ()
 #5  0x00010409ca2a in ?? ()
 #6  0x00010016c339 in RoxorCompiler::set_dynamic_class () at
 /Users/box/Documents/dev/macruby/macruby/compiler.h:4834
 #7  0x00010016c339 in rb_vm_run_under (klass=0, self=, fname=0x20025d401 "(irb)",
 node=0x20026fc60, binding=0x10384a8c0, inside_eval=) at vm.cpp:4836
 #8  0x00010011b488 in rb_f_eval (self=8592355424, sel=, argc=, argv=) at vm_eval.c:467
 #9  0x000100177be1 in rb_vm_dispatch (cache=0x102bf10e0,
 self=8592355424, sel=0x102b2b3c0, block=0x0, opt=2 '\002', argc=4) at
 vm.cpp:2679
 #10 0x000102ee30e7 in _unnamed_22_165 ()
 }}}

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] How can I catch segment faults?

2009-09-20 Thread Laurent Sansonetti

Hi,

We will implement dwarf symbolication which will allow you to see the  
ruby method, filename and line instead of ?? in the gdb backtrace, but  
in the meantime an easy way to debug these problems is to toggle the  
ROXOR_VM_DEBUG variable to 1 in vm.cpp and recompile miniruby.


This will print a lot of information on stdout, which should allow you  
to track and identify the crash.


# Segmentation faults are bugs in MacRuby core, so in theory users  
should not see them :)


Also, try setting the GC_DISABLE environment variable to 1 before  
starting the program, if it doesn't crash then it's very likely a  
missing write barrier in the collector.


Laurent

On Sep 20, 2009, at 3:03 AM, B. Ohr (dev) wrote:



Hey, after installing r2590 with backtrace support (thanks for  
that!) now I have the problem to catch segment faults.


It seems to be a problem inside of a hash#each_pair, but I have  
absolutely no idea where, and because it is foreign code a file name  
and line number would be more than useful!


---

(gdb) run ../xx.rb compile
Starting program: /usr/local/bin/macruby ../xx.rb compile
Reading symbols for shared libraries + done
Loading site data...

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x7fff60771b60
0x000100d90283 in _cache_getMethod ()

(gdb) backtrace
#0  0x000100d90283 in _cache_getMethod ()
#1  0x000100d8fa43 in look_up_method ()
#2  0x000100176c4d in __rb_vm_dispatch [inlined] () at /Users/ 
box/Documents/dev/macruby/macruby/vm.cpp:2780
#3  0x000100176c4d in rb_vm_dispatch (cache=0x108fcfac0,  
self=140734799741824, sel=0x102b8b570, block=0x0, opt=0 '\0',  
argc=1) at vm.cpp:3154

#4  0x000104152605 in ?? ()
#5  0x0001001752b6 in rb_vm_yield0 [inlined] () at /Users/box/ 
Documents/dev/macruby/macruby/vm.cpp:4207
#6  0x0001001752b6 in rb_vm_yield (argc=6687904,  
argv=0x7fff5fbf56f0) at vm.cpp:4214
#7  0x00010011a978 in rb_yield_0 [inlined] () at /Users/box/ 
Documents/dev/macruby/macruby/vm_eval.c:194
#8  0x00010011a978 in rb_yield_values (n=unavailable, due to optimizations>) at vm_eval.c:226
#9  0x000100039c68 in inject_i (i=1, p=140734799741792,  
argc=6753408, argv=0x7fff5fbf5988) at enum.c:429
#10 0x0001001741da in rb_vm_block_eval0 (b=0x2006403c0, sel=0x0,  
self=8596725184, argc=1, argv=0x10a64a860) at vm.cpp:4082
#11 0x0001001752b6 in rb_vm_yield0 [inlined] () at /Users/box/ 
Documents/dev/macruby/macruby/vm.cpp:4207
#12 0x0001001752b6 in rb_vm_yield (argc=1, argv=0x7fff5fbf5988)  
at vm.cpp:4214

#13 0x00010011a1f0 in rb_yield (val=8596688000) at vm_eval.c:194
#14 0x00010004d5f7 in each_pair_i (key=8596688000, value=0) at  
hash.c:1099
#15 0x000100050c2c in rb_hash_foreach (hash=unavailable, due to optimizations>, func=0x10004d5e0 ,  
farg=0) at hash.c:108
#16 0x000100051321 in rb_hash_each_pair (hash=8596722368,  
sel=0x102b2b400) at hash.c:1125
#17 0x0001001738e1 in rb_vm_call_with_cache2 (cache=0x102b2b490,  
block=0x2006403c0, self=8596722368, klass=4295299792,  
sel=0x102b2b400, argc=optimizations>, argv=0x0) at vm.cpp:2336
#18 0x000100037fd8 in enum_inject (obj=8596722368, sel=temporarily unavailable, due to optimizations>, argc=temporarily unavailable, due to optimizations>, argv=temporarily unavailable, due to optimizations>) at enum.c:521
#19 0x000100177be1 in rb_vm_dispatch (cache=0x106e620b0,  
self=8596722368, sel=0x102b51b30, block=0x200640420, opt=2 '\002',  
argc=1) at vm.cpp:2679

#20 0x000104152410 in ?? ()
#21 0x000104151afe in ?? ()
#22 0x00010415173b in ?? ()
#23 0x00010006cbe7 in rb_class_new_instance_imp (klass=1,  
sel=,  
argc=6755200, argv=0x104152390) at object.c:1892
#24 0x000100177be1 in rb_vm_dispatch (cache=0x102b69670,  
self=8596901376, sel=0x102b2d8b0, block=0x0, opt=0 '\0', argc=1) at  
vm.cpp:2679

#25 0x00010414fe2f in ?? ()
#26 0x00010414f785 in ?? ()
#27 0x00010413812e in ?? ()
#28 0x00010414c561 in ?? ()
#29 0x0001040808f2 in ?? ()
#30 0x00010003f809 in ruby_run_node (n=0x200662500) at eval.c:198
#31 0x00010dd8 in main (argc=3, argv=0x102b1ba90,  
envp=) at  
main.cpp:42



___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #343: 'IRB.conf[: MAIN_CONTEXT].to_s‘ crashes

2009-09-20 Thread MacRuby
#343: 'IRB.conf[:MAIN_CONTEXT].to_s‘ crashes
+---
 Reporter:  d...@…   |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  major   |   Milestone:  MacRuby 0.5  
Component:  MacRuby |Keywords:   
+---

Comment(by lsansone...@…):

 Thanks for the report.

 This is not a problem in the AOT compiler. (Since last night, macirb is
 100% compiled post installation).

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel