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

send a friendly bug report to wine related to FillConsoleOutputAttribute returning InvalidHandle #5244

Open
andrewrk opened this issue May 1, 2020 · 3 comments

Comments

@andrewrk
Copy link
Member

@andrewrk andrewrk commented May 1, 2020

[nix-shell:~/Downloads/zig/build]$ ./zig test ../test/stage1/behavior.zig -target i386-windows-msvc
Created /home/andy/Downloads/zig/build/zig-cache/o/McIyD3Bm3f2jqnD53lAAfZKU-VZa5xY2iE0HA8xJQXJH_WEcw1-0xa3kBwVYa6uL/test.exe but skipping execution because it is non-native.

[nix-shell:~/Downloads/zig/build]$ wine /home/andy/Downloads/zig/build/zig-cache/o/McIyD3Bm3f2jqnD53lAAfZKU-VZa5xY2iE0HA8xJQXJH_WEcw1-0xa3kBwVYa6uL/test.exe
Test [1/926] behavior.align.test "global variable alignment"...reached unreachable code
/home/andy/Downloads/zig/lib/std/progress.zig:170:36: 0x4781c7 in std.progress.Progress::std.progress.Progress.refresh (test.obj)
Panicked during a panic. Aborting.

The code in question is:

                if (windows.kernel32.FillConsoleOutputAttribute(
                    file.handle,
                    info.wAttributes,
                    fill_chars,
                    cursor_pos,
                    &written,
                ) != windows.TRUE) unreachable;

It's hitting the unreachable there. GetLastError() is returning "invalid handle".

cc @LemonBoy
cc @alexnask

@andrewrk andrewrk added this to the 0.7.0 milestone May 1, 2020
@andrewrk
Copy link
Member Author

@andrewrk andrewrk commented May 1, 2020

Happens for -target x86_64-windows-msvc as well.

andrewrk added a commit that referenced this issue May 1, 2020
I observed this returning an error. Fall back to not doing
terminal stuff if an error occurs here.

See #5244
@LemonBoy
Copy link
Contributor

@LemonBoy LemonBoy commented May 1, 2020

If the code works under Windows the problem is in Wine implementation of the terminal API

@alexnask
Copy link
Member

@alexnask alexnask commented May 1, 2020

The code works on windows in cmd.exe, ConEmu and the git bash console for both targets, not sure why wine fails.

@andrewrk andrewrk changed the title the new progress code is crashing the i386-windows-msvc behavior tests in wine send a friendly bug report to wine related to FillConsoleOutputAttribute returning InvalidHandle May 1, 2020
@andrewrk andrewrk modified the milestones: 0.7.0, 0.8.0 May 1, 2020
ninjacato added a commit to ninjacato/zig that referenced this issue May 2, 2020
I observed this returning an error. Fall back to not doing
terminal stuff if an error occurs here.

See ziglang#5244
pixelherodev pushed a commit to pixelherodev/zig that referenced this issue May 23, 2020
I observed this returning an error. Fall back to not doing
terminal stuff if an error occurs here.

See ziglang#5244
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.