Search Unity

[IL2CPP] iOS crash : EXC_BAD_ACCESS using UnityWebRequest

Discussion in 'iOS and tvOS' started by beQr86, Jun 20, 2016.

  1. beQr86

    beQr86

    Joined:
    Jul 2, 2015
    Posts:
    21
    Hi there,

    Since Apple obliged everyone to be IPv6 ready we had to update unity and get the UnityWebRequest to handle all of our networking logic for our actually published game. After going through the different patch releases since the start of the month (the 5.3.5 p2, p3 and p4) and specially the p4 that claimed to be fixing the issue : 800964 we still got a very high amount of players reporting crashes that we also observed during our testings.

    The game crashes right after launching/loading the first scene where we run network communication for identification and initialisations. Its exactly happens after the function "CompleteContent", of our implementation of "DownloadHandlerScript", gets called and finishes executing.

    Our issue is strongly related to the one already reported and that should be fixed : 800964 and 796163
    The our bug report number is : 807267

    Thank you for your help.


    Unity 5.3.5p4 / iOS / IL2CPP
    Xcode 7.3
     

    Attached Files:

  2. christophergoy

    christophergoy

    Joined:
    Sep 16, 2015
    Posts:
    735
    Hey @beQr86,
    Thanks for reporting this. I can look into this. I think the CompleteContent functionality was touched recently. So it may be related. Sorry for the inconvenience!
    Cheers,
    Chris
     
  3. beQr86

    beQr86

    Joined:
    Jul 2, 2015
    Posts:
    21
    This is great news ! Thank you
     
  4. christophergoy

    christophergoy

    Joined:
    Sep 16, 2015
    Posts:
    735
    Hi @beQr86,
    Is there any chance you could send me your script that sets up your DownloadHandlerScript/WebRequest instance? Or a snippet to help me create a repro project?
    Thanks,
    Chris
     
  5. HaimBendanan

    HaimBendanan

    Joined:
    May 10, 2016
    Posts:
    28
    @christophergoy I know it s an old thread but did you solved this issue? Have a .similar problem
     
  6. HaimBendanan

    HaimBendanan

    Joined:
    May 10, 2016
    Posts:
    28
    Here are some logs of my crash, running 2017.3.0f3 on an iOS device (ipad)
    The error happen when sending logs with unitywebrequest
    The app crash because of that, didnt happened with 2017.1

    assembly:
    0x105476e18 <+60>: blr x8
    -> 0x105476e1c <+64>: ldr x8, [x19, #0xe0] . BackgroundWorker (32): EXC_BAD_ACCESS (code=257, address=0x41)
    0x105476e20 <+68>: cbnz x8, 0x105476e00 ; <+36> [inlined] back + 4 at UnityWebRequestProto.h:204
    0x105476e24 <+72>: add x0, sp, #0x8 ; =0x8
    0x105476e28 <+76>: bl 0x104eca988 ; ::~AutoLock() at Mutex.h:30
    0x105476e2c <+80>: mov x0, x19
    0x105476e30 <+84>: bl 0x1054776d0 ; ::Release() at UnityWebRequestProto.h:353
    0x105476e34 <+88>: b 0x105476e40 ; <+100> at UnityWebRequestProto.h:219
    0x105476e38 <+92>: add x0, sp, #0x8 ; =0x8
    0x105476e3c <+96>: bl 0x104eca988 ; ::~AutoLock() at Mutex.h:30

    output window:
    2017-12-31 23:31:24.970507+0200 vixeo[5668:3311942] TIC TCP Conn Failed [34:0x1c4574340]: 1:50 Err(50)


    2017-12-31 23:31:24.971885+0200 vixeo[5668:3311942] Task <5731C406-9933-417A-B2CA-B2F8940CDCE0>.<0> HTTP load failed (error code: -1009 [1:50])

    2017-12-31 23:31:24.972079+0200 vixeo[5668:3312120] NSURLConnection finished with error - code -1009


     
  7. s_s_k

    s_s_k

    Joined:
    May 3, 2015
    Posts:
    1
    Same crash log from unity 2017.3.1p1.
    Can be reproduced by:
    1. enable ios ATS
    2. Send webrequest with 'http' anyurl.
    3. Retry webrequest to the same url after get ATS pocy error -1022.

    <pre>
    xxxxxxxxxxxxx`::Job_ExecuteUnityWebRequest():
    0x10565fab4 <+0>: stp x20, x19, [sp, #-0x20]!
    0x10565fab8 <+4>: stp x29, x30, [sp, #0x10]
    0x10565fabc <+8>: add x29, sp, #0x10 ; =0x10
    0x10565fac0 <+12>: sub sp, sp, #0x10 ; =0x10
    0x10565fac4 <+16>: mov x19, x0
    0x10565fac8 <+20>: add x0, x19, #0x118 ; =0x118
    0x10565facc <+24>: str x0, [sp, #0x8]
    0x10565fad0 <+28>: bl 0x10520ed5c ; ::Lock() at Mutex.cpp:60
    0x10565fad4 <+32>: ldr x8, [x19, #0x108]
    0x10565fad8 <+36>: sub x9, x8, #0x1 ; =0x1
    0x10565fadc <+40>: ldr x8, [x19, #0xf0]
    0x10565fae0 <+44>: ldr x8, [x8, x9, lsl #3]
    0x10565fae4 <+48>: str x9, [x19, #0x108]
    0x10565fae8 <+52>: cbz x8, 0x10565fb10 ; <+92> [inlined] ~AutoLock at UnityWebRequestProto.h:216
    0x10565faec <+56>: mov x0, x19
    0x10565faf0 <+60>: blr x8
    -> 0x10565faf4 <+64>: ldr x8, [x19, #0x108]
    0x10565faf8 <+68>: cbnz x8, 0x10565fad8 ; <+36> [inlined] back + 4 at UnityWebRequestProto.h:204
    0x10565fafc <+72>: add x0, sp, #0x8 ; =0x8
    0x10565fb00 <+76>: bl 0x104e15bb0 ; ::~AutoLock() at Mutex.h:30
    0x10565fb04 <+80>: mov x0, x19
    0x10565fb08 <+84>: bl 0x1056603f8 ; ::Release() at UnityWebRequestProto.h:353
    0x10565fb0c <+88>: b 0x10565fb18 ; <+100> at UnityWebRequestProto.h:219
    0x10565fb10 <+92>: add x0, sp, #0x8 ; =0x8
    0x10565fb14 <+96>: bl 0x104e15bb0 ; ::~AutoLock() at Mutex.h:30
    0x10565fb18 <+100>: sub sp, x29, #0x10 ; =0x10
    0x10565fb1c <+104>: ldp x29, x30, [sp, #0x10]
    0x10565fb20 <+108>: ldp x20, x19, [sp], #0x20
    0x10565fb24 <+112>: ret
    0x10565fb28 <+116>: mov x19, x0
    0x10565fb2c <+120>: add x0, sp, #0x8 ; =0x8
    0x10565fb30 <+124>: bl 0x104e15bb0 ; ::~AutoLock() at Mutex.h:30
    0x10565fb34 <+128>: mov x0, x19
    0x10565fb38 <+132>: bl 0x105bed924 ; symbol stub for: _Unwind_Resume
    </pre>

    Anyway, this crash seems to be fixed in 2018.2, and will be back ported to 2017.4.x.
    https://fogbugz.unity3d.com/default.asp?1020451_tjom5fclu25evsg2