Skip to content

Conversation

catamorphism
Copy link
Collaborator

This was breaking reads/writes to stdin/stdout/stderr.

Also check return values from init_{stdin, stdout, stderr}, although this may not help much since the return values from printf()/etc. aren't usually checked.

This was breaking reads/writes to stdin/stdout/stderr.

Also check return values from init_{stdin, stdout, stderr}, although
this may not help much since the return values from printf()/etc.
aren't usually checked.
@catamorphism
Copy link
Collaborator Author

Note: I tested this manually, since with the current test suite, writing anything to stdout/stderr is considered a test failure. This should probably be improved, but I'm technically on vacation so I'll wait on that.

@catamorphism
Copy link
Collaborator Author

Fixes #625

}

// Translate the file descriptor to an internal handle
descriptor_table_get_ref(fildes, &entry);
Copy link
Collaborator

Choose a reason for hiding this comment

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

(feel free to defer this to when you get back from vacation, this isn't urgent)

should the return value here also be checked to return EBADF if this call fails?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. Fixed in e1ff08d -- I also found/fixed a number of other places where the return value of descriptor_table_get_ref() and similar methods wasn't checked.

@catamorphism catamorphism merged commit 74ec0e4 into WebAssembly:main Oct 8, 2025
16 checks passed
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.

3 participants