Game crashing frequently on iOS due to shadows
Hi,
I am currently using Unity 5.2.4f1 and have been trying to fix a crash that occurs when built on iOS. I believe it might have to do with shadows considering the crash log refers to shadow culling.cpp and when I disable shadows for the project the crash does not occur. This error happens at random times and usually appears within 5 - 10 minutes of gameplay. Here is the crash log:
Date/Time: 2016-03-03 14:08:41.41 -0800 Launch Time: 2016-03-03 13:55:18.18 -0800 OS Version: iOS 9.2.1 (13D15) Report Version: 105
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0xb6fd033c Triggered by Thread: 5
Filtered syslog: None found
Breadcrumb Trail: (reverse chronological seconds)
398 disable autoplay
412 enable autoplay
414 enable autoplay
415 disable autoplay
793 GC Framework: startAuthenticationForExistingPrimaryPlayer
Global Trace Buffer (reverse chronological seconds): 128.040714 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x19360069) failed
128.320600 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x144234e9) failed
128.433534 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1c33c919) failed
128.540126 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1f9ba0b9) failed
128.540126 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1d3b3ff9) failed
128.625314 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1eca5a49) failed
128.646956 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1c979b39) failed
128.692678 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1476a9a9) failed
128.810316 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1c9ea759) failed
133.007515 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1c9ce6c9) failed
133.924335 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1c9c6d89) failed
133.928240 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1c9c7009) failed
235.859359 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x147476c9) failed
236.194333 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1f5b3b79) failed
236.481125 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x147b1a89) failed
236.625275 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x412e1d09) failed
236.625275 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1c354bc9) failed
236.881113 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x149b5689) failed
236.915302 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x42ceadb9) failed
236.969498 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1eddfb39) failed
237.160048 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1ed818a9) failed
241.505825 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1eb06b79) failed
241.964911 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1ec706c9) failed
241.971646 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1ec71059) failed
362.925319 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1f894759) failed
363.265686 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x42c21cd9) failed
363.553721 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x19278e19) failed
363.685172 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x42daaab9) failed
363.686463 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x190465b9) failed
363.902375 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x147925e9) failed
363.943819 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1b1f0f69) failed
364.005545 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x193d44b9) failed
364.193344 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x193dedb9) failed
369.302403 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1bf63279) failed
369.637993 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1470ce09) failed
370.185043 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1fd88f59) failed
370.355870 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x1bf52f09) failed
370.356383 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x193fa669) failed
370.561711 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x14769669) failed
370.607333 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x41288ce9) failed
370.671841 libsystem_trace.dylib 0x000000002176c6f9 dyld_image_header_containing_address(0x19108a99) failed
Thread 5 name: UnityWorker Thread 5 Crashed: 0 dhtest 0x005b5646 GenerateCombinedDynamicVisibleListJob(CullResults*) (ShadowCulling.cpp:620)
1 dhtest 0x0071311a JobQueue::Exec(JobInfo*, int, int) (JobQueue.cpp:281)
2 dhtest 0x007131fe JobQueue::ExecuteJobFromHighPriorityStack() (JobQueue.cpp:493)
3 dhtest 0x007132aa JobQueue::ProcessJobs(void*, bool*) (JobQueue.cpp:562)
4 dhtest 0x00712d40 JobQueue::WorkLoop(void*) (JobQueue.cpp:579)
5 dhtest 0x00713d0a Thread::RunThreadWrapper(void*) (Thread.cpp:40)
6 libsystem_pthread.dylib 0x2175ac7e _pthread_body + 138
7 libsystem_pthread.dylib 0x2175abf2 _pthread_start + 110
8 libsystem_pthread.dylib 0x21758a08 thread_start + 8
I have also tried removing any GameCenter related actions and logic, but the crash still occurs, which leads me to believe shadows are the culprit. I have one main directional light, that cast hard shadows in realtime. Any help would be greatly appreciated. Thanks!
yes, the default setting is 4 shadow cascades. I'll try a build with no cascades and check the results.
Changing Edit->Project Settings->Quality->Shadow Cascades to "No Cascades" still made the game crash. I recall reading somewhere that shadow cascades values don't matter with mobile ports, and the shadows looked exactly the same when ported with the "No Cascades" value. Appreciate the feedback however :)
I have the same issue. Game crashing because of shadowculling.ccp. I disabled all shadows but the result is same. Still crashing. I use Photon network (PUN+) as 3rd party plugin by the way.
I have 2 maps. One map is singleplayer other is multiplayer. Single player map has no issue but multiplayer crashes.