iPad 2 crash on start

Anyone got experience with Unity on iPad 2?

I have a project with a fairly complex (and resource demandig) opening scene that works OK on both iPhone 4 and iPad. Now we're gonna target the iPad 2 and immediately run into problems, the application crashes on start.

The problems started when adding a new object to the scene. I don't think it's a problem with the object itself since I can create a scene with only this object and it deploys nicely on the iPad 2. At first, I thought it be a memory issue (although I can't say the trace below is indicating that), but when tests on an original iPad worked that can't really be the case. Or can it?

So, here's little data from the internal profiler when running on an iPad (please don't laugh at the ridiculous use of resources, we will reduce once we get it going :) ):

draw-call #> 117
tris #> 121915

(The newly added object represents 28 draw calls and ~20k of the tris)

Following is the resulting trace from running on an iPad 2, it's a lot of details but I thought it's better to put it up-front from the beginning.

Is there anyone that can point me in the right direction to solving this?

Thanks in advance!

/Tomas

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x00000001, 0xe7ffdefe
Crashed Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   IMGSGX543GLDriver               0x304bab92 0x304b0000 + 43922
1   IMGSGX543GLDriver               0x304bb266 0x304b0000 + 45670
2   IMGSGX543GLDriver               0x304b3970 0x304b0000 + 14704
3   IMGSGX543GLDriver               0x304b3e58 0x304b0000 + 15960
4   IMGSGX543GLDriver               0x304bc54c 0x304b0000 + 50508
5   GLEngine                        0x363f9bac gleDoDrawDispatchCore + 252
6   GLEngine                        0x3637fcf4 glDrawElements_ACC_Exec + 288
7   OpenGLES                        0x31c66eb2 glDrawElements + 34
8   Parthenon                       0x00bda6e4 DrawInternal(int, int, VertexBufferData const&, ShaderLab::ChannelAssigns const&, void*, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, int, std::map<unsigned long, unsigned long, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, unsigned long> > >*) + 456
9   Parthenon                       0x00bda8e0 GLES2VBO::Draw(ShaderLab::ChannelAssigns const&, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, int, int) + 152
10  Parthenon                       0x00a9cb28 DrawUtil::DrawVBOMeshRaw(VBO&, Mesh&, ShaderLab::ChannelAssigns const&, int, int, unsigned long) + 180
11  Parthenon                       0x00b15f00 MeshRenderer::RenderMultiple(MeshInstanceData const*, unsigned long, ShaderLab::ChannelAssigns const&) + 1872
12  Parthenon                       0x00bf3b28 BatchRenderer::Flush() + 80
13  Parthenon                       0x00be92d0 ForwardShaderRenderLoop::PerformRendering(Light*, RenderTexture*, bool) + 556
14  Parthenon                       0x00bdd594 DoRenderLoop(Camera&, RenderLoop&, RenderingPath, std::vector<SceneSlot*, std::allocator<SceneSlot*> >&, bool) + 688
15  Parthenon                       0x00a8736c Camera::DoRender(void (*)(Camera&, RenderLoop&, std::vector<SceneSlot*, std::allocator<SceneSlot*> >&, Shader*, std::string const&), bool, Shader*, std::string const&) + 276
16  Parthenon                       0x00a87d50 Camera::Render(int, Shader*, std::string const&) + 252
17  Parthenon                       0x00b657fc RenderManager::RenderCameras() + 120
18  Parthenon                       0x00b48428 PlayerLoop(bool, bool) + 1704
19  Parthenon                       0x00ba32c8 UnityPlayerLoop() + 20
20  Parthenon                       0x00004268 -[AppController Repaint] (AppController.mm:832)
21  CoreFoundation                  0x31e56efc -[NSObject(NSObject) performSelector:withObject:] + 16
22  Foundation                      0x30b947a2 __NSThreadPerformPerform + 262
23  CoreFoundation                  0x31ec0a72 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 6
24  CoreFoundation                  0x31ec2758 __CFRunLoopDoSources0 + 376
25  CoreFoundation                  0x31ec34e4 __CFRunLoopRun + 224
26  CoreFoundation                  0x31e53ebc CFRunLoopRunSpecific + 224
27  CoreFoundation                  0x31e53dc4 CFRunLoopRunInMode + 52
28  GraphicsServices                0x303d1418 GSEventRunModal + 108
29  GraphicsServices                0x303d14c4 GSEventRun + 56
30  UIKit                           0x3221cd62 -[UIApplication _run] + 398
31  UIKit                           0x3221a800 UIApplicationMain + 664
32  Parthenon                       0x00006cbc main (main.mm:18)
33  Parthenon                       0x00002e90 start + 32

1 Answer

1

Ok, so I'll be answering my own question, not long after asking it :)

This seems to be a Unity (or GPU?) bug. On iPad 2 (SGX 543 GPU), the combination of Unity lightmapping and fog doesn't work.

Reproducibility:

  1. Create a scene with a camera, a sphere and a light.

  2. Bake the light on the sphere (and remove the light)

  3. Activate fog

  4. Build iOS project (I've only tested armv7...)

  5. Deploy on iPad 2 => Crash!

Removing lightmap OR fog OR GPU (use eg. iPad or iPhone) will make it run.

I will file a bug report with Unity on this.

one more solution: Open the AppController.mm file and find this line: #define USE_OPENGLES20_IF_AVAILABLE 1 change 1 to 0.

Thank you for this, have the same problem for days.