Skip to content

Avoid hang when remainder_ns = 0#26586

Closed
stephenduong1004 wants to merge 1 commit intoemscripten-core:mainfrom
stephenduong1004:patch-6
Closed

Avoid hang when remainder_ns = 0#26586
stephenduong1004 wants to merge 1 commit intoemscripten-core:mainfrom
stephenduong1004:patch-6

Conversation

@stephenduong1004
Copy link
Copy Markdown
Contributor

@stephenduong1004 stephenduong1004 commented Mar 31, 2026

This bug was introduced in #26471

@sbc100
Copy link
Copy Markdown
Collaborator

sbc100 commented Mar 31, 2026

Nice! That looks like a more likely source of the recent hang we have been seeing.

@sbc100
Copy link
Copy Markdown
Collaborator

sbc100 commented Mar 31, 2026

Is there some way to write a test for it? Would calling emscripten_futex_wait(timeout=0) on the main thread catch it?

@sbc100 sbc100 requested a review from dschuff March 31, 2026 20:17
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, even better if we can find a way to test it.

@sbc100
Copy link
Copy Markdown
Collaborator

sbc100 commented Mar 31, 2026

@stephenduong1004 I tried to push a change to this PR to add a test but it seems like there are permissions issues?

(I think if you look at your repo settings you can enable, upstream contributors in emscripten to push changes to your PR branches, but I can't remember exactly what that settings is called).

In the interest of getting this landed today I'll maybe start a separate PR?

sbc100 pushed a commit to sbc100/emscripten that referenced this pull request Mar 31, 2026
sbc100 pushed a commit to sbc100/emscripten that referenced this pull request Mar 31, 2026
@sbc100
Copy link
Copy Markdown
Collaborator

sbc100 commented Apr 1, 2026

Closing in a favor of #26588

@sbc100 sbc100 closed this Apr 1, 2026
sbc100 added a commit that referenced this pull request Apr 1, 2026
This bug was introduced in #26471.

This PR is based on #26586.  Thanks @stephenduong1004!

Co-authored-by: stephenduong1004 <stephenduong@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants