Skip to content

fix(wasix): Fix EFD_SEMAPHORE eventfd read value#6533

Open
artemyarulin wants to merge 2 commits into
mainfrom
fix/semaphore-dec
Open

fix(wasix): Fix EFD_SEMAPHORE eventfd read value#6533
artemyarulin wants to merge 2 commits into
mainfrom
fix/semaphore-dec

Conversation

@artemyarulin

@artemyarulin artemyarulin commented May 1, 2026

Copy link
Copy Markdown
Contributor

Fixes WASIX eventfd(EFD_SEMAPHORE) reads returning the full counter value instead of 1.

In semaphore mode, Linux eventfd semantics require each successful read to return 1 and decrement the counter by one. The WASIX notification counter was already decrementing one permit, but returned the pre-decrement counter, so reading after writing 4 returned 4.

Closes #6145

@artemyarulin

Copy link
Copy Markdown
Contributor Author

Shield - Regression 💩💩💩

Language Tests Pass rate now PASS FAIL TIMEOUT CRASH
Python 37,920 68.8% 0 $${\color{red}+18}$$ $${\color{green}-19}$$ 0
Node.js 4,861 32.7% $${\color{green}+3}$$ $${\color{green}-51}$$ $${\color{red}+52}$$ $${\color{green}-1}$$
PHP 19,912 72.5% $${\color{red}-1}$$ $${\color{red}+1}$$ 0 0
Rust 22,337 94.3% 0 $${\color{green}-4}$$ 0 0

More changed tests

Install shield

  • git clone https://github.com/wasmerio/compat-tests.git
  • cd compat-tests
  • cargo build
  • ./target/debug/shield run --lang <LANG> --wasmer [WASMER BINARY] <TEST OR BATCH>

Artifacts

@marxin

marxin commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

@artemyarulin Can we close the PR now as it was used just for testing?

@marxin marxin marked this pull request as draft June 4, 2026 07:41
@artemyarulin artemyarulin requested a review from Arshia001 June 4, 2026 15:01
@artemyarulin artemyarulin marked this pull request as ready for review June 4, 2026 15:01
@artemyarulin

Copy link
Copy Markdown
Contributor Author

Sorry, it was used for testing, but it's an actual fix, so ready for the review

@marxin

marxin commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

All right, so please port it to the new test harness, basically you just add the .c file and you are done.

EDITTED: done

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.

eventfd(EFD_SEMAPHORE) read returns full counter instead of 1

2 participants