Search Issue Tracker

Fixed in 2020.1.X

Fixed in 2019.3.X

Votes

42

Found in

2019.2.0f1

2019.3

2020.1

Issue ID

1192963

Regression

No

[WebGL] Using XElement.Load(string uri) causes an uncaught abort exception when using dlopen() dynamic linking in Emscripten

WebGL

-

How to reproduce:
1. Extract the user's attached "WebGLBuild.zip" archive
2. Open "index.html" in a browser
3. Observe the error thrown by the browser

Expected result: the WebGL build runs without throwing an exception
Actual result: an exception is thrown indicating that Emscripten's linking support is needed to use dlopen()

Reproducible with: 2019.2.0f1
Not reproducible with: 2018.4.12f1
Could not test with: 2017.4.33f1, 2019.2.1f1, 2019.2.10f1, 2019.3.0b8, 2020.1.0a9

Note: could not test on 2017.4.33f1 due to an immediate crash upon launching the project. Could not test on versions 2019.2.0a1 through 2019.2.0b10 due to various Console errors. Not reproducible on versions 2019.2.1f1 through 2019.2.10f1 and on the 2019.3 and 2020.1 streams due to the built project not loading (no error is thrown, either).

  1. Resolution Note (fix version 2020.1):

    The issue described in the original report appears when using XElement.Load(string uri) in WebGL build. XElement.Load(string uri) internally a calls System.Net.WebProxy.CreateDefaultProxy, which performs MacOS platform check. This MacOS platform check has been broken in WebGL around 2018.3, causing the mentioned "dlopen()" runtime error. The issue has been fixed in 2020.1.0a19 and the fix has been backported to 2019.3.0f6.

    Note that even though the original issue has been fixed, XElement.Load(string uri) still can not work properly on WebGL. XElement.Load(string uri) relies on xml file being loaded synchronously from the web and therefore internally uses multi-threading functionality which is currently not supported on WebGL. Downloading a file synchronously without multi-threading is also not supported in WebGL because synchronous XMLHttpRequest is currently in a deprecation state. The workaround would be to download the xml file in advance (i.e. using UnityWebRequest) and then parse it directly from the string using XElement.Load(System.IO.TextReader textReader). This workaround also doesn't involve any MacOS platform checks which originally caused the mentioned "dlopen()" error.

    Fixed in 2019.3.0f5, 2020.1.0a19, 2020.2.0a7

Comments (17)

  1. SaeedPrez

    May 08, 2020 17:45

    Hey Unity,

    Can you fix this in 2019.3.x? I'm stuck, if I used 2019.x I get DLOPEN error, if I used 2020.x I get UnityLoader undefined error in my web build :/

  2. Bendixsa

    May 04, 2020 10:48

    Please fix this? This is causing me to have to stay on an older version of Unity.

  3. HellaGoodAudio

    Apr 29, 2020 02:01

    Encountering issue on Unity 2019.3.8f1 when attempting to load webGL on Chrome.

  4. tmczar

    Apr 06, 2020 14:14

    Experiencing same issue in 2019.3.0f6.

  5. rexemre

    Mar 20, 2020 18:34

    is this still not solved?

  6. NorbertAgitive

    Mar 17, 2020 13:45

    We have two versions of Unity: one 2019.1 for building a web application and the other for building a mobile app (there was another bug that blocks us to build mobile on 2019.1 as well) . It's inconvenient and time consuming to switch between versions. We hope you will fix this soon.

  7. tim_lol

    Feb 02, 2020 04:50

    I've been stuck on 2019.1.14 because of this issue. We need this fixed to update!

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.