Skip to content

Fix null deref in ppoll/pselect#26533

Merged
sbc100 merged 1 commit intoemscripten-core:mainfrom
sbc100:fix_ppoll
Mar 24, 2026
Merged

Fix null deref in ppoll/pselect#26533
sbc100 merged 1 commit intoemscripten-core:mainfrom
sbc100:fix_ppoll

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Mar 24, 2026

This fixes the current failure of asan.test_ppoll_blocking on the emsdk waterfall.

This fixes the current failure of asan.test_ppoll_blocking on the emsdk
waterfall.
@sbc100 sbc100 requested a review from kripken March 24, 2026 16:26
@sbc100 sbc100 enabled auto-merge (squash) March 24, 2026 16:27
@sbc100 sbc100 requested a review from dschuff March 24, 2026 16:49
int timeout = (to == NULL) ? -1 : (to->tv_sec * 1000 + to->tv_nsec / 1000000);
sigset_t origmask;
pthread_sigmask(SIG_SETMASK, mask, &origmask);
if (mask) pthread_sigmask(SIG_SETMASK, mask, &origmask);
Copy link
Member

Choose a reason for hiding this comment

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

is it valid to have a null mask? should we return an error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, from the ppoll man page:

If the sigmask argument is specified as NULL, then no signal mask manipulation is performed (and thus ppoll() differs from poll() only in the precision of the timeout
argument).

@sbc100 sbc100 merged commit 26c8e9d into emscripten-core:main Mar 24, 2026
38 checks passed
@sbc100 sbc100 deleted the fix_ppoll branch March 24, 2026 17:10
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