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
Maybe sbrk is related to #10006? It was closed as stale, but I guess it's still an issue that, for whatever reason, manifests in Firefox more frequently than elsewhere.
OTOH I wonder if it's something that would be accidentally fixed by my changes in #18305.
One of the things I noticed and had to do there is manually start executing messages only after Module variable has been definitely assigned. It became a pretty noticeable issue in Firefox due to my changes to postMessage scheduling in the same PR, but now I wonder if there was always a racy issue, just less noticeable before.
A bit suspiciously, that PR also passed on the first run, but it still might be all a coincidence...
OTOH I wonder if it's something that would be accidentally fixed by my changes in #18305.
Just tested that theory by extracting those changes separately and, no, that doesn't help. Must be some other reason, although I don't see what's common between specifically those 5 tests.
Looking at the log, I think(?) that test_pthread_run_on_main_thread makes the whole browser unresponsive, causing subsequent tests to fail as well. Which explains that this is only a issue on Firefox, because on Chrome this test is already disabled (see commit 6ea085c).
As for a possible fix, perhaps commit 25a6cb2 in PR #13007 would fix this? Just a wild guess, it's based upon that this test makes heavily use of those helpers in <emscripten/threading.h>, which would end-up calling emscripten_wait_for_call_v() in most cases.
That PR also includes some other goodies, such as commit fd05b36. Sorry for not further upstreaming those commits, I sometimes have limited spare-time. :(
... as always, I could certainly use some help in upstreaming these patches. FWIW, I'm currently tracking this in the "Upstream patches" card at Stable release for wasm-vips.
As for a possible fix, perhaps commit 25a6cb2 in PR #13007 would fix this?
Though, I think the intention of PR #15681 was to deprecate emscripten_wait_for_call_v() in favor of the proposed APIs mentioned in comment #15705 (comment).
As for a possible fix, perhaps commit 25a6cb2 in PR #13007 would fix this?
Though, I think the intention of PR #15681 was to deprecate emscripten_wait_for_call_v() in favor of the proposed APIs mentioned in comment #15705 (comment).
Ok I'm not familiar with that side of the things so tagging @tlively.
emscripten_wait_for_call_v should be implemented in terms of the new proxying API (with the system proxying queue), so it's not inherently bad to use, but should only be used for things that act like signal handlers. Looking at the test_pthread_run_on_main_thread test, it looks like it's calling printf, which internally acquires locks. My guess is that printfs are racing, and when one acquires the lock, the system proxying queue is pumped and another starts running in the middle of the first, so the main thread is deadlocking on itself.
Looks like test_pthread_proxying_cpp is also flaky, probably for similar reasons. A bit hard to tell as that test seems to combine several in one file.
Activity
RReverser commentedon Dec 2, 2022
Maybe sbrk is related to #10006? It was closed as stale, but I guess it's still an issue that, for whatever reason, manifests in Firefox more frequently than elsewhere.
Doesn't explain others though.
RReverser commentedon Dec 2, 2022
OTOH I wonder if it's something that would be accidentally fixed by my changes in #18305.
One of the things I noticed and had to do there is manually start executing messages only after Module variable has been definitely assigned. It became a pretty noticeable issue in Firefox due to my changes to
postMessagescheduling in the same PR, but now I wonder if there was always a racy issue, just less noticeable before.A bit suspiciously, that PR also passed on the first run, but it still might be all a coincidence...
RReverser commentedon Dec 2, 2022
Although no, that should've affected only modularize builds, and those tests are not it...
Try to make Worker initialization less flaky
RReverser commentedon Dec 2, 2022
Just tested that theory by extracting those changes separately and, no, that doesn't help. Must be some other reason, although I don't see what's common between specifically those 5 tests.
kleisauke commentedon Dec 2, 2022
Looking at the log, I think(?) that
test_pthread_run_on_main_threadmakes the whole browser unresponsive, causing subsequent tests to fail as well. Which explains that this is only a issue on Firefox, because on Chrome this test is already disabled (see commit 6ea085c).As for a possible fix, perhaps commit 25a6cb2 in PR #13007 would fix this? Just a wild guess, it's based upon that this test makes heavily use of those helpers in
<emscripten/threading.h>, which would end-up callingemscripten_wait_for_call_v()in most cases.That PR also includes some other goodies, such as commit fd05b36. Sorry for not further upstreaming those commits, I sometimes have limited spare-time. :(
kleisauke commentedon Dec 2, 2022
... as always, I could certainly use some help in upstreaming these patches. FWIW, I'm currently tracking this in the "Upstream patches" card at Stable release for wasm-vips.
kleisauke commentedon Dec 2, 2022
Though, I think the intention of PR #15681 was to deprecate
emscripten_wait_for_call_v()in favor of the proposed APIs mentioned in comment #15705 (comment).RReverser commentedon Dec 2, 2022
Ok I'm not familiar with that side of the things so tagging @tlively.
Completely disable flaky test: test_pthread_run_on_main_thread
Completely disable flaky test: test_pthread_run_on_main_thread (#18314)
tlively commentedon Dec 6, 2022
emscripten_wait_for_call_vshould be implemented in terms of the new proxying API (with the system proxying queue), so it's not inherently bad to use, but should only be used for things that act like signal handlers. Looking at thetest_pthread_run_on_main_threadtest, it looks like it's calling printf, which internally acquires locks. My guess is that printfs are racing, and when one acquires the lock, the system proxying queue is pumped and another starts running in the middle of the first, so the main thread is deadlocking on itself.RReverser commentedon Dec 11, 2022
Looks like
test_pthread_proxying_cppis also flaky, probably for similar reasons. A bit hard to tell as that test seems to combine several in one file.