Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Networking UnityWebRequest crashes inside Unity engine (OpenSSL related)

Discussion in '5.4 Beta' started by JJJohan, Jun 20, 2016.

  1. JJJohan

    JJJohan

    Joined:
    Mar 18, 2016
    Posts:
    214
    We've recently been plagued by a series of randomly occurring crashes, causing both the editor and standalone builds to crash, ranging from moments after running our product to at most 20 minutes. This has been a huge cause for concern as it makes our product unsuitable for release and essentially unstable.

    After diagnosing part of the stack trace of a crash dump I found the crash was happening during the SHA1 hashing which occurs within the OpenSSL library that Unity uses. Further tests confirmed that the crashes only happen when processing SSL based URLs which we rely upon almost entirely and we've successfully managed to create a test project to replicate the crash simply by continually performing UnityWebRequest requests.



    Reading further online I've discovered mentions of this happening when OpenSSL is not built properly for threaded usage. We've also noticed that UnityWebRequest is thread-based so this would further confirm that this is the case.

    The bug report (#806394) has the sample project along with a sample crash dump. I was personally unable to replicate the crash on my machine, so it is possible that it is a hardware specific issue (possibly network adapter specific?)

    So far I've found that:
    - on a machine with an Intel Ethernet I217-LM Ethernet Controller it does not crash at all, tested on 2 machines.
    - on a machine with an Atheros AR8151 PCI-E Gigabit Ethernet Controller it crashes very often.

    We have been able to replicate the crash on at least 4 different machines, some under Windows 7, some Windows 10, and varying hardware configurations and belief it is happening on enough machines for this to be a serious issue for anyone that uses the UnityWebRequest API for HTTPS based connections.

    I realise this has to go through the QA cycle but we'd be available for direct contact if necessary when you get to the reproducibility stage.