You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Preloaded plugins code is crashing when a program is compiled with -pthread or USE_PTHREADS=1
This bug was found in the context of PR #9947, but is completely unrelated to the Regal port.
Reproducing the issue is fairly simple. For example, in test_browser.py just update the test_glbegin_points with '@requires_threads' facet and '-pthread' compilation flag, like this:
The test will fail silently. If you open the debugger on chrome, you may see the following error that means something start to be wrong at some point:
Blob constructor present but fails: TypeError: Failed to construct 'Blob': The provided ArrayBufferView value must not be shared.; falling back to blob builder"
Some code want a Blob to be constructed out of a Shared Typed Array, and this is apparently not possible (?). So a fallback to a "Blob Builder" is activated. But in turn, the fallback fails.
This happens during the file preload / imagePlugin handlers:
Uncaught (in promise) TypeError: Browser.BlobBuilder is not a constructor
at Object.imagePlugin_handle [as handle] (VM15 test.js:1596)
at VM15 test.js:4359
at Array.forEach (<anonymous>)
at processData (VM15 test.js:4356)
at Object.createPreloadedFile [as FS_createPreloadedFile] (VM15 test.js:4374)
at DataRequest.finish (VM15 test.js:112)
at DataRequest.onload (VM15 test.js:108)
at processPackageData (VM15 test.js:138)
at runWithFS (VM15 test.js:148)
at callRuntimeCallbacks (VM15 test.js:1057)
So the methods that fails is 'imagePlugin_handle(byteArray, name, onload, onerror)' in 'library_browser.js', at the following code:
var bb = new Browser.BlobBuilder();
We get there because the initial blob creation failed (due to Shared Typed Array thing). Then, this line fails because 'Browser.BlobBuilder' is null (or undefined, I am not sure). After some investigation, I found out it is so because of this code somewhere earlier in 'library_browser.js':
Indeed, we are neither on Firefox nor on Webkit, so BlobBuilder is either undefined or null.
From there, I don't know what could be done: unable to create a new Blob because of Shared Typed Arrays + no MozBlobBuilder + no WebKitBlobBuilder = what can be done ?
The text was updated successfully, but these errors were encountered:
Interesting. Based on that error, I think we need to make a copy of the data before sending it to the Blob constructor, as it is apparently defined as not multithreading-safe. I think a copy is fine as we send it once, and don't need to look for updates later, but we should read the code around there to make sure.
(Note that BlobBuilder is only present for backwards compatibility with old browsers - we can probably remove it, or put it behind the legacy flag.)
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.
Preloaded plugins code is crashing when a program is compiled with -pthread or USE_PTHREADS=1
This bug was found in the context of PR #9947, but is completely unrelated to the Regal port.
Reproducing the issue is fairly simple. For example, in
test_browser.py
just update thetest_glbegin_points
with '@requires_threads' facet and '-pthread' compilation flag, like this:And then run the test (be sure it will run on Chrome as it needs multithreading support):
python tests/runner.py browser.test_glbegin_points
The test will fail silently. If you open the debugger on chrome, you may see the following error that means something start to be wrong at some point:
Some code want a Blob to be constructed out of a Shared Typed Array, and this is apparently not possible (?). So a fallback to a "Blob Builder" is activated. But in turn, the fallback fails.
This happens during the file preload / imagePlugin handlers:
So the methods that fails is 'imagePlugin_handle(byteArray, name, onload, onerror)' in 'library_browser.js', at the following code:
var bb = new Browser.BlobBuilder();
We get there because the initial blob creation failed (due to Shared Typed Array thing). Then, this line fails because 'Browser.BlobBuilder' is null (or undefined, I am not sure). After some investigation, I found out it is so because of this code somewhere earlier in 'library_browser.js':
Indeed, we are neither on Firefox nor on Webkit, so BlobBuilder is either undefined or null.
From there, I don't know what could be done: unable to create a new Blob because of Shared Typed Arrays + no MozBlobBuilder + no WebKitBlobBuilder = what can be done ?
The text was updated successfully, but these errors were encountered: