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

2009-09-21 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 eloy.de.en...@…):

 Applied in r2592, thanks! And I've added tags for them in r2593.

 Unfortunately I got the git svn command to add the authors name to the
 messages wrong, so you're name is not in the message… But that's what we
 get with svn.

-- 
Ticket URL: 
MacRuby 

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


[MacRuby-devel] [MacRuby] #344: Segmentation fault: Hash and Array Inject

2009-09-21 Thread MacRuby
#344: Segmentation fault: Hash and Array Inject
+---
 Reporter:  d...@…   |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  critical|   Milestone:  MacRuby 0.5  
Component:  MacRuby |Keywords:   
+---
 {{{
 box $ cat crash.rb

 class Hash
   def symbolize_keys
 inject({}) do |hash, (key, value)|
   hash.merge(key.to_sym => value.respond_to?(:symbolize_keys) ?
 value.symbolize_keys : value)
 end
   end
 end

 class Array
   def symbolize_keys
 inject([]) do |array, element|
 # array + [ element.respond_to?(:symbolize_keys) ?
 element.symbolize_keys : element ]
   "a"
 end
   end
 end

 p ({"data_sources"=>["xx"], "output_dir"=>"output"}).symbolize_keys

 box $ macruby crash.rb
 unknown: [BUG] Segmentation fault
 MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64]

 Abort trap
 }}}

 With gdb:

 {{{
 (gdb) run crash.rb
 Starting program: /usr/local/bin/macruby crash.rb
 Reading symbols for shared libraries .. done

 Program received signal EXC_BAD_ACCESS, Could not access memory.
 Reason: KERN_INVALID_ADDRESS at address: 0x7fff6077cd40
 0x000100d90283 in _cache_getMethod ()
 (gdb) bt
 #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=0x102bf7740,
 self=140734799783520, sel=0x102b8b570, block=0x0, opt=0 '\0', argc=1) at
 vm.cpp:3154
 #4  0x000104080545 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=132064, argv=0x7fff5fbfcd70)
 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=) at vm_eval.c:226
 #9  0x000100039c68 in inject_i (i=1, p=140734799783488, argc=132832,
 argv=0x7fff5fbfd008) at enum.c:429
 #10 0x0001001741da in rb_vm_block_eval0 (b=0x2e180, sel=0x0,
 self=8590066784, argc=1, argv=0x102bfb8e0) 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=0x7fff5fbfd008) at
 vm.cpp:4214
 #13 0x00010011a1f0 in rb_yield (val=8590067424) at vm_eval.c:194
 #14 0x00010004d5f7 in each_pair_i (key=8590067424, value=0) at
 hash.c:1099
 #15 0x000100050c2c in rb_hash_foreach (hash=, func=0x10004d5e0 ,
 farg=0) at hash.c:108
 #16 0x000100051321 in rb_hash_each_pair (hash=8590066592,
 sel=0x102b2b400) at hash.c:1125
 #17 0x0001001738e1 in rb_vm_call_with_cache2 (cache=0x102b2b490,
 block=0x2e180, self=8590066592, klass=4295299792, sel=0x102b2b400,
 argc=, argv=0x0) at
 vm.cpp:2336
 #18 0x000100037fd8 in enum_inject (obj=8590066592, sel=, argc=, argv=) at enum.c:521
 #19 0x000100177be1 in rb_vm_dispatch (cache=0x102bf6230,
 self=8590066592, sel=0x102b51b30, block=0x2cf00, opt=2 '\002', argc=1)
 at vm.cpp:2679
 #20 0x000104080350 in ?? ()
 #21 0x0001040801d4 in ?? ()
 Previous frame inner to this frame (gdb could not unwind past this frame)
 }}}

-- 
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-21 Thread B. Ohr (dev)


Hi Laurent,

thank you for your tips. However, with the GC the problem has nothing  
to do. miniruby I cannot use, because with it YAML does not function.


In the end, I have applied the following trick:


(gdb) break rb_class_new_instance_imp

(gdb) run ../xx.rb compile

(gdb) cont 12

(gdb) jump rb_memerror

an I got a wonderful backtrace with file names (line numbers).

Then it was relatively simply to be isolated the problem for which I  
have generated ticket #344.


Bernd


Am 20.09.2009 um 21:47 schrieb 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=unavailable, due to 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



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

2009-09-21 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...@…):

 It is a pity, I commit patches only to become famous! But, nevertheless,
 seriously, this is already a reason to substitute svn by git! ;-)

-- 
Ticket URL: 
MacRuby 

___
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-21 Thread William Siegrist

On Sep 21, 2009, at 1:28 AM, MacRuby wrote:


#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 eloy.de.en...@…):

Applied in r2592, thanks! And I've added tags for them in r2593.

Unfortunately I got the git svn command to add the authors name to the
messages wrong, so you're name is not in the message… But that's  
what we

get with svn.




The subversion repo allows for revprop editing, so you can fix the  
commit message if you like.


-Bill


___
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-21 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...@…):

 The problem is in lib/irb.rb, in the method that defines #inspect on
 @CONF.

 Changing

 {{{
 for k, v in sort{|a1, a2| a1[0].id2name <=> a2[0].id2name}
 }}}

 to

 {{{
 sort{|a1, a2| a1[0].id2name <=> a2[0].id2name}.each do |k, v|
 }}}

 fixes the problem. Surely a problem in the parser, where we handle
 NODE_FOR.

-- 
Ticket URL: 
MacRuby 

___
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-21 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 vincent.isamb...@…):

 Better reduction of the bug:
 {{{
 a = nil
 for b in [:a, :b].sort {|x, y| x <=> y}
   c = nil
 end
 }}}

-- 
Ticket URL: 
MacRuby 

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