Projects

Ticket #815 (closed defect: fixed)

Opened 19 months ago

Last modified 18 months ago

Macrake crashes at initialization

Reported by: legrand@… Owned by: lsansonetti@…
Priority: critical Milestone: MacRuby 0.7
Component: MacRuby Keywords:
Cc: legrand@…, maccman@…

Description

Running macrake without any argument results in a segmentation fault. Macrake also fails on trivial rake files with the same stack.

It appears that object_getClass gets called with an invalid pointer (value 8) by rb_objc_nsnumber2numeric.

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000008
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Application Specific Information:
objc[86966]: garbage collection is ON

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib               	0x00007fff8348c5f0 object_getClass + 11
1   libmacruby.dylib              	0x00000001000dc123 rb_objc_nsnumber2numeric + 19
2   ???                           	0x0000000103aa6100 0 + 4356464896
3   com.apple.CoreFoundation      	0x00007fff81dcb20f -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 783
4   com.apple.CoreFoundation      	0x00007fff81dcd74a +[NSDictionary dictionaryWithObject:forKey:] + 58
5   libmacruby.dylib              	0x00000001000dc410 rb_rb2oc_exception + 96
6   libmacruby.dylib              	0x0000000100142a5d rb_vm_raise + 429
7   libmacruby.dylib              	0x000000010003027b rb_make_exception + 523
8   libmacruby.dylib              	0x0000000100130399 rb_vm_dispatch + 6841

Let me know if more information is required.

Change History

Changed 19 months ago by legrand@…

  • cc legrand@… added

Cc Me!

Changed 18 months ago by martinlagardette@…

The problem comes from the fact that the -copy selector is overridden on NSObject by Rake, which causes some problems when comes the time to handle exceptions. Because we use Obj-C exceptions and some Obj-C methods, some -copy messages are sent to the object, which goes through the MacRuby-defined -copy implementation, instead of the original implementation.

What this means is that whenever rake and exceptions are involved and it crashes, you can be sure the reason is this bug :D (#839 and #840 deal with exceptions with rake, and they are duplicate of this bug).

Changed 18 months ago by maccman@…

  • cc maccman@… added

Cc Me!

Changed 18 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed

Should be fixed in r4418.

Note: See TracTickets for help on using tickets.