Determine reason for Xcode crash "std::length_error: basic_string::resize" with Unity-build game?

2

Recently the iPad game I'm developing in Unity started crashing when a particular level was opened. The game itself launches, I can navigate to the offending level, but when I attempt to load the level the following Xcode exception occurs:

libc++abi.dylib: terminating with uncaught exception of type std::length_error: basic_string::resize

I tried adding a breakpoint and get the following additional info: warsides`std::basic_string, stl_allocator >::resize(unsigned long, char) at basic_string.tcc:629:

Since I get no errors within Unity and none of this corresponds to anything in my C# scripts, I am at a loss as to how to track down the issue.

I would appreciate any help in either how to track down where the error is occurring or how to solve it. There is a lot of code and I don't know how to zero in on where/why this started happening.

Thanks!


Edit

The full crash log:

Incident Identifier: 210674A1-10EB-47F4-A6FA-F787C4AEE0B6
CrashReporter Key:   f000ac896ec00a43627ab3130d809476f28d27dd
Hardware Model:      iPad3,1
Process:             warsides [238]
Path:                /var/mobile/Applications/E4D83D50-77BB-4F5A-96EF-A1F0E137575F/warsides.app/warsides
Identifier:          com.vladimirneykov.warsides
Version:             1.0 (1.0)
Code Type:           ARM (Native)
Parent Process:      launchd [1]

Date/Time:           2014-05-12 19:41:14.721 +0200
OS Version:          iOS 7.1.1 (11D201)
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  11

Thread 0:
0   libsystem_kernel.dylib          0x39eeaa58 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x39eea854 mach_msg + 44
2   CoreFoundation                  0x2ed64896 __CFRunLoopServiceMachPort + 150
3   CoreFoundation                  0x2ed63002 __CFRunLoopRun + 850
4   CoreFoundation                  0x2eccdf0a CFRunLoopRunSpecific + 518
5   CoreFoundation                  0x2eccdcee CFRunLoopRunInMode + 102
6   GraphicsServices                0x33bf365e GSEventRunModal + 134
7   UIKit                           0x31619168 UIApplicationMain + 1132
8   warsides                        0x0008bdcc main (main.mm:28)
9   libdyld.dylib                   0x39e47ab4 start + 0

Thread 1:
0   libsystem_kernel.dylib          0x39eea808 kevent64 + 24
1   libdispatch.dylib               0x39e2c078 _dispatch_mgr_invoke + 228
2   libdispatch.dylib               0x39e2bdfe _dispatch_mgr_thread$VARIANT$mp + 34

Thread 2:
0   libsystem_kernel.dylib          0x39eeaaa8 semaphore_wait_trap + 8
1   warsides                        0x01ca1a40 mono_sem_wait + 24
2   warsides                        0x01bfd654 finalizer_thread + 140
3   warsides                        0x01c7d520 start_wrapper + 496
4   warsides                        0x01c9a554 thread_start_routine + 284
5   warsides                        0x01cb66f0 GC_start_routine + 92
6   libsystem_pthread.dylib         0x39f66916 _pthread_body + 138
7   libsystem_pthread.dylib         0x39f66886 _pthread_start + 98
8   libsystem_pthread.dylib         0x39f64aa0 thread_start + 4

Thread 3:
0   libsystem_kernel.dylib          0x39efbf44 __accept + 8
1   warsides                        0x01bbe578 transport_accept + 20
2   warsides                        0x01bbe9a4 debugger_thread + 240
3   warsides                        0x01c9a554 thread_start_routine + 284
4   warsides                        0x01cb66f0 GC_start_routine + 92
5   libsystem_pthread.dylib         0x39f66916 _pthread_body + 138
6   libsystem_pthread.dylib         0x39f66886 _pthread_start + 98
7   libsystem_pthread.dylib         0x39f64aa0 thread_start + 4

Thread 4:
0   libsystem_kernel.dylib          0x39eeaaa8 semaphore_wait_trap + 8
1   warsides                        0x01765480 Semaphore::WaitForSignal() (PlatformSemaphore.h:53)
2   warsides                        0x017d9e30 JobScheduler::WorkLoop(void*) (JobScheduler.cpp:152)
3   warsides                        0x017da9d0 Thread::RunThreadWrapper(void*) (Thread.cpp:40)
4   libsystem_pthread.dylib         0x39f66916 _pthread_body + 138
5   libsystem_pthread.dylib         0x39f66886 _pthread_start + 98
6   libsystem_pthread.dylib         0x39f64aa0 thread_start + 4

Thread 5:
0   libsystem_kernel.dylib          0x39eeaaa8 semaphore_wait_trap + 8
1   warsides                        0x01d09980 algThreadJobQueueThreadFunc + 16
2   libsystem_pthread.dylib         0x39f66916 _pthread_body + 138
3   libsystem_pthread.dylib         0x39f66886 _pthread_start + 98
4   libsystem_pthread.dylib         0x39f64aa0 thread_start + 4

Thread 6:
0   libsystem_kernel.dylib          0x39eeaaa8 semaphore_wait_trap + 8
1   warsides                        0x01765480 Semaphore::WaitForSignal() (PlatformSemaphore.h:53)
2   warsides                        0x0171db78 SubstanceSystem::ThreadMain(void*) (SubstanceSystem.cpp:480)
3   warsides                        0x017da9d0 Thread::RunThreadWrapper(void*) (Thread.cpp:40)
4   libsystem_pthread.dylib         0x39f66916 _pthread_body + 138
5   libsystem_pthread.dylib         0x39f66886 _pthread_start + 98
6   libsystem_pthread.dylib         0x39f64aa0 thread_start + 4

Thread 7:
0   libsystem_kernel.dylib          0x39eeaaa8 semaphore_wait_trap + 8
1   warsides                        0x01a37464 FMOD_OS_Semaphore_Wait(FMOD_OS_SEMAPHORE*) + 16
2   warsides                        0x01a4c2e8 FMOD::Thread::callback(void*) + 60
3   libsystem_pthread.dylib         0x39f66916 _pthread_body + 138
4   libsystem_pthread.dylib         0x39f66886 _pthread_start + 98
5   libsystem_pthread.dylib         0x39f64aa0 thread_start + 4

Thread 8:
0   libsystem_kernel.dylib          0x39eeaa58 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x39eea854 mach_msg + 44
2   AudioToolbox                    0x2e7497f6 AURemoteIO::IOThread::Run() + 102
3   AudioToolbox                    0x2e74c8dc AURemoteIO::IOThread::Entry(void*) + 4
4   AudioToolbox                    0x2e689fc0 CAPThread::Entry(CAPThread*) + 208
5   libsystem_pthread.dylib         0x39f66916 _pthread_body + 138
6   libsystem_pthread.dylib         0x39f66886 _pthread_start + 98
7   libsystem_pthread.dylib         0x39f64aa0 thread_start + 4

Thread 9:
0   libsystem_kernel.dylib          0x39efd544 __semwait_signal + 24
1   libsystem_c.dylib               0x39e6e988 nanosleep + 168
2   libsystem_c.dylib               0x39e6e8d6 usleep + 46
3   warsides                        0x01a371b6 FMOD_OS_Time_Sleep(unsigned int) + 10
4   warsides                        0x01a4c2d2 FMOD::Thread::callback(void*) + 38
5   libsystem_pthread.dylib         0x39f66916 _pthread_body + 138
6   libsystem_pthread.dylib         0x39f66886 _pthread_start + 98
7   libsystem_pthread.dylib         0x39f64aa0 thread_start + 4

Thread 10:
0   libsystem_kernel.dylib          0x39eeaa58 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x39eea854 mach_msg + 44
2   CoreFoundation                  0x2ed64896 __CFRunLoopServiceMachPort + 150
3   CoreFoundation                  0x2ed62fbc __CFRunLoopRun + 780
4   CoreFoundation                  0x2eccdf0a CFRunLoopRunSpecific + 518
5   CoreFoundation                  0x2ed119fe CFRunLoopRun + 94
6   CoreMotion                      0x2f38b3a8 ___lldb_unnamed_function1423$$CoreMotion + 724
7   libsystem_pthread.dylib         0x39f66916 _pthread_body + 138
8   libsystem_pthread.dylib         0x39f66886 _pthread_start + 98
9   libsystem_pthread.dylib         0x39f64aa0 thread_start + 4

Thread 11 Crashed:
0   libsystem_kernel.dylib          0x39efd1f0 __pthread_kill + 8
1   libsystem_pthread.dylib         0x39f67792 pthread_kill + 54
2   libsystem_c.dylib               0x39eadfd8 abort + 72
3   warsides                        0x01bba070 mono_handle_native_sigsegv + 312
4   warsides                        0x01bd6da8 sigabrt_signal_handler + 104
5   libsystem_platform.dylib        0x39f61f90 _sigtramp + 40
6   libsystem_pthread.dylib         0x39f67792 pthread_kill + 54
7   libsystem_c.dylib               0x39eadfd8 abort + 72
8   libc++abi.dylib                 0x391dccd2 abort_message + 70
9   libc++abi.dylib                 0x391f56aa default_terminate_handler() + 194
10  libobjc.A.dylib                 0x3993af86 _objc_terminate() + 226
11  libc++abi.dylib                 0x391f31c4 std::__terminate(void (*)()) + 76
12  libc++abi.dylib                 0x391f2a18 __cxa_throw + 112
13  libstdc++.6.dylib               0x39c7982e std::__throw_length_error(char const*) + 266
14  warsides                        0x0174491c std::basic_string<char, std::char_traits<char>, stl_allocator<char, (MemLabelIdentifier)51, 16> >::resize(unsigned long, char) (basic_string.h:318)
15  warsides                        0x01744884 void StreamedBinaryRead<false>::TransferSTLStyleArray<UnityStr>(UnityStr&, TransferMetaFlags) (SerializeTraits.h:215)
16  warsides                        0x0177d1b4 void TransferScriptData<StreamedBinaryRead<false> >(TransferScriptInstance&, StreamedBinaryRead<false>&) (SerializeTraits.h:207)
17  warsides                        0x0177d630 void TransferScriptData<StreamedBinaryRead<false> >(TransferScriptInstance&, StreamedBinaryRead<false>&) (MonoBehaviourSerialization.h:35)
18  warsides                        0x0177cf90 void MonoBehaviour::TransferWithInstance<StreamedBinaryRead<false> >(StreamedBinaryRead<false>&, MonoObject*, MonoClass*) (MonoBehaviourSerialization.cpp:720)
19  warsides                        0x01776a20 void MonoBehaviour::TransferEngineAndInstance<StreamedBinaryRead<false> >(StreamedBinaryRead<false>&) (MonoBehaviourSerialization.cpp:702)
20  warsides                        0x017761cc MonoBehaviour::VirtualRedirectTransfer(StreamedBinaryRead<false>&) (MonoBehaviourSerialization.cpp:790)
21  warsides                        0x017c4fb0 SerializedFile::ReadObject(int, int, ObjectCreationMode, bool, TypeTree**, bool*, Object**) (SerializedFile.cpp:1327)
22  warsides                        0x017bf208 PersistentManager::LoadFileCompletelyThreaded(std::string const&, int*, int*, int, bool, LoadProgress*) (PersistentManager.cpp:1447)
23  warsides                        0x01764a34 PreloadLevelOperation::Perform() (PreloadManager.cpp:649)
24  warsides                        0x017642bc PreloadManager::Run() (PreloadManager.cpp:231)
25  warsides                        0x017641ec PreloadManager::Run(void*) (PreloadManager.cpp:184)
26  warsides                        0x017da9d0 Thread::RunThreadWrapper(void*) (Thread.cpp:40)
27  libsystem_pthread.dylib         0x39f66916 _pthread_body + 138
28  libsystem_pthread.dylib         0x39f66886 _pthread_start + 98
29  libsystem_pthread.dylib         0x39f64aa0 thread_start + 4

Thread 11 crashed with ARM Thread State (32-bit):
    r0: 0x00000000    r1: 0x00000000      r2: 0x00000000      r3: 0x0a26f1f0
    r4: 0x00000006    r5: 0x0a270000      r6: 0x00000006      r7: 0x0a26f1e8
    r8: 0x073a1e00    r9: 0x3bee1e30     r10: 0x174f13e4     r11: 0x11327f78
    ip: 0x00000148    sp: 0x0a26f1dc      lr: 0x39f67797      pc: 0x39efd1f0
  cpsr: 0x00000010
c#
xcode
unity3d
asked on Stack Overflow May 12, 2014 by VladN • edited May 12, 2014 by VladN

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0