Projects

Ticket #658 (closed defect: fixed)

Opened 22 months ago

Last modified 22 months ago

Including a module into Hash breaks creating an NSDictionary from a hash

Reported by: eloy.de.enige@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.6
Component: MacRuby Keywords:
Cc:

Description (last modified by martinlagardette@…) (diff)

$ macruby -e "module H; end; class Hash; include H; end; p NSDictionary.dictionaryWithDictionary('foo' => true)"

unknown: [BUG] Segmentation fault
MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64]

Stack trace

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libSystem.B.dylib             	0x00007fff8773f886 __kill + 10
1   libSystem.B.dylib             	0x00007fff877dfeae abort + 83
2   libmacruby.dylib              	0x000000010004372d rb_bug + 205 (error.c:229)
3   libmacruby.dylib              	0x00000001000bee40 sigbus + 0 (signal.c:378)
4   libSystem.B.dylib             	0x00007fff8775180a _sigtramp + 26
5   com.apple.CoreFoundation      	0x00007fff80ff0490 CFBasicHashGetCount + 64
6   com.apple.Foundation          	0x00007fff8293ae1b -[NSCFDictionary getObjects:andKeys:] + 34
7   libmacruby.dylib              	0x0000000100179608 nshash_getObjectsAndKeys + 72 (NSDictionary.m:560)
8   com.apple.CoreFoundation      	0x00007fff810455eb -[NSDictionary initWithDictionary:copyItems:] + 219
9   com.apple.CoreFoundation      	0x00007fff810454cb +[NSDictionary dictionaryWithDictionary:] + 43
10  ???                           	0x0000000101100425 0 + 4312794149
11  libmacruby.dylib              	0x000000010014bd30 rb_vm_dispatch + 3184 (dispatcher.cpp:449)
12  ???                           	0x00000001011001a9 0 + 4312793513
13  libmacruby.dylib              	0x00000001001607df rb_vm_run + 351 (vm.cpp:3967)
14  libmacruby.dylib              	0x0000000100045799 ruby_run_node + 73 (eval.c:201)
15  macruby                       	0x0000000100000d28 main + 152 (main.cpp:40)
16  macruby                       	0x0000000100000c88 start + 52

Change History

Changed 22 months ago by martinlagardette@…

  • description modified (diff)

Changed 22 months ago by lsansonetti@…

On the bleeding edge I get:

$ ./miniruby  -e "module H; end; class Hash; include H; end; p NSDictionary.dictionaryWithDictionary('foo' => true)"
NSInvalidArgumentException: *** -[NSCFDictionary initWithObjects:forKeys:count:]: attempt to insert nil key at keys[0] (RuntimeError)

Changed 22 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to MacRuby 0.6

Should be fixed in r3954.

Note: See TracTickets for help on using tickets.