Skip to content

Handle empty listen sockets gracefully. #16472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 11, 2022

Conversation

tiran
Copy link
Contributor

@tiran tiran commented Mar 11, 2022

accept() syscall no longer crashes with error message
TypeError: Cannot read property 'stream' of undefined when sockfs
has no pending listen socket. The syscall now returns EINVAL on
error.

See: #16047
Signed-off-by: Christian Heimes christian@python.org

``accept()`` syscall no longer crashes with error message
``TypeError: Cannot read property 'stream' of undefined`` when sockfs
has no pending listen socket. The syscall now returns ``EINVAL`` on
error.

See: emscripten-core#16047
Signed-off-by: Christian Heimes <christian@python.org>
Copy link
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.

Would be nice to see this get tested somewhere.

@tiran
Copy link
Contributor Author

tiran commented Mar 11, 2022

Would be nice to see this get tested somewhere.

I don't have spare time to write a reproducer in C. Let's keep the ticket open and we can look into the issue later.

The changeset turns the crash into a recoverable error in CPython's test suite. It's a small progress.

@sbc100 sbc100 enabled auto-merge (squash) March 11, 2022 16:40
@sbc100 sbc100 merged commit 80e3010 into emscripten-core:main Mar 11, 2022
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