I’m getting a crash on iOS only with a EXC_BAD_ACCESS in WWWConnection.mm UnityReportWWWFailedWithError (Line 163). Error code is NSURLErrorDomain -1002.
bt all in thread 1:
Error
thread #1: tid = 0x23bf77, 0x0000000101467078 fortressfury`UnityReportWWWFailedWithError + 36 at iPhoneWWW.mm:189, queue = ‘com.apple.main-thread’, stop reason = EXC_BAD_ACCESS (code=1, address=0x10000000000000c0)
It seems to be an iOS issue and not me messing up somewhere, but maybe not? Any help would be appreciated.
I’m on Unity 5.1.2f1, XCode 6.4, and targeting iOS 7.0.
Using IL2CPP, .NET 2.0 subset, and stripping level set to Strip Byte code (even though I think stripping is ignored on IL2CPP?)
I have put debug logs EVERYWHERE in my code and have yet to find the moment right before it crashes. Maybe that will lead to more info.
@zrrz did you ever figure this out or find any further clues? Any chance you still have a stack trace you could share?
Not many threads about WWW failures but I wonder if it’s related to crash we’re finding logged from some live devices… Finding it hard to tell form our trace below if the failure was caused by an attempt to access the callback delegate or if the connection itself failed.
@povilas I know it’s not much to go on but do you think these are related problems? Do you think they might be Unity or native in origin? Also what is iPhoneWWW.mm, is that part of compiled Unity code? I can’t find it anywhere and only two references to it on Google. Thanks…
@Iamdain Sorry, I never figured out the reason. This was a function in a custom made google analytics class. I just removed it as it was unnecessary to the game.
Absolutely don’t take my word for it 100% but I think I remember seeing a fix for something similar to this a few months later. Could try upgrading Unity and seeing how that goes.
Thanks very much for that @zrrz , I’ll look into those error codes and see if we can expose that number.
We just tried a number of methods of decompilation on the .a library containing UnityReportWWWFailedWithError and it seems that MAYBE the function was being passed a failed connection message with some data that was in improper form and subsequently caused an exception.
Still at a loss on how we’ll track down the actual triggering source of the error, needle in a haystack as the crash happens on app load when about 7 different plugins init and it’s rare (but consistent for users that experience it) so we haven’t figured out how to reproduce it here.
Can I ask how you managed to isolate google analytics as the cause? Was it easy to reproduce in your case?
Also considering commenting out / blocking / overriding the UnityReportWWWFailedWithError method if we can find a way to do that as it’s a reporting function we don’t currently use.
@Iamdain Unfortunately, I was only able to track it down by debug logging, breakpointing, and going step by step until I found the exact function that broke it, which is what I put above.