Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMesh Pro TextMeshPro IOS .net 4x IL2CPP infinite EXC_BAD_ACCESS exception

Discussion in 'UGUI & TextMesh Pro' started by oscar_goldman, Oct 9, 2018.

  1. oscar_goldman

    oscar_goldman

    Joined:
    Sep 29, 2016
    Posts:
    10
    We are trying to update our project to .net 4x runtime, API level .net 4x and IL2CPP backend compilation. When running our project in debug mode on a device, we are hitting an exception we haven't seen in any other configuration.
    We are seeing the same error using 2018.2.11f1 and the most recent beta 2018.3.0b4.
    screenshot.jpg

    Any help would be really appreciated on this.
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What version of TMP are you using?
     
  3. oscar_goldman

    oscar_goldman

    Joined:
    Sep 29, 2016
    Posts:
    10
    we've tried both 1.2.4 and 1.3.0 via the package manager. same error.
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    That error only occurs in Debug mode?
     
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    That is good to know.
     
  6. oscar_goldman

    oscar_goldman

    Joined:
    Sep 29, 2016
    Posts:
    10
    actually just checked and we got the exception again in ios12, some confusion amongst our developers.
     
  7. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Are you able to submit a bug report about this along with project to reproduce this?

    This appears to be IL2CPP specific so we will need the IL2CPP folks at Unity to take a look at this.
     
  8. oscar_goldman

    oscar_goldman

    Joined:
    Sep 29, 2016
    Posts:
    10
    I just testing an empty project with only one text mesh pro text object added to the scene. Using IL2CPP and .net 4 runtime and api compatibility, there is a runtime error thrown using the most current beta 2018.3.05b. It's not the same runtime error though we're seeing in our own project.

    2018-10-15 13:50:17.481327-0400 TMPTest[821:577270] [DYMTLInitPlatform] platform initialization successful
    2018-10-15 13:50:17.706598-0400 TMPTest[821:577111] Built from '2018.3/staging' branch, Version '2018.3.0b5 (01088ee0a3a8)', Build type 'Development', Scripting Backend 'il2cpp'
    2018-10-15 13:50:17.724565-0400 TMPTest[821:577111] -> registered mono modules 0x1038ce200
    -> applicationDidFinishLaunching()
    PlayerConnection initialized from /var/containers/Bundle/Application/6C7656FE-778F-48B0-A24B-1DE816A9A70B/TMPTest.app/Data (debug = 0)
    PlayerConnection initialized network socket : 0.0.0.0 55000
    Multi-casting "[IP] 192.168.86.24 [Port] 55000 [Flags] 3 [Guid] 1263653673 [EditorId] 690684066 [Version] 1048832 [Id] iPhonePlayer(Dans-iPad):56000 [Debug] 1 [PackageName] iPhonePlayer" to [225.0.0.222:54997]...
    Waiting for connection from host on [0.0.0.0:55000]...
    Timed out. Continuing without host connection.
    Started listening to [0.0.0.0:55000]
    PlayerConnection already initialized - listening to [0.0.0.0:55000]
    2018-10-15 13:50:23.616852-0400 TMPTest[821:577111] Metal GPU Frame Capture Enabled
    2018-10-15 13:50:23.618038-0400 TMPTest[821:577111] Metal API Validation Disabled
    2018-10-15 13:50:23.866901-0400 TMPTest[821:577111] [Warning] Trying to set delaysTouchesBegan to NO on a system gate gesture recognizer - this is unsupported and will have undesired side effects
    -> applicationDidBecomeActive()
    GfxDevice: creating device client; threaded=1
    Initializing Metal device caps: Apple A7 GPU
    Initialize engine version: 2018.3.0b5 (01088ee0a3a8)
    2018-10-15 13:50:24.338279-0400 TMPTest[821:577336] [avas] AVAudioSessionPortImpl.mm:56:ValidateRequiredFields: Unknown selected data source for Port Speaker (type: Speaker)
    2018-10-15 13:50:24.341240-0400 TMPTest[821:577336] [avas] AVAudioSessionPortImpl.mm:56:ValidateRequiredFields: Unknown selected data source for Port Speaker (type: Speaker)
    UnloadTime: 14.370625 ms
    2018-10-15 13:50:27.216320-0400 TMPTest[821:577111] Uncaught exception: NSInvalidArgumentException: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]
    (
    0 CoreFoundation 0x000000018be06f10 <redacted> + 252
    1 libobjc.A.dylib 0x000000018afd4a40 objc_exception_throw + 56
    2 CoreFoundation 0x000000018bd7c85c _CFArgv + 0
    3 CoreFoundation 0x000000018bcf5a44 <redacted> + 284
    4 CoreFoundation 0x000000018bcef1a8 <redacted> + 52
    5 TMPTest 0x00000001018ce7a0 get_Alldata + 128
    6 TMPTest 0x00000001023418d0 PlatformInfoDispatcher_ReportAnalyticsData_m87A1A2582357F9B813ECA796A1A96E8EC15711DC + 340
    7 TMPTest 0x0000000102343ec0 PlatformInfoInitialization_OnRuntimeInitializeOnLoad_mB2D0B65CCCDE0F92AEFBD4A64B46B7B8B506098C + 396
    8 TMPTest 0x00000001009144d8 _Z66RuntimeInvoker_FalseVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017PFvvEPK10MethodInfoPvPS4_ + 20
    9 TMPTest 0x00000001018913c0 _ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException + 108
    10 TMPTest 0x0000000101211030 _Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb + 100
    11 TMPTest 0x000000010121b4d4 _ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb + 92
    12 TMPTest 0x0000000100ffb5e0 _ZN30RuntimeInitializeOnLoadManager23ExecuteInitializeOnLoadENSt3__16vectorIi13stl_allocatorIiL18MemLabelIdentifier13ELi16EEEE + 236
    13 TMPTest 0x0000000100ffb484 _ZN30RuntimeInitializeOnLoadManager23ExecuteInitializeOnLoadE25RuntimeInitializeLoadType + 116
    14 TMPTest 0x0000000101021438 _ZN18LoadSceneOperation19IntegrateMainThreadEv + 336
    15 TMPTest 0x00000001010225bc _ZN14PreloadManager26UpdatePreloadingSingleStepENS_21UpdatePreloadingFlagsEi + 316
    16 TMPTest 0x0000000101022e4c _ZN14PreloadManager16UpdatePreloadingEv + 288
    17 TMPTest 0x00000001014a3850 _ZL19UnityPlayerLoopImplb + 120
    18 TMPTest 0x0000000100885298 UnityRepaint + 140
    19 TMPTest 0x0000000100885184 -[UnityAppController(Rendering) repaintDisplayLink] + 88
    20 GPUToolsCore 0x000000010914d66c -[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 176
    21 QuartzCore 0x00000001902bc574 <redacted> + 828
    22 IOKit 0x000000018c06658c IODispatchCalloutFromCFMessage + 488
    23 CoreFoundation 0x000000018bd6e3e4 <redacted> + 188
    24 CoreFoundation 0x000000018bd95c30 <redacted> + 56
    25 CoreFoundation 0x000000018bd9537c <redacted> + 440
    26 CoreFoundation 0x000000018bd90134 <redacted> + 2140
    27 CoreFoundation 0x000000018bd8f5b8 CFRunLoopRunSpecific + 436
    28 GraphicsServices 0x000000018e003584 GSEventRunModal + 100
    29 UIKitCore 0x00000001b8568bc8 UIApplicationMain + 212
    30 TMPTest 0x000000010087d4c0 main + 160
    31 libdyld.dylib 0x000000018b84fb94 <redacted> + 4
    )
    2018-10-15 13:50:27.219377-0400 TMPTest[821:577111] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'
    *** First throw call stack:
    (0x18be06ef8 0x18afd4a40 0x18bd7c85c 0x18bcf5a44 0x18bcef1a8 0x1018ce7a0 0x1023418d0 0x102343ec0 0x1009144d8 0x1018913c0 0x101211030 0x10121b4d4 0x100ffb5e0 0x100ffb484 0x101021438 0x1010225bc 0x101022e4c 0x1014a3850 0x100885298 0x100885184 0x10914d66c 0x1902bc574 0x18c06658c 0x18bd6e3e4 0x18bd95c30 0x18bd9537c 0x18bd90134 0x18bd8f5b8 0x18e003584 0x1b8568bc8 0x10087d4c0 0x18b84fb94)
    libc++abi.dylib: terminating with uncaught exception of type NSException
    (lldb)
     
  9. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    As per my previous post, can you submit a bug report on this so we can have the IL2CPP team (scripting team) take a look.
     
  10. oscar_goldman

    oscar_goldman

    Joined:
    Sep 29, 2016
    Posts:
    10
    k. bug has been posted.
     
    Stephan_B likes this.
  11. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you provide me with the case # and I'll pass it along to the IL2CPP team.
     
  12. oscar_goldman

    oscar_goldman

    Joined:
    Sep 29, 2016
    Posts:
    10

    1091085
     
  13. xLeo

    xLeo

    Joined:
    Sep 21, 2010
    Posts:
    191
    The exact same issue is happening to us.

    It happens only on Debug builds.
    Testing on:
    • Xcode v10.0.0 (10A255)
    • MacOS High Sierra v10.13.6.
    • Unity v2018.2.12f1
    • iPad Mini 2, iOS v11.4.1 (15G77)
     
  14. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    322
    I also have the exact same problem! My game fails on launch with

    Code (csharp):
    1. attempt to insert nil object from objects[0]
     
  15. oscar_goldman

    oscar_goldman

    Joined:
    Sep 29, 2016
    Posts:
    10
    Any news on this issue? Anybody have any luck building for debug on ios using IL2CPP and TextMeshPro?
     
  16. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I checked internally and this should be fixed in the latest 2018.3 release.

    Please verify on your end and let me know if you still have this issue.
     
  17. Atrixx

    Atrixx

    Joined:
    Feb 8, 2012
    Posts:
    24
    I have been battling with this issue also, I just updated my project to 2018.3.0b11 and can confirm that the bug is still present. I am able to reproduce this issue whenever running the project as a Debug build.
     
  18. oscar_goldman

    oscar_goldman

    Joined:
    Sep 29, 2016
    Posts:
    10
    Any update on this? I've updated both bugs I entered with the latest exception thrown in xcode. Still can't get past this issue and debug our ios release.
     
  19. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    @Stephan_B Sorry to bump this old thread, but our latest test build on iOS using Unity 2018.4.22f1 and TextMeshPro 1.4.1 causes a hard crash with this same error. We are building with the latest Xcode release for iOS 13.5.

    Notably for us, the game runs perfectly fine, then always crashes at the exact same point. In our case we have a prefab object that is disabled (with TMPro components) when the scene starts. When it is enabled, the crash happens.

    There are other objects throughout our game that are disabled and enabled in this manner with TMPro components - so it's not clear why it's happening in this particular instance.

    Is there any light you could shine on this?

    Thanks!
     
  20. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Please test with release 1.5.0-preview.13 as this issue should have been resolved. The issue was the result of too many recursions most of the time related to the use to auto-size.
     
    flashframe likes this.
  21. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    Thanks @Stephan_B - I'll try it. Is that version safe to use in a released game?
     
  22. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Give this version a good spin / test cycle but it should be good. Be sure to review the release notes and report any issues.

    Be sure to update to TMP Essential Resources as they contain updated shaders.

    P.S. There are two issues that will be addressed in the next release which will be Preview 14 which are as follows

    The following two issues will be addressed in Preview 14.
     
  23. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    Thanks Stephan. I may try to work out why this particular prefab is causing the crash first. Now I know it could be to do with auto-size that helps. Just worried about updating and having to extensively QA the entire game.

    Appreciate your help!
     
  24. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Auto-size in conjunction with line spacing adjustment in the auto-size options would further contribute to this if you are using the line spacing adjustment option.
     
    flashframe likes this.
  25. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    @Stephan_B It was the combination of auto-size and line spacing adjustment causing the crash in this case. Should I avoid using line spacing adjustment completely?
     
  26. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    In the previous version of the TMP package, auto-size and some of the Overflow modes required the use of Recursion which I completely removed in the latest releases where the latest is Preview 13 which is available for Unity 2018.4, 2019.x and 2020.x.

    With those newer releases, you can use all those features.