Has anyone else encountered problems with VFP/NEON optimisations for mesh skinning on iOS?

(Repost from Unity forums)

Hi all,

I’m seeing random crashes with my Unity app on iOS 5.0 devices (an iPhone 4S and an iPad).

The crash is the result of an EXC_BAD_ACCESS on thread 0. The stack trace shows the following information:

0 app 0x00d38c20 s_SkinVertices4Bones_NEON_loop + 128
1 app 0x00dda040 bool SkinOptimized<(TransformInstruction)3, false, 4, true, false>(SkinMeshInfo&, int) (MeshSkinning.cpp:489)

Unfortunately the debugger is unable to unwind the stack further, so I’m not sure where the call is originating.

My build target platform is Universal arm6 + arm7.

Interestingly, when I switch the target to be arm6 only, the crash does not occur. This is what led me to believe that maybe the problem lies in the Mesh Skinning optimizations.

However, I’m also aware that the problem might be elsewhere in my own code and that it just manifests itself as a crash in the VFP/NEON optimized code. I’ve be working on this assumption for the last 4 or 5 days and have been unable to find any solution, hence my reason for inquiring if anyone is having issues with the optimizations.

If it helps at all, my software versions are as follows:

Unity 3.4.2f3
XCode 4.2 (build 4C199)
iOS SDK 5.0 (9A334)

I would be grateful for any suggestions or insights that anyone has to offer. I realise there isn’t a whole lot of information to go on.

Many thanks,

Damian

We just identified our problem about an hour ago. I’m posting an update for the benefit of anyone who happens to see a similar error in the future.

In our case there was an error in the geometry of one of the meshes we use in the scene. When we replaced this with the geometry from an equivalent model, everything worked fine.

We haven’t identified the error in the model, and we’re probably not going to try. But my guess is that something in the model was causing a buffer overrun in the mesh skinning. When run directly on a device it could sometimes take up to 20 minutes for the crash to occur, but running under XCode with Guard Edges enabled allowed us to detect the crash each time. The crash stopped occurring as soon as we replaced the mesh.