Skip to content
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

Windows console API shims are missing #2652

Open
thomcc opened this issue Nov 6, 2022 · 1 comment
Open

Windows console API shims are missing #2652

thomcc opened this issue Nov 6, 2022 · 1 comment
Labels
A-shims Area: This affects the external function shims A-windows Area: affects only Windows targets C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement

Comments

@thomcc
Copy link
Member

thomcc commented Nov 6, 2022

Miri punts on GetConsoleMode currently, which means that under miri, the stdlib's stdio implementation is rather different than reality. This means several things that don't work in reality will work under miri (such as writing invalid UTF-8 to stdout), and also that the windows stdio code continues to be untested (not as worrisome as some of the sys::windows code, although it's probably the trickiest code with regards to MaybeUninit. But generally, it would be nice for us to align reality with what miri tests.

I took a look and I'm not sure how to do this really. It seems like much of windows IO is smoke and mirrors. So this almost certainly requires implementing a few other calls as well, such as WriteConsoleW and the like, although I think you can just implement console coloring as a no-op for now.

@RalfJung RalfJung added A-shims Area: This affects the external function shims A-windows Area: affects only Windows targets labels Nov 6, 2022
@RalfJung
Copy link
Member

RalfJung commented Nov 6, 2022

Yeah, on Windows I generally did the bare minimum needed to get the tests to pass. Many functions are barely functional stubs and certainly they are not modeling UB accurately. I'm happy to review PRs that improve Miri in this area but won't work on that myself.

@RalfJung RalfJung added the C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement label Mar 11, 2024
@RalfJung RalfJung changed the title Implement shims for more of the Windows console APIs Windows console API shims are missing Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-shims Area: This affects the external function shims A-windows Area: affects only Windows targets C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement
Projects
None yet
Development

No branches or pull requests

2 participants