Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

WebGL Player Broken, Chrome v86.0.4240.75 (Oct.'20), "Atomics.wake not a function."

Discussion in 'WebGL' started by stonstad, Oct 9, 2020.

  1. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    231
    Heads up —

    Chrome (v86.0.4240.75 released 10/6/2020) is throwing a fatal error "exception thrown: TypeError: Atomics.wake is not a function,TypeError: Atomics.wake is not a function" on Unity WebGL players. This fatal error does not affect versions of Chrome earlier than 10/6/2020.

    Code (CSharp):
    1. Full Error:
    2. exception thrown: TypeError: Atomics.wake is not a function,TypeError: Atomics.wake is not a function
    3. at _emscripten_futex_wake (https://customerselectunitysvcs.blob.core.windows.net/bugreporting/bug01/Build/Build.framework.js.gz:8:228642)
    4. at https://customerselectunitysvcs.blob.core.windows.net/bugreporting/bug01/Build/Build.wasm.gz:wasm-function[26900]:0x6f33be
    5. at _emscripten_current_thread_process_queued_calls
    The error affects only the latest public release of Chrome. Older versions of Chrome and Edge are OK. This likely affects you if WASM threading is enabled (for async/await).

    Repro
    URL: https://customerselectunitysvcs.blob.core.windows.net/bugreporting/bug01/index.html
    Unity Case 1283961
     
  2. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    419
    Thanks, yeah, the function got renamed from Atomics.wake to Atomics.notify, but we are still on an older compiler version that does not have the rename. This can be hotfixed by finding library_pthread.js in the Unity subdirectories and renaming Atomics.wake there to Atomics.notify inside function emscripten_futex_wake.
     
  3. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    231
    Thank you @jukka_j

    For a production application we will need to switch behavior based on the version of Chrome. Does Unity have a hotfix which can work for both Chrome versions -- current and prior to the 10/6 update?
     
  4. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    419
    I doubt you'll need to support a version of Chrome that does not have Atomics.notify(). For a good while now Chrome and other browsers have had the function available under both names.
     
  5. d_grass

    d_grass

    Joined:
    Mar 6, 2018
    Posts:
    33
    @jukka_j

    Hi I also stumbled on this issue right now. Glad that here is already a thread :D.
    I renamed it like you said under C:\Program Files\Unity\Hub\Editor\2019.4.8f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\src\library_pthread.js
    and restarted Unity just in case but somehow it does not apply. Did I something wrong?
     
  6. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    419
    Try doing some silly/trivial change to a C# file after editing the .js file, and rebuild. Unity engine does not track changes to the .js files, so it might think that there is no need to rebuild the project at all, if only those files got changed.
     
    d_grass likes this.
  7. d_grass

    d_grass

    Joined:
    Mar 6, 2018
    Posts:
    33
    Thanks its working now. But isn't the project recompiled if I build to target, thats what I think to know right now or am I wrong? This case shows me that its not apply or?
     
unityunity