Search Unity

WebGL Exception XML deserialize

Discussion in 'Web' started by MartijnDekker, Mar 25, 2015.

  1. MartijnDekker

    MartijnDekker

    Joined:
    Feb 13, 2015
    Posts:
    8
    Hello folks,

    [edit 2]
    I can confirm this exception gets thrown on every XML deserialize i have (so affects multiple classes), seem to more a generic problem....

    [edit]
    Problem is only on WebGL, all other platforms work as expected.

    I'v been working on this problem for some time now and haven't made any progress.
    In short i get an exception when i try to deserialize an textasset from an assetbundle, but this happens in a weird situation :

    When i make a WebGL build with with exception handling other then none, i get no exception what so ever, all works as expected.

    When i make a WebGL build with no exception handling i get an exception. << thats weird huh

    i'm manually editing the generated .JS file and adding console log at "cxa_throw"
    That way i can extract a stack trace, but that hasn't helped my very much.

    XML Deserialize code :
    Code (CSharp):
    1.  
    2. public static T FromXml<T>(this string xml)
    3.         {
    4.             var s = new XmlSerializer(typeof(T));
    5.             using (var reader = new StringReader(@xml))
    6.             {
    7.                 var obj = s.Deserialize(reader);
    8.                 return (T)obj;
    9.             }
    10.         }
    11.  
    Exception:
    Code (CSharp):
    1. 15:30:14.556 "jsStackTrace@http://172.18.0.122:8080/WebGL/Development/WebGL.js:1000:13
    2. stackTrace@http://172.18.0.122:8080/WebGL/Development/WebGL.js:1017:22
    3. ___cxa_throw@http://172.18.0.122:8080/WebGL/Development/WebGL.js:12660:19
    4. __ZN6il2cpp2vm9Exception5RaiseEP15Il2CppException [il2cpp::vm::Exception::Raise(Il2CppException*)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:78842:3
    5. __ZL30il2cpp_codegen_raise_exceptionP12Exception_t450219 [il2cpp_codegen_raise_exception?0(Exception_t4?5?*)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:3299820:2
    6. __Z49XmlSerializationReaderInterpreter_ReadRoot_m12717P39XmlSerializationReaderInterpreter_t2355P20XmlTypeMapping_t2284P10MethodInfo [XmlSerializationReaderInterpreter_ReadRoot_m12717(XmlSerializationReaderInterpreter_t2355*, XmlTypeMapping_t2284*, MethodInfo*)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:3315800:3
    7. __Z49XmlSerializationReaderInterpreter_ReadRoot_m12714P39XmlSerializationReaderInterpreter_t2355P10MethodInfo [XmlSerializationReaderInterpreter_ReadRoot_m12714(XmlSerializationReaderInterpreter_t2355*, MethodInfo*)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:3315760:10
    8. __Z32XmlSerializer_Deserialize_m12840P19XmlSerializer_t1113P28XmlSerializationReader_t2353P10MethodInfo [XmlSerializer_Deserialize_m12840(XmlSerializer_t1113*, XmlSerializationReader_t2353*, MethodInfo*)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:3324456:9
    9. __ZN16VirtFuncInvoker1IP8Object_tP28XmlSerializationReader_t2353E6InvokeEP10MethodInfoPvS3_ [VirtFuncInvoker1<Object_t*, XmlSerializationReader_t2353*>::Invoke(MethodInfo*, void*, XmlSerializationReader_t2353*)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:3324423:8
    10. __Z32XmlSerializer_Deserialize_m12839P19XmlSerializer_t1113P15XmlReader_t1547P10MethodInfo [XmlSerializer_Deserialize_m12839(XmlSerializer_t1113*, XmlReader_t1547*, MethodInfo*)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:3324312:8
    11. __Z32XmlSerializer_Deserialize_m12838P19XmlSerializer_t1113P16TextReader_t1195P10MethodInfo [XmlSerializer_Deserialize_m12838(XmlSerializer_t1113*, TextReader_t1195*, MethodInfo*)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:3324290:8
    12. __Z47XmlExtensions_FromXml_TisObject_t_m2465_gsharedP8Object_tP8String_tP10MethodInfo [XmlExtensions_FromXml_TisObject_t_m2465_gshared(Object_t*, String_t*, MethodInfo*)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:3673672:9
    13. __Z19Luminaire_Load_m772P8Object_tP16AssetBundle_t203P8String_tS4_P10Action_t28P13Action_1_t14710Vector3_t5P10MethodInfo [Luminaire_Load_m772(Object_t*, AssetBundle_t203*, String_t*, String_t*, Action_t28*, Action_1_t147*, Vector3_t5, MethodInfo*)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:2558509:9
    14. __Z36U3CLoadU3Ec__Iterator5_MoveNext_m763P27U3CLoadU3Ec__Iterator5_t199P10MethodInfo [U3CLoadU3Ec__Iterator5_MoveNext_m763(U3CLoadU3Ec__Iterator5_t199*, MethodInfo*)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:2558845:4
    15. __Z25RuntimeInvoker_Boolean_t9P10MethodInfoPvPS1_ [RuntimeInvoker_Boolean_t9(MethodInfo*, void*, void**)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:3608530:8
    16. __ZN6il2cpp2vm7Runtime6InvokeEP10MethodInfoPvPS4_PP12Il2CppObject [il2cpp::vm::Runtime::Invoke(MethodInfo*, void*, void**, Il2CppObject**)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:98052:8
    17. _il2cpp_runtime_invoke@http://172.18.0.122:8080/WebGL/Development/WebGL.js:31534:8
    18. __Z20il2cpp_invoke_method21ScriptingMethodIl2CppP15ScriptingObjectP18ScriptingArgumentsPP18ScriptingExceptionb [il2cpp_invoke_method(ScriptingMethodIl2Cpp, ScriptingObject*, ScriptingArguments*, ScriptingException**, bool)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:1275404:9
    19. __ZN19ScriptingInvocation6InvokeEPP18ScriptingExceptionb [ScriptingInvocation::Invoke(ScriptingException**, bool)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:1557379:9
    20. __ZN19ScriptingInvocation6InvokeEPP18ScriptingException [ScriptingInvocation::Invoke(ScriptingException**)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:1557328:8
    21. __ZN19ScriptingInvocation6InvokeIbEET_PP18ScriptingException [bool ScriptingInvocation::Invoke<bool>(ScriptingException**)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:1557288:8
    22. __ZN9Coroutine3RunEv [Coroutine::Run()]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:1545458:9
    23. __ZN9Coroutine17ContinueCoroutineEP6ObjectPv [Coroutine::ContinueCoroutine(Object*, void*)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:1545406:3
    24. __ZN12WWWDelayCall8CallbackEP6ObjectPv [WWWDelayCall::Callback(Object*, void*)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:1165397:2
    25. __ZN18DelayedCallManager6UpdateEi [DelayedCallManager::Update(int)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:1237137:10
    26. __Z10PlayerLoopbbP10IHookEvent [PlayerLoop(bool, bool, IHookEvent*)]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:1450092:4
    27. __ZL8mainloopv [mainloop()]@http://172.18.0.122:8080/WebGL/Development/WebGL.js:2487800:2
    28. dynCall_v@http://172.18.0.122:8080/WebGL/Development/WebGL.js:3972530:7
    29. Runtime.dynCall@http://172.18.0.122:8080/WebGL/Development/WebGL.js:281:14
    30. Browser_mainLoop_runner/<@http://172.18.0.122:8080/WebGL/Development/WebGL.js:10388:13
    31. Browser.mainLoop.runIter@http://172.18.0.122:8080/WebGL/Development/WebGL.js:7000:13
    32. Browser_mainLoop_runner@http://172.18.0.122:8080/WebGL/Development/WebGL.js:10384:9
    33. "1 WebGL.js:12660:0
     
    Last edited: Mar 25, 2015
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    My reply from the beta list, copied for public information:

    This means that the code you are using throws an exception. You don't see it if exceptions are enabled, because it is being handled - probably the Xml class you are using is using exceptions internally for flow control.
     
  3. MartijnDekker

    MartijnDekker

    Joined:
    Feb 13, 2015
    Posts:
    8
    Okeuh, seems logical, any way to capture such exceptions ? so that my webGL dont crashes when i disable exception handling? it try the try{}catch{} but that did not help.. .?

    im using standard .net btw:
    using System.Xml;
    using System.Xml.Serialization;
     
  4. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Right now, no. We are looking into ways to make exception handling cheaper (so you can leave it on by default without a performance cost), but I don't have any updates on that right now.