# \[Bug\]\[2.02.04\] WebGL crash - float unrepresentable in integer range at \_FMOD\_OS\_Time\_GetUs

**URL:** <https://qa.fmod.com/t/bug-2-02-04-webgl-crash-float-unrepresentable-in-integer-range-at-fmod-os-time-getus/18730>\
**Category:** Unity\
**Created:** [May 6, 2022, 6:00am UTC](https://qa.fmod.com/t/bug-2-02-04-webgl-crash-float-unrepresentable-in-integer-range-at-fmod-os-time-getus/18730 "2022-05-06T06:00:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mnewcombe](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mnewcombe/32/3178_2.png) [@mnewcombe](https://qa.fmod.com/u/mnewcombe)\
**Post date:** [May 6, 2022, 6:00am UTC](https://qa.fmod.com/t/bug-2-02-04-webgl-crash-float-unrepresentable-in-integer-range-at-fmod-os-time-getus/18730/1 "2022-05-06T06:00:01Z")

</div>

Hi There,

If our WebGL project is left running, after ~70minutes, an exception occurs in the FMOD stack which throws every frame subsequently and effectively freezes/crashes the experience,

The call stack is:

```auto
profiling.wasm:0x1c8bbdf Uncaught RuntimeError: float unrepresentable in integer range
    at _FMOD_OS_Time_GetUs (profiling.wasm:0x1c8bbdf)
    at __ZN5FMODZ9TimeStamp7stampInEv (profiling.wasm:0x1d00e4c)
    at __ZN5FMODZ6Output3mixEPvj (profiling.wasm:0x1d044c2)
    at __ZN5FMODZ6Output11mixCallbackEP17FMOD_OUTPUT_STATEPvj (profiling.wasm:0x1d041d3)
    at __ZN5FMODZ14OutputWebAudio9mix_to_jsEi (profiling.wasm:0x1cf618e)
    at _FMOD_JS_MixFunction (profiling.wasm:0x1cf612b)

```

My guess is a number which ticks ever higher reaches a value that causes the WASM error after ~70mins.

This is a fairly impactful bug for us - is it known/any work arounds?

Thanks,

Matt

---

<div class="post-metadata">

**Author:** ![mnewcombe](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mnewcombe/32/3178_2.png) [@mnewcombe](https://qa.fmod.com/u/mnewcombe)\
**Post date:** [May 10, 2022, 1:54pm UTC](https://qa.fmod.com/t/bug-2-02-04-webgl-crash-float-unrepresentable-in-integer-range-at-fmod-os-time-getus/18730/2 "2022-05-10T13:54:07Z")

</div>

I’ve created a minimal repro using the FMOD test project and hosting it at [Unity WebGL Player | fmod\_safari\_bug](https://cauldron-eng.github.io/fmod-time-crash/)

Repro Instructions:

Open link in Chrome or Safari on MacOS (haven’t tested other Operating Systems)

1. Click Async Load Banks
2. Click Emit Event
3. Click Initialise Audio
4. Wait for ~70minutes
5. Observe crash

You can find the unity project that was built for this at:

> **[fmod\_time\_crash.zip](https://drive.google.com/file/d/1mXb59N2eHU9Y9r2afL1QRi05bv6XqJKk/view?usp=sharing)**
>
> Google Drive file.

Thanks,

Matt

---

<div class="post-metadata">

**Author:** ![mnewcombe](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mnewcombe/32/3178_2.png) [@mnewcombe](https://qa.fmod.com/u/mnewcombe)\
**Post date:** [May 12, 2022, 9:52am UTC](https://qa.fmod.com/t/bug-2-02-04-webgl-crash-float-unrepresentable-in-integer-range-at-fmod-os-time-getus/18730/3 "2022-05-12T09:52:06Z")

</div>

I’ve updated this repro project in the previous post, including symbols so the call stack is in the error [Unity WebGL Player | fmod\_safari\_bug](https://cauldron-eng.github.io/fmod-time-crash/)

New project link:

> **[fmod\_time\_crash\_v2.zip](https://drive.google.com/file/d/1_lYfJjtutAEAAazPU-fVmzx6SktWiVyJ/view?usp=sharing)**
>
> Google Drive file.

Would edit the post above but I think that’s time limited!

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [May 12, 2022, 11:55pm UTC](https://qa.fmod.com/t/bug-2-02-04-webgl-crash-float-unrepresentable-in-integer-range-at-fmod-os-time-getus/18730/4 "2022-05-12T23:55:17Z")

</div>

Thanks for all that info Matt, I’m looking into it at the moment and will let you know how I go.

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [May 17, 2022, 3:41am UTC](https://qa.fmod.com/t/bug-2-02-04-webgl-crash-float-unrepresentable-in-integer-range-at-fmod-os-time-getus/18730/5 "2022-05-17T03:41:47Z")

</div>

Hi, i’ve narrowed this down to a bug in the fastcomp branch, which Unity versions below 2021.2 use. Upstream emscripten does not have this issue.

What version of Unity are you using? My ‘quick’ solution is to use a newer Unity version, otherwise we can release a patch to pre-clamp numbers before they are converted into the integer. We could possibly provide a custom build for this if it is urgent.

---

<div class="post-metadata">

**Author:** ![mnewcombe](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mnewcombe/32/3178_2.png) [@mnewcombe](https://qa.fmod.com/u/mnewcombe)\
**Post date:** [May 17, 2022, 4:57am UTC](https://qa.fmod.com/t/bug-2-02-04-webgl-crash-float-unrepresentable-in-integer-range-at-fmod-os-time-getus/18730/6 "2022-05-17T04:57:26Z")

</div>

🎉 Nice one on tracking it down, that’s great! And thank you for jumping on it 🙏

Unfortunately we are blocked on our Unity upgrade path due to an unrelated WebGL performance regression present in 2021 (which we are working with Unity on)

Re. patch release - an FMOD update/patch would be great assuming that the patch is likely to release in the next 2 months?

If that timeframe is optimistic, then would love to explore if a custom build is possible.

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [May 17, 2022, 10:28pm UTC](https://qa.fmod.com/t/bug-2-02-04-webgl-crash-float-unrepresentable-in-integer-range-at-fmod-os-time-getus/18730/7 "2022-05-17T22:28:32Z")

</div>

looks like we got lucky , a patch just made it in for the upcoming release which may be out today. This will be 2.02.07 or 2.01.16

---

<div class="post-metadata">

**Author:** ![mnewcombe](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mnewcombe/32/3178_2.png) [@mnewcombe](https://qa.fmod.com/u/mnewcombe)\
**Post date:** [May 18, 2022, 6:44am UTC](https://qa.fmod.com/t/bug-2-02-04-webgl-crash-float-unrepresentable-in-integer-range-at-fmod-os-time-getus/18730/8 "2022-05-18T06:44:19Z")

</div>

Amazing!!! Just want to check I understand your use of the word “or” between the versions.

If it comes out in 2.01, does that mean we are waiting the next release cycle for it to land in 2.02? And if so what’s the rough cadence of patch releases?

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [May 18, 2022, 9:02am UTC](https://qa.fmod.com/t/bug-2-02-04-webgl-crash-float-unrepresentable-in-integer-range-at-fmod-os-time-getus/18730/9 "2022-05-18T09:02:29Z")

</div>

sorry I meant ‘and’. I just mean you can pick one or the other.

---

<div class="post-metadata">

**Author:** ![mnewcombe](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mnewcombe/32/3178_2.png) [@mnewcombe](https://qa.fmod.com/u/mnewcombe)\
**Post date:** [May 18, 2022, 10:38am UTC](https://qa.fmod.com/t/bug-2-02-04-webgl-crash-float-unrepresentable-in-integer-range-at-fmod-os-time-getus/18730/10 "2022-05-18T10:38:48Z")

</div>

Gotcha! Thanks, keeping an eye out…

---

<div class="post-metadata">

**Author:** ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)\
**Post date:** [May 19, 2022, 11:42pm UTC](https://qa.fmod.com/t/bug-2-02-04-webgl-crash-float-unrepresentable-in-integer-range-at-fmod-os-time-getus/18730/11 "2022-05-19T23:42:28Z")

</div>

this is out now

---

<div class="post-metadata">

**Author:** ![mnewcombe](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mnewcombe/32/3178_2.png) [@mnewcombe](https://qa.fmod.com/u/mnewcombe)\
**Post date:** [May 20, 2022, 10:20am UTC](https://qa.fmod.com/t/bug-2-02-04-webgl-crash-float-unrepresentable-in-integer-range-at-fmod-os-time-getus/18730/12 "2022-05-20T10:20:47Z")

</div>

2.02.07 does indeed fix it, massive thanks to you, @cameron-fmod and the rest of the team for the hard work!
