Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BootConfig::SetFromParameters runtime crash on ios startup #678

Open
yvz-dmr opened this issue Aug 22, 2022 · 5 comments
Open

BootConfig::SetFromParameters runtime crash on ios startup #678

yvz-dmr opened this issue Aug 22, 2022 · 5 comments
Labels
Build This issue refers to the build configuration and builds failing. help wanted Extra attention is needed ios This issue is specific to the iOS/iPadOS Platform.

Comments

@yvz-dmr
Copy link

yvz-dmr commented Aug 22, 2022

UnityFramework crashes ios application at startup.

Tried with
Flutter version 3.0.5, 3.0.2, 3.0.0,
flutter_unity_widget version 2022.1.7+1, 2022.1.7, 2022.1.1+1, 2022.1.1
Unity version 2021.3.3f1 and 2022.1.7f1 with fuw-2022.1.7f1.unitypackage

Crash logs

Incident Identifier: 980D2B93-8D2B-41EE-A4E9-1943FBC4174C
Hardware Model:      iPhone13,3
Process:             Runner [13964]
Path:                /private/var/containers/Bundle/Application/94650241-4222-4A36-9568-5239A4A4D243/Runner.app/Runner
Version:             0.1.21 (21)
AppStoreTools:       13F100
AppVariant:          1:iPhone13,3:15
Beta:                YES
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]

Date/Time:           2022-08-22 10:17:18.2156 -0500
Launch Time:         2022-08-22 09:52:10.2869 -0500
OS Version:          iPhone OS 15.6 (19G71)
Release Type:        User
Baseband Version:    2.70.01
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes: 0x0000000000000001, 0x0000000000000000
VM Region Info: 0 is not in any region.  Bytes before following region: 4363206656
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                   104114000-104118000 [   16K] r-x/r-x SM=COW  ...er.app/Runner
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [13964]

Triggered by Thread:  0


Kernel Triage:
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage


Thread 0 name:
Thread 0 Crashed:
0   UnityFramework                	0x00000001046a0da0 BootConfig::SetFromParameters(BootConfig::Data&, char const**, unsigned long) + 72 (BootConfigData.cpp:273)
1   UnityFramework                	0x00000001046a07f0 BootConfig::Data::InitFromFile(char const**, unsigned long, char const*) + 272 (BootConfigData.cpp:378)
2   UnityFramework                	0x00000001046a08e4 InitFromFile + 24 (BootConfig.cpp:40)
3   UnityFramework                	0x00000001046a08e4 BootConfig::InitFromFileFormatted(char const**, unsigned long, char const*, ...) + 148 (BootConfig.cpp:61)
4   UnityFramework                	0x0000000104b5ad40 UnityInitRuntime + 156 (LibEntryPoint.mm:140)
5   UnityFramework                	0x00000001045788f4 -[UnityFramework frameworkWarmup:argv:] + 36 (main.mm:76)
6   UnityFramework                	0x0000000104578a2c -[UnityFramework runEmbeddedWithArgc:argv:appLaunchOpts:] + 132 (main.mm:115)
7   flutter_unity_widget          	0x000000010424be2c UnityPlayerUtils.initUnity() + 348 (UnityPlayerUtils.swift:93)
8   flutter_unity_widget          	0x000000010424cf08 closure #2 in UnityPlayerUtils.createPlayer(completed:) + 32 (UnityPlayerUtils.swift:135)
9   flutter_unity_widget          	0x000000010424cfb4 thunk for @escaping @callee_guaranteed () -> () + 20 (<compiler-generated>:0)
10  libdispatch.dylib             	0x00000001be35ae6c _dispatch_call_block_and_release + 32 (init.c:1517)
11  libdispatch.dylib             	0x00000001be35ca30 _dispatch_client_callout + 20 (object.m:560)
12  libdispatch.dylib             	0x00000001be36af48 _dispatch_main_queue_drain + 928 (inline_internal.h:2622)
13  libdispatch.dylib             	0x00000001be36ab98 _dispatch_main_queue_callback_4CF + 44 (queue.c:7770)
14  CoreFoundation                	0x00000001be6ad800 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1795)
15  CoreFoundation                	0x00000001be667704 __CFRunLoopRun + 2532 (CFRunLoop.c:3144)
16  CoreFoundation                	0x00000001be67abc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
17  GraphicsServices              	0x00000001da7e5374 GSEventRunModal + 164 (GSEvent.c:2200)
18  UIKitCore                     	0x00000001c0feeb58 -[UIApplication _run] + 1100 (UIApplication.m:3511)
19  UIKitCore                     	0x00000001c0d70090 UIApplicationMain + 364 (UIApplication.m:5064)
20  Runner                        	0x000000010411b260 main + 64 (AppDelegate.swift:5)
21  dyld                          	0x00000001044d1da4 start + 520 (dyldMain.cpp:879)

Thread 1:
0   libsystem_pthread.dylib       	0x0000000230054e54 start_wqthread + 0 (:-1)

Thread 2:
0   libsystem_pthread.dylib       	0x0000000230054e54 start_wqthread + 0 (:-1)

Thread 3:
0   libsystem_pthread.dylib       	0x0000000230054e54 start_wqthread + 0 (:-1)

Thread 4:
0   libsystem_pthread.dylib       	0x0000000230054e54 start_wqthread + 0 (:-1)

Thread 5 name:
Thread 5:
0   libsystem_kernel.dylib        	0x00000001f62ea4a0 mach_msg_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001f62eaae4 mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                	0x00000001be662d30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                	0x00000001be6671bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000)
4   CoreFoundation                	0x00000001be67abc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   Foundation                    	0x00000001bfe6d444 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236 (NSRunLoop.m:373)
6   Foundation                    	0x00000001bfeaee0c -[NSRunLoop(NSRunLoop) runUntilDate:] + 92 (NSRunLoop.m:420)
7   UIKitCore                     	0x00000001c0f68cc4 -[UIEventFetcher threadMain] + 524 (UIEventFetcher.m:1167)
8   Foundation                    	0x00000001bfebd41c __NSThread__start__ + 808 (NSThread.m:972)
9   libsystem_pthread.dylib       	0x00000002300559ac _pthread_start + 148 (pthread.c:891)
10  libsystem_pthread.dylib       	0x0000000230054e68 thread_start + 8 (:-1)

Thread 6:
0   libsystem_pthread.dylib       	0x0000000230054e54 start_wqthread + 0 (:-1)

Thread 7:
0   libsystem_pthread.dylib       	0x0000000230054e54 start_wqthread + 0 (:-1)

Thread 8 name:
Thread 8:
0   libsystem_kernel.dylib        	0x00000001f62ea4a0 mach_msg_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001f62eaae4 mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                	0x00000001be662d30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                	0x00000001be6671bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000)
4   CoreFoundation                	0x00000001be67abc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   Flutter                       	0x0000000106777f88 0x10646c000 + 3194760
6   Flutter                       	0x000000010677796c 0x10646c000 + 3193196
7   libsystem_pthread.dylib       	0x00000002300559ac _pthread_start + 148 (pthread.c:891)
8   libsystem_pthread.dylib       	0x0000000230054e68 thread_start + 8 (:-1)

Thread 9 name:
Thread 9:
0   libsystem_kernel.dylib        	0x00000001f62ea4a0 mach_msg_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001f62eaae4 mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                	0x00000001be662d30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                	0x00000001be6671bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000)
4   CoreFoundation                	0x00000001be67abc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   Flutter                       	0x0000000106777f88 0x10646c000 + 3194760
6   Flutter                       	0x000000010677796c 0x10646c000 + 3193196
7   libsystem_pthread.dylib       	0x00000002300559ac _pthread_start + 148 (pthread.c:891)
8   libsystem_pthread.dylib       	0x0000000230054e68 thread_start + 8 (:-1)

Thread 10 name:
Thread 10:
0   libsystem_kernel.dylib        	0x00000001f62ea4a0 mach_msg_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001f62eaae4 mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                	0x00000001be662d30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                	0x00000001be6671bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000)
4   CoreFoundation                	0x00000001be67abc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   Flutter                       	0x0000000106777f88 0x10646c000 + 3194760
6   Flutter                       	0x000000010677796c 0x10646c000 + 3193196
7   libsystem_pthread.dylib       	0x00000002300559ac _pthread_start + 148 (pthread.c:891)
8   libsystem_pthread.dylib       	0x0000000230054e68 thread_start + 8 (:-1)

Thread 11 name:
Thread 11:
0   libsystem_kernel.dylib        	0x00000001f62eaf24 __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x000000023005c298 _pthread_cond_wait + 1236 (pthread_cond.c:636)
2   libc++.1.dylib                	0x00000001d74c428c std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (__threading_support:380)
3   Flutter                       	0x0000000106772754 0x10646c000 + 3172180
4   libsystem_pthread.dylib       	0x00000002300559ac _pthread_start + 148 (pthread.c:891)
5   libsystem_pthread.dylib       	0x0000000230054e68 thread_start + 8 (:-1)

Thread 12 name:
Thread 12:
0   libsystem_kernel.dylib        	0x00000001f62eaf24 __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x000000023005c298 _pthread_cond_wait + 1236 (pthread_cond.c:636)
2   libc++.1.dylib                	0x00000001d74c428c std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (__threading_support:380)
3   Flutter                       	0x0000000106772754 0x10646c000 + 3172180
4   libsystem_pthread.dylib       	0x00000002300559ac _pthread_start + 148 (pthread.c:891)
5   libsystem_pthread.dylib       	0x0000000230054e68 thread_start + 8 (:-1)

Thread 13 name:
Thread 13:
0   libsystem_kernel.dylib        	0x00000001f62eaf24 __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x000000023005c298 _pthread_cond_wait + 1236 (pthread_cond.c:636)
2   libc++.1.dylib                	0x00000001d74c428c std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (__threading_support:380)
3   Flutter                       	0x0000000106772754 0x10646c000 + 3172180
4   libsystem_pthread.dylib       	0x00000002300559ac _pthread_start + 148 (pthread.c:891)
5   libsystem_pthread.dylib       	0x0000000230054e68 thread_start + 8 (:-1)

Thread 14 name:
Thread 14:
0   libsystem_kernel.dylib        	0x00000001f62eaf24 __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x000000023005c298 _pthread_cond_wait + 1236 (pthread_cond.c:636)
2   libc++.1.dylib                	0x00000001d74c428c std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (__threading_support:380)
3   Flutter                       	0x0000000106772754 0x10646c000 + 3172180
4   libsystem_pthread.dylib       	0x00000002300559ac _pthread_start + 148 (pthread.c:891)
5   libsystem_pthread.dylib       	0x0000000230054e68 thread_start + 8 (:-1)

Thread 15 name:
Thread 15:
0   libsystem_kernel.dylib        	0x00000001f62eaf24 __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x000000023005c298 _pthread_cond_wait + 1236 (pthread_cond.c:636)
2   libc++.1.dylib                	0x00000001d74c428c std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (__threading_support:380)
3   Flutter                       	0x0000000106772754 0x10646c000 + 3172180
4   libsystem_pthread.dylib       	0x00000002300559ac _pthread_start + 148 (pthread.c:891)
5   libsystem_pthread.dylib       	0x0000000230054e68 thread_start + 8 (:-1)

Thread 16 name:
Thread 16:
0   libsystem_kernel.dylib        	0x00000001f62eaf24 __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x000000023005c298 _pthread_cond_wait + 1236 (pthread_cond.c:636)
2   libc++.1.dylib                	0x00000001d74c428c std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 (__threading_support:380)
3   Flutter                       	0x0000000106772754 0x10646c000 + 3172180
4   libsystem_pthread.dylib       	0x00000002300559ac _pthread_start + 148 (pthread.c:891)
5   libsystem_pthread.dylib       	0x0000000230054e68 thread_start + 8 (:-1)

Thread 17 name:
Thread 17:
0   libsystem_kernel.dylib        	0x00000001f62ebe18 kevent + 8 (:-1)
1   Flutter                       	0x000000010695c000 0x10646c000 + 5177344
2   Flutter                       	0x000000010698a92c 0x10646c000 + 5368108
3   libsystem_pthread.dylib       	0x00000002300559ac _pthread_start + 148 (pthread.c:891)
4   libsystem_pthread.dylib       	0x0000000230054e68 thread_start + 8 (:-1)


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x000000010610ed78   x1: 0x0000000000000000   x2: 0xffffffffffffffff   x3: 0x0000000281b34891
    x4: 0x0000000000000001   x5: 0x000000014186b000   x6: 0x0000000000000033   x7: 0x0000000000000000
    x8: 0x0000000000000000   x9: 0x0000000281b34880  x10: 0x0000000000000880  x11: 0x0000000000000000
   x12: 0x00000000c7c13843  x13: 0x0000000047c13800  x14: 0x0000000047c00000  x15: 0x0000000000000000
   x16: 0x000000023004ca50  x17: 0x00000000000008fd  x18: 0x0000000000000000  x19: 0xffffffffffffffff
   x20: 0x0000000000000000  x21: 0x000000010610ed78  x22: 0x0000000105d65fbe  x23: 0x000000021546b060
   x24: 0x0000000000000000  x25: 0x0000000000000000  x26: 0x0000000000000010  x27: 0x000000000000000f
   x28: 0x0000000002ffffff   fp: 0x000000016bcea510   lr: 0x00000001046a07f0
    sp: 0x000000016bcea4d0   pc: 0x00000001046a0da0     cpsr: 0x1000
   esr: 0x92000006 (Data Abort) byte read Translation fault


Binary Images:
0x104114000 - 0x10411bfff Runner arm64  <6156f9b41e7f3463ace381f29508a1b6> /private/var/containers/Bundle/Application/94650241-4222-4A36-9568-5239A4A4D243/Runner.app/Runner
0x104240000 - 0x104253fff flutter_unity_widget arm64  <8ca78561a19637efb42e56e8d9a01281> /private/var/containers/Bundle/Application/94650241-4222-4A36-9568-5239A4A4D243/Runner.app/Frameworks/flutter_unity_widget.framework/flutter_unity_widget
0x1044b8000 - 0x10450ffff dyld arm64e  <66e1fb2668f8379ba052eb8b8291b5e1> /usr/lib/dyld
0x104560000 - 0x105e2bfff UnityFramework arm64  <ff2c45dc9f5834928f88ef4c226974ad> /private/var/containers/Bundle/Application/94650241-4222-4A36-9568-5239A4A4D243/Runner.app/Frameworks/UnityFramework.framework/UnityFramework
0x10646c000 - 0x106c33fff Flutter arm64  <c25599caa061358c97027de247525350> /private/var/containers/Bundle/Application/94650241-4222-4A36-9568-5239A4A4D243/Runner.app/Frameworks/Flutter.framework/Flutter
0x1be359000 - 0x1be39efff libdispatch.dylib arm64e  <e3ea4f635d11342aaf199f58dbc8e259> /usr/lib/system/libdispatch.dylib
0x1be65c000 - 0x1beab1fff CoreFoundation arm64e  <6b22dd8135853be6bc77ba19810ec0f2> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x1bfe54000 - 0x1c015efff Foundation arm64e  <ee1abaf23d7137fb906715aa79528619> /System/Library/Frameworks/Foundation.framework/Foundation
0x1c0ada000 - 0x1c2377fff UIKitCore arm64e  <137a95aada6d332cbc01e13bb9b6e317> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
0x1d74b7000 - 0x1d751dfff libc++.1.dylib arm64e  <17cea4f6e3933beab8971bf33851a14b> /usr/lib/libc++.1.dylib
0x1da7e4000 - 0x1da7ecfff GraphicsServices arm64e  <a094e7b51d4037c5902756d86988ec4b> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x1f62e9000 - 0x1f631efff libsystem_kernel.dylib arm64e  <9ab02ad0348c30cb99f40979c2d47515> /usr/lib/system/libsystem_kernel.dylib
0x230054000 - 0x23005ffff libsystem_pthread.dylib arm64e  <a8989ffb141439dca1a81534f21923fe> /usr/lib/system/libsystem_pthread.dylib

EOF

[Updated to improve log formatting]

@yvz-dmr
Copy link
Author

yvz-dmr commented Aug 22, 2022

pubspec.yaml

name: mobile_app
description: A new Flutter project.

publish_to: 'none'
version: 1.0.0+1

environment:
  sdk: ">=2.17.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  flutter_unity_widget: ^2022.1.1+1
  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0

flutter:
  uses-material-design: true

The widget that builds UnityWidget

import 'package:flutter/src/foundation/key.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_unity_widget/flutter_unity_widget.dart';

class HomePage extends StatelessWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return UnityWidget(onUnityCreated: (c) {});
  }
}

[Updated to improve formatting]

@CaroloFa
Copy link

CaroloFa commented Dec 16, 2022

I have the same issue. Went through all the steps in the README.
Flutter 3.3.9 • channel stable
flutter_unity_widget version 2022.2.0
Unity version 2022.1.13f1 and 2022.1.7f1 with fuw-2022.1.7f1.unitypackage

@timbotimbo timbotimbo added ios This issue is specific to the iOS/iPadOS Platform. Build This issue refers to the build configuration and builds failing. labels Jan 8, 2023
@timbotimbo
Copy link
Collaborator

@CaroloFa
Are you getting the exact same logs, or just a crash on startup?
Recent crashes on startup are usually caused by the Xcode 14 Thread Performance Checker setting.

Regarding the original issue here, I cannot replicate it by using the mentioned settings.
Just a wild guess but looking at the newer crash, it might be useful to look into Xcode settings as well.

@timbotimbo timbotimbo added the help wanted Extra attention is needed label Jan 8, 2023
@CaroloFa
Copy link

CaroloFa commented Jan 11, 2023

I'm not sure if it was the exact same log anymore, but it was definitely very similar.
I managed to make it work. I guess there was a generel problem with podfile in the workspace setup. Simply disabling the thread performance checker setting was not enough.

I did something like this:

  • run pod update in ios/Pods
  • delete podfiles
  • flutter clean
  • flutter pub get
  • flutter build ios before opening ios/runner.xcworkspace
  • made sure everything was setup correctly according to the readme
  • Did this App crashes on iOS16 with Xcode 14 #703

@konsnos
Copy link

konsnos commented Jul 31, 2024

When this occurred to me it was due to forgetting updating the ios/Runner/AppDelegate.swift file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build This issue refers to the build configuration and builds failing. help wanted Extra attention is needed ios This issue is specific to the iOS/iPadOS Platform.
Projects
None yet
Development

No branches or pull requests

4 participants