WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
229706
REGRESSION (Safari 14): webgl_loader_texture_basis three.js example sometimes fails
https://bugs.webkit.org/show_bug.cgi?id=229706
Summary
REGRESSION (Safari 14): webgl_loader_texture_basis three.js example sometimes...
Michael Herzog
Reported
2021-08-31 03:24:43 PDT
The following example pages decodes a texture in a web worker, transfers the result into the main thread via "postMessage()" and then renders the result on a plane.
https://threejs.org/examples/webgl_loader_texture_basis
Expected behavior: The texture is always rendered correctly. Actual behavior: Sometimes the plane is white since no texture is applied. This only happens sporadicly (maybe one out of ten reloads). A user at GitHub found out that the root cause of this issue is a missing message from the worker. Meaning the worker sends the message but it never reaches the main thread.
https://github.com/mrdoob/three.js/issues/19717#issuecomment-653581829
This issue only happens in WebKit based browsers on iOS, iPadOS and macOS. According to the comments at GitHub the example used to work consistently in earlier version of Safari (meaning < 14).
Attachments
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2021-09-03 13:19:47 PDT
Thank you for the bug report and the test site. It looks like I can I am able to reproduce on Safari 15 on macOS.
Chris Dumez
Comment 2
2021-09-03 13:39:37 PDT
Hmm, I see the page sending 2 messages to the worker and us dispatching those 2 message events on the WorkerGlobalScope. However, I do not see any messages being sent *from* the worker (no WorkerGlobalScope.postMessage() or MessagePort.postMessage() calls).
Chris Dumez
Comment 3
2021-09-03 14:39:52 PDT
I don't think this is an issue with postMessage(). The worker simply doesn't call postMessage() to send back the results, even though it received 2 messages from the main thread. So presumably, whatever operation is happening between the worker receiving the messages and the worker calling postMessage() with the results is getting stuck, sometimes.
Chris Dumez
Comment 4
2021-09-03 15:02:11 PDT
Since canvas is involved, I tried disabling the GPU process but it didn't help.
Michael Herzog
Comment 5
2021-09-05 01:08:35 PDT
The worker definitely calls "postMessage()" at this place:
https://github.com/mrdoob/three.js/blob/105bd07ffce14f8f8982417e16b99c0d066ce3f1/examples/jsm/loaders/BasisTextureLoader.js#L418
Interestingly, when I add a console.log() right before this line, you see a console log when the demo works. However, when the plane keeps white (so when the issue appears), there is no log in the console.
Alexey Proskuryakov
Comment 6
2021-09-05 14:59:12 PDT
Re-titling to say what we know about the issue, as it's been demonstrated to NOT be related to postMessage(), given that the execution doesn't even reach postMessage() in the worker.
Radar WebKit Bug Importer
Comment 7
2021-09-07 03:25:17 PDT
<
rdar://problem/82814418
>
blascoburguillos
Comment 8
2021-10-27 00:46:32 PDT
I´m also experiencing this issue. Any news or updates?
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug