iPhone stripping causes SIGBUS

Whenever I enable iPhone Stripping (at any level other than “disabled”) my iPhone project crashes with a SIGBUS:

Program received signal:  “SIGBUS”.
(gdb) c
Continuing.
Function "objc_exception_throw" not defined.
Program received signal:  “SIGBUS”.

Program received signal SIGBUS, Bus error.
0x00317560 in start ()
(gdb) bt
#0  0x00317560 in start ()

This occurs when I press a button in the game which does very little. It creates a URL and then calls Application.OpenURL.

I’ve looked at the assembly code and registers and it’s a simple null reference.

I’ve spent all day trying a bunch of things: stripping at various levels, fresh Xcode projects, etc. etc. but basically the game is fine in the editor and fine on the iPhone and iPad with stripping disabled.

Does anyone have any experience with bugs of this kind and Unity stripping? What approach can I take to finding and working around it?

this is no bug

there is just functionality that will no longer work when you attempt to strip.
the same holds for some 3rd party addons on the unity side.

Is there any way of knowing which functionality will crash when the game is stripped?

The documentation says:

I haven’t been presented with any message, nor is there any message on the console, the Editor Console, or anywhere else I can find. Where is this information?

Thanks.

I’ve never seen such a debug log message.
its normally going the way that you start out with no stripping and raise it level by level to see how far you can go at least for me

the only case where its well known is the micro core lib, cause if you use that one, using any System.xxx stuff it will have a good chance to fail as only the core libraries from system are present

If I raise it above “Disabled” I get a crash. Now what? Binary chop the whole project to work out which bits work? This makes stripping effectively useless, unless I can test all paths in my project log2(number of functions) times. That can’t be right. It must be a bug.

If it narrows it down, it’s likely a script that is only instantiated through code.

Unity removes unused references, and so while it may be in the Assembly, it’s marked as unused and it’s dependencies can be stripped out. This is true for assets regularly and could be a possible culprit for Scripts as well.

You could try placing it in the Resources Folder, although I have no idea if that would work for scripts, or have a dummy game object that destroys itself at load but contains a reference to all scripts that are fully instantiated through code and non existant at game loadup.

The crashing code is in a script in an empty GameObject at the root level of the game scene. It is not instantiated at run-time.

I found this documentation about the Resources folder. It doesn’t exclude scripts

However, I moved all game scripts into a Resources folder and it had no effect on the SIGBUS.

Thanks for the helpful suggestions though.

Moving them back did make the Unity Editor beachball forever though!