My demo UnrealEngine4 ios application crashes immediately after launch. At the same time, android build works fine. Here is the crash log:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
VM Region Info: 0 is not in any region. Bytes before following region: 4366614528
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 0000000104454000-000000010a1f0000 [ 93.6M] r-x/r-x SM=COW ...podealUE4Demo
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [5038]
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 UE4Demo 0x0000000106081624 FOutputDevice::LogfImpl+ 29546020 (char16_t const*, ...) + 204
1 UE4Demo 0x00000001060815b8 FOutputDevice::LogfImpl+ 29545912 (char16_t const*, ...) + 96
2 UE4Demo 0x0000000105feff88 FDebug::AssertFailed+ 28950408 (char const*, char const*, int, char16_t const*, ...) + 312
3 UE4Demo 0x0000000105ed5eec FGenericPlatformTime::GetSecondsPerCycle64+ 27795180 () + 244
4 UE4Demo 0x0000000105f17c4c FThreadHeartBeat::Get+ 28064844 () + 464
5 UE4Demo 0x0000000106009bfc FDebug::EnsureFailed+ 29055996 (char const*, char const*, int, char16_t const*, int) + 384
6 UE4Demo 0x000000010600a288 FDebug::OptionallyLogFormattedEnsureMessageReturningFalseImpl+ 29057672 (bool, char const*, char const*, int, char16_t const*, ...) + 116
7 UE4Demo 0x0000000105ef1780 LLMMap<PointerKey, unsigned int, ELLMTag>::Remove+ 27907968 (PointerKey const&) + 464
8 UE4Demo 0x0000000105eefae0 FLLMTracker::TrackFree+ 27900640 (void const*, ELLMTracker, ELLMAllocType) + 112
9 UE4Demo 0x0000000105f1c49c FMemory::Free+ 28083356 (void*) + 200
10 CFNetwork 0x00000001bb945ce0 XTubeManager::~XTubeManager+ 204000 () + 56
11 CFNetwork 0x00000001bb945c28 XTubeManager::~XTubeManager+ 203816 () + 12
12 CFNetwork 0x00000001bb920300 -[__NSURLSessionLocal dealloc] + 48
13 libobjc.A.dylib 0x00000001ba565b9c (anonymous namespace)::AutoreleasePoolPage::pop+ 129948 (void*) + 672
14 libobjc.A.dylib 0x00000001ba54e220 call_load_methods + 732
15 libobjc.A.dylib 0x00000001ba54fe54 load_images + 180
16 dyld 0x000000010e54e390 dyld::notifySingle+ 9104 (dyld_image_states, ImageLoader const*, ImageLoader::InitializerTimingList*) + 444
17 dyld 0x000000010e560314 ImageLoader::recursiveInitialization+ 82708 (ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 440
18 dyld 0x000000010e55f370 ImageLoader::processInitializers+ 78704 (ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 136
19 dyld 0x000000010e55f42c ImageLoader::runInitializers+ 78892 (ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 84
20 dyld 0x000000010e54e6d8 dyld::initializeMainExecutable+ 9944 () + 220
21 dyld 0x000000010e5532a0 dyld::_main+ 29344 (macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 4304
22 dyld 0x000000010e54d044 _dyld_start + 68
The only thing I'm doing on launch is showing a menu widget (which works fine in editor and android).
As I understand from the log, the main problem is outside of my code. It seems like FMemory::Free and other things are just service processes after crash. And I'm pretty sure that there is no my code in the call stack.
It's an -ObjC flag. I have this flag in UE4 project settings, but it seems that these setting has no effect on XCode project. At least for UE4.21.2.
I figured out a solution that worked for me:
System Preferences
Battery
Click Battery on the left-side panel
Uncheck "Automatic Graphics Switching"
Upon starting the epic games launcher again, it worked for me and didn't crash anymore.
Related
I have a MacOS app that was built with the Electron framework.
Its entitlements do not include com.apple.security.app-sandbox.
I am looking for ways to add this entitlement, but without rebuilding the app from source.
It is easy enough with the codesign utility to change the entitlement and re-sign it.
However, when doing so, the app will then crash at launch.
I have gone through this guide, added all the needed entitlements, and added the ElectronTeamId in the Info.plist.
However, the app crashes at launch. Here's what the crash report says :
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_secinit.dylib 0x19cea8154 _libsecinit_appsandbox.cold.5 + 92
1 libsystem_secinit.dylib 0x19cea8140 _libsecinit_appsandbox.cold.5 + 72
2 libsystem_secinit.dylib 0x19cea73d8 _libsecinit_appsandbox + 2044
3 libsystem_trace.dylib 0x1920c8b90 _os_activity_initiate_impl + 64
4 libsystem_secinit.dylib 0x19cea6b88 _libsecinit_initializer + 80
5 libSystem.B.dylib 0x19cebd6c0 libSystem_initializer + 272
6 dyld 0x1048cdf4c invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 164
7 dyld 0x1048f7784 invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 340
8 dyld 0x1048eded8 invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 528
9 dyld 0x1048b9f98 dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 168
10 dyld 0x1048edc80 dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 192
11 dyld 0x1048f71d4 dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 516
12 dyld 0x1048cde8c dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 172
13 dyld 0x1048d4a4c dyld4::PrebuiltLoader::runInitializers(dyld4::RuntimeState&) const + 44
14 dyld 0x1048e32a4 dyld4::APIs::runAllInitializersForMain() + 48
15 dyld 0x1048bddbc dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3136
16 dyld 0x1048bd06c start + 488
I am happy doing any modifications from the outside (i.e. without recompiling the app from source), for example swapping the electron framework by a different one in the app bundle.
Any pointer much appreciated.
I’m getting the following crash when using AVAudioSession with AVAudioEngine. What I don’t understand is why InterruptionListener is listed twice in the stack trace. Does this mean it’s somehow being called again before it has returned? Is this likely to be a concurrency issue?
Crashed: AVAudioSession Notify Thread
0 libEmbeddedSystemAUs.dylib 0x1dbc3333c InterruptionListener(void*, unsigned int, unsigned int, void const*)
1 libEmbeddedSystemAUs.dylib 0x1dbc33270 InterruptionListener(void*, unsigned int, unsigned int, void const*)
2 AudioToolbox 0x1c86e6484 AudioSessionPropertyListeners::CallPropertyListeners(unsigned int, unsigned int, void const*) + 596
3 AudioToolbox 0x1c8740798 HandleAudioSessionCFTypePropertyChangedMessage(unsigned int, unsigned int, void*, unsigned int) + 1144
4 AudioToolbox 0x1c873fec0 ProcessDeferredMessage(unsigned int, __CFData const*, unsigned int, unsigned int) + 2452
5 AudioToolbox 0x1c873f17c ASCallbackReceiver_AudioSessionPingMessage + 632
6 AudioToolbox 0x1c87ad398 _XAudioSessionPingMessage + 44
7 libAudioToolboxUtility.dylib 0x1c8840430 mshMIGPerform + 264
8 CoreFoundation 0x1bd42b174 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
9 CoreFoundation 0x1bd42a880 __CFRunLoopDoSource1 + 444
10 CoreFoundation 0x1bd425634 __CFRunLoopRun + 1888
11 CoreFoundation 0x1bd424ba8 CFRunLoopRunSpecific + 424
12 AVFAudio 0x1ca1f4a2c GenericRunLoopThread::Entry(void*) + 156
13 AVFAudio 0x1ca2457a0 CAPThread::Entry(CAPThread*) + 204
14 libsystem_pthread.dylib 0x1bd1c2d98 _pthread_start + 156
15 libsystem_pthread.dylib 0x1bd1c674c thread_start + 8
I develop app in xcode 6.
And then device connected i run app with debug.
After i can disconnect device from xcode and again run app. And it's runs.
But today begins some problems
i run app with run button in xcode 7 -> app run normally, and work good.
After i disconnect device from my mac, and try run app by press app icon on device and got crash
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000197747270 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001977e516c pthread_kill + 108
2 libsystem_c.dylib 0x00000001976beb14 abort + 108
3 ...g_rt.asan_ios_dynamic.dylib 0x00000001019d56d0 0x101984000 + 333520
4 ...g_rt.asan_ios_dynamic.dylib 0x00000001019c955c 0x101984000 + 283996
5 ...g_rt.asan_ios_dynamic.dylib 0x00000001019ccf28 0x101984000 + 298792
6 ...g_rt.asan_ios_dynamic.dylib 0x00000001019c9640 0x101984000 + 284224
7 ...g_rt.asan_ios_dynamic.dylib 0x00000001019cd0e8 0x101984000 + 299240
8 ...g_rt.asan_ios_dynamic.dylib 0x00000001019bef50 0x101984000 + 241488
9 ...g_rt.asan_ios_dynamic.dylib 0x00000001019c8d18 0x101984000 + 281880
10 dyld 0x0000000120095234 ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 256
11 dyld 0x00000001200953ec ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 32
12 dyld 0x0000000120091688 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 328
13 dyld 0x000000012009161c ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 220
14 dyld 0x00000001200914d8 ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 136
15 dyld 0x00000001200917a0 ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 80
16 dyld 0x0000000120086150 dyld::initializeMainExecutable() + 196
17 dyld 0x00000001200898bc dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 2664
18 dyld 0x0000000120085040 _dyld_start + 64
How to understand what library gives a crash?
Project on ObjectiveC, use CoreData, RestKit, MagicalRecord, FacebookSDK, GoogleSDK, VKSdk, Fabric (Crashlytics and Twitter)
Yeah, it's calls: "Welcome from Apple".
How you know XCode 7 give use new opportunity AddressSenitizer!
So remember DISABLE it's if you want run app without connected device to debug XCode mode.
Hi I've submitted my game to iTunes Connect the other day and unfortunately it got rejected due to the game crashes (it doesn't crash when I'm testing it, even though I used the same iOS version). They gave me the crash log and I've symbolicate it (using the method from here: https://medium.com/#Mrugraj/crash-re-symbolication-5c28d3a3a883) to find the problem and got this:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001964fb270 __pthread_kill + 8
1 libsystem_pthread.dylib 0x000000019659916c pthread_kill + 108
2 libsystem_c.dylib 0x0000000196472b14 abort + 108
3 libsystem_c.dylib 0x0000000196447a38 __assert_rtn + 88
4 Metal 0x0000000186b93b0c MTLReportFailure + 452
5 Metal 0x0000000186b6b24c validateWritePixels + 704
6 AGXMetal 0x0000000105994c44 0x10597c000 + 101444
7 AGXMetal 0x00000001059bc084 0x10597c000 + 262276
8 Metal 0x0000000186b6ce80 -[MTLIOAccelTexture replaceRegion:mipmapLevel:withBytes:bytesPerRow:] + 76
9 HitAndRescue 0x0000000100970208 TexturesMetal::UploadTextureSubData2D(TextureID, unsigned char const*, int, int, int, int, int, TextureFormat, TextureColorSpace) (TexturesMetal.mm:253)
10 HitAndRescue 0x000000010096b4e0 GfxDeviceMetal::UploadTextureSubData2D(TextureID, unsigned char const*, int, int, int, int, int, int, TextureFormat, TextureColorSpace) (GfxDeviceMetal.mm:1722)
11 HitAndRescue 0x000000010091510c TextRenderingPrivate::Font::AddCharacterToTexture(unsigned int, int, unsigned int) (Font.cpp:685)
12 HitAndRescue 0x000000010091564c TextRenderingPrivate::Font::CacheFontForText(unsigned short*, int, int, unsigned int, std::__1::vector<TextRenderingPrivate::TextFormatChange, std::__1::allocator<TextRenderingPrivate::TextFormatChange> >) (Font.cpp:827)
13 HitAndRescue 0x0000000100922c54 TextRenderingPrivate::NativeTextGenerator::Setup() (TextGenerator.cpp:208)
14 HitAndRescue 0x0000000100926db0 TextRenderingPrivate::TextMeshGenerator::Generate() (TextMeshGenerator.cpp:294)
15 HitAndRescue 0x0000000100926c0c TextRenderingPrivate::TextMeshGenerator::Get(UTF16String const&, TextRenderingPrivate::Font*, TextAnchor, TextAlignment, float, float, float, bool, bool, ColorRGBA32, int, int) (TextMeshGenerator.cpp:99)
16 HitAndRescue 0x0000000100911620 TextRenderingModule::TMGenGet(UTF16String const&, TextRendering::Font*, TextAnchor, TextAlignment, float, float, float, bool, bool, ColorRGBA32, int, int) const (TextRenderingModule.cpp:20)
17 HitAndRescue 0x0000000100654798 IMGUI::GetGenerator(RectT<float> const&, GUIContent const&, TextRendering::Font*, TextAnchor, bool, bool, ColorRGBA32, int, int, ImagePosition) (IMGUIUtils.cpp:77)
18 HitAndRescue 0x0000000100650db4 GUIStyle::GetGenerator(RectT<float> const&, GUIContent&) const (GUIStyle.cpp:598)
19 HitAndRescue 0x000000010065108c GUIStyle::CalcSize(GUIContent&) const (GUIStyle.cpp:435)
20 HitAndRescue 0x000000010095f604 GUIStyle_CUSTOM_Internal_CalcSize(void*, ScriptingObject*, Vector2fIcall*) (GUIStyleBindings.gen.cpp:660)
21 HitAndRescue 0x0000000100238490 GUIStyle_CalcSize_m2752 (Bulk_UnityEngine_0.cpp:17509)
22 HitAndRescue 0x0000000100066c10 GUIHelper_GetSuggestedFontSizeFull_m1719 (Bulk_Assembly-CSharp_0.cpp:33257)
23 HitAndRescue 0x00000001000a8f84 SignupScreen_InitLayoutVariable_m2399 (Bulk_Assembly-CSharp_1.cpp:23558)
24 HitAndRescue 0x00000001000a5e2c SignupScreen__ctor_m2394 (Bulk_Assembly-CSharp_1.cpp:23316)
25 HitAndRescue 0x00000001000a5b70 LoginScreen_Start_m2349 (Bulk_Assembly-CSharp_1.cpp:21572)
26 HitAndRescue 0x00000001003c2da4 RuntimeInvoker_Void_t189(MethodInfo const*, void*, void**) (GeneratedInvokers.cpp:12)
27 HitAndRescue 0x0000000100dd09e0 il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppObject**) (Runtime.cpp:299)
28 HitAndRescue 0x00000001006d4f24 ScriptingInvocation::Invoke(ScriptingException**, bool) (ScriptingInvocation.cpp:128)
29 HitAndRescue 0x00000001006cf1c4 MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethodIl2Cpp, ScriptingObject*, ScriptingException**) (MonoBehaviour.cpp:844)
30 HitAndRescue 0x00000001006cf710 MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethodIl2Cpp, ScriptingObject*) (MonoBehaviour.cpp:926)
31 HitAndRescue 0x00000001006ce6bc MonoBehaviour::DoGUI(MonoBehaviour::GUILayoutType, int) (MonoBehaviour.cpp:358)
32 HitAndRescue 0x000000010064cd64 GUIManager::DoGUIEvent(InputEvent&, bool) (GUIManager.cpp:315)
33 HitAndRescue 0x000000010064d2b4 GUIManager::SendQueuedEvents() (GUIManager.cpp:142)
34 HitAndRescue 0x0000000100683d68 PlayerLoop(bool, bool, IHookEvent*) (Player.cpp:1829)
35 HitAndRescue 0x0000000100487024 UnityPlayerLoopImpl(bool) (LibEntryPoint.mm:235)
36 HitAndRescue 0x000000010000b47c UnityRepaint (UnityAppController+Rendering.mm:246)
37 HitAndRescue 0x000000010000b2e0 __51-[UnityAppController(Rendering) repaintDisplayLink]_block_invoke (UnityAppController+Rendering.mm:52)
38 libdispatch.dylib 0x00000001963b5990 _dispatch_call_block_and_release + 20
39 libdispatch.dylib 0x00000001963b5950 _dispatch_client_callout + 12
40 libdispatch.dylib 0x00000001963ba208 _dispatch_main_queue_callback_4CF + 1604
41 CoreFoundation 0x000000018411f7f4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
42 CoreFoundation 0x000000018411d89c __CFRunLoopRun + 1488
43 CoreFoundation 0x00000001840492d0 CFRunLoopRunSpecific + 392
44 GraphicsServices 0x000000018d9776f8 GSEventRunModal + 164
45 UIKit 0x0000000188c46f3c UIApplicationMain + 1484
46 HitAndRescue 0x00000001000055d0 main (main.mm:40)
47 libdyld.dylib 0x00000001963e2a04 start + 0
There are other threads but the one that crashed was this one so I'm posting only posting this. The part that hints crashed seems to be no4; "MTLReportFailure" but I can't find much info on it, while the last of my function being called seems to be on no22; "GetSuggestedFontSizeFull".
Can anybody help me, which one is the cause here? If it's the Metal's function, how can I fixed that (I'm developing with Unity3D)?
Edit:
So I've tested the game after installing it through TestFlight since this should make sure that I'm using the same exact thing as Apple's tester. And the game still didn't crash (I removed the game from the device first before installing it through TestFlight). So I'm totally not sure what to do now.
I have this crasher which happens a lot in our production app but we are not able to reproduce it. It happened only on iOS8 using iOS8 SDK.
HTTPReadFilter::doPlainRead(StreamReader*, unsigned char*, long, CFStreamError*, unsigned char*) inside CFNetwork. Crashed: com.apple.NSURLConnectionLoader EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x00000000
StackTrace:
libsystem_platform.dylib
_platform_memmove + 185
CFNetwork
HTTPReadFilter::doPlainRead(StreamReader*, unsigned char*, long, CFStreamError*, unsigned char*) + 178
CFNetwork
HTTPReadFilter::_streamImpl_Read(unsigned char*, long, CFStreamError*, unsigned char*) + 394
CFNetwork
CoreStreamBase::_streamInterface_Read(unsigned char*, long) + 98
CFNetwork
HTTPNetStreamInfo::_streamImpl_Read(__CFReadStream*, unsigned char*, long, CFStreamError*, unsigned char*) + 306
CFNetwork
CFNetworkReadStream::httpStreamRead(__CFReadStream*, unsigned char*, long, CFStreamError*, unsigned char*, void*) + 44
CoreFoundation
CFReadStreamRead + 328
CFNetwork
HTTPNetStreamInfo::_readStreamClientCallBack(__CFReadStream*, unsigned long) + 128
CFNetwork
CFNetworkReadStream::_readStreamClientCallBackCallBack(__CFReadStream*, unsigned long, void*) + 38
CoreFoundation
_signalEventSync + 146
CoreFoundation
_cfstream_shared_signalEventSync + 342
CoreFoundation
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
CoreFoundation
CFRunLoopRunInMode + 106
CFNetwork
+[NSURLConnection(Loader) _resourceLoadLoop:] + 486
Foundation
__NSThread__main__ + 1118
libsystem_pthread.dylib
_pthread_start + 118
Any help is greatly appreciated!!
That seems to be really an iOS 8 bug. Try to not set a custom size for your NSURLCache. Check this https://devforums.apple.com/message/1102182#1102182