Projects

Ticket #165 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Embeddable MacRuby.framework misses the BridgeSupport dylib files

Reported by: self@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.4
Component: MacRuby Keywords: crash,bridge support,gc
Cc:

Description

I just got a bug report from a tester about Elysium (which embed MacRuby r746) and he has a new crash:

Process:         Elysium [7269]
Path:            /Users/stu/Downloads/Elysium.app/Contents/MacOS/Elysium
Identifier:      com.lucidmac.Elysium
Version:         ??? (0.7.9.9)
Code Type:       X86 (Native)
Parent Process:  launchd [109]

Date/Time:       2008-11-19 12:26:03.366 +0000
OS Version:      Mac OS X 10.5.5 (9F33)
Report Version:  6

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread:  0

Application Specific Information:
objc[7269]: garbage collection is ON
*** Terminating app due to uncaught exception 'RuntimeError', reason:
'dlopen(/System/Library/Frameworks/CoreFoundation.framework/Resources/BridgeSupport/CoreFoundation.dylib,
1): no suitable image found.  Did find:
       /System/Library/Frameworks/CoreFoundation.framework/Resources/BridgeSupport/CoreFoundation.dylib:
GC capability mismatch'

Thread 0 Crashed:
0   com.apple.CoreFoundation            0x9278bff4
___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___ + 4
1   libobjc.A.dylib                     0x92afee3b objc_exception_throw + 40
2   com.apple.CoreFoundation            0x9278bc71 -[NSException raise] + 17
3   libmacruby.1.9.0.dylib              0x002f4978 rb_raise_ruby_exc_in_objc + 344
4   libmacruby.1.9.0.dylib              0x002f4aa0 evaluateString_rescue + 16
5   libmacruby.1.9.0.dylib              0x002053a3 rb_rescue2 + 435
6   libmacruby.1.9.0.dylib              0x002f4af8 -[MacRuby evaluateString:] + 72
7   com.lucidmac.Elysium                0x00016467 -[ElysiumController
initMacRuby] + 292
8   com.lucidmac.Elysium                0x0001633d -[ElysiumController
awakeFromNib] + 72
9   com.apple.CoreFoundation            0x9279a955 -[NSSet
makeObjectsPerformSelector:] + 181
10  com.apple.AppKit                    0x94c7caca -[NSIBObjectData
nibInstantiateWithOwner:topLevelObjects:] + 1533
11  com.apple.AppKit                    0x94c72cf6 loadNib + 264
12  com.apple.AppKit                    0x94c72658 +[NSBundle(NSNibLoading)
_loadNibFile:nameTable:withZone:ownerBundle:] + 946
13  com.apple.AppKit                    0x94c7229b +[NSBundle(NSNibLoading)
loadNibFile:externalNameTable:withZone:] + 171
14  com.apple.AppKit                    0x94c721d9 +[NSBundle(NSNibLoading)
loadNibNamed:owner:] + 391
15  com.apple.AppKit                    0x94c71e88 NSApplicationMain + 434
16  com.lucidmac.Elysium                0x00002670 main + 30
17  com.lucidmac.Elysium                0x00002626 start + 54

Talking with Alloy we think the difference is that on my machine I have built and installed MacRuby which means that the rake task for fixing the bridge support dylibs has been run, whereas on his machine (since he just gems my embedded MacRuby) it has not.

This would appear to mean that any application embedding MacRuby will be broken on 10.5

Change History

  Changed 3 years ago by self@…

Typo: I meant "(since he just gets my embedded MacRuby)" above.

  Changed 3 years ago by lsansonetti@…

  • summary changed from MacRuby broken on 10.5 to Embeddable MacRuby.framework misses the BridgeSupport dylib files

Indeed, that's a serious problem, good catch!

I guess the solution will be to embed these .dylib files inside the framework (MacRuby.framework/Resources/BridgeSupport/*.dylib) and modify MacRuby core to look there in priority.

  Changed 3 years ago by lsansonetti@…

I committed the necessary infrastructure changes as part of r762. Now MacRuby will load any BridgeSupport file/dylib that is inside the executable bundle, in Resources/BridgeSupport, prior to any other location.

This means you can copy all the .dylib files inside your .app bundle and (in theory) your app should run on a vanilla Leopard install.

The following should work (untested though)

$ mkdir /Path/To/MyApp.app/Contents/Resources/BridgeSupport
$ find /System/Library/Frameworks -regex ".*/BridgeSupport/.*dylib" -exec cp {} /Path/To/MyApp.app/Contents/Resources/BridgeSupport \;

This will be automatized as part of the hotcocoa deploy task and be also available as an Xcode target.

follow-up: ↓ 5   Changed 3 years ago by lsansonetti@…

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

I committed the remaining changes as part of r765.

For HotCocoa projects, macrake deploy will copy the .dylib files.

For Xcode projects, a Embed MacRuby target is now installed as part of MacRuby. You can add the target to your project and building the target should embed MacRuby.framework inside the application bundle, change the linker install name and copy the .dylib files.

The 'build_as_embeddable' Rakefile configuration variable has been removed, since it's no longer necessary.

I will make sure this 'feature' will be appropriately documented in our future cookbook.

in reply to: ↑ 4   Changed 3 years ago by self@…

Replying to lsansonetti@…:

For Xcode projects, a Embed MacRuby target is now installed as part of MacRuby. You can add the target to your project and building the target should embed MacRuby.framework inside the application bundle, change the linker install name and copy the .dylib files. The 'build_as_embeddable' Rakefile configuration variable has been removed, since it's no longer necessary.

Reading this I can't be sure but it seems to imply I can only embed the version of MacRuby I have installed. How would I embed trunk if I have 0.4 or 0.5 installed?

M.

  Changed 3 years ago by lsansonetti@…

Good point, currently it will embed the Current version of the framework (which may be trunk). We should specify options to HotCocoa::ApplicationBuilder.deploy. Could you file another ticket for this?

Note: See TracTickets for help on using tickets.