Zig: send a friendly bug report to wine related to FillConsoleOutputAttribute returning InvalidHandle

Created on 1 May 2020  路  3Comments  路  Source: ziglang/zig

[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

bug contributor friendly downstream os-windows standard library

All 3 comments

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

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daurnimator picture daurnimator  路  3Comments

andrewrk picture andrewrk  路  3Comments

andrewrk picture andrewrk  路  3Comments

bronze1man picture bronze1man  路  3Comments

DavidYKay picture DavidYKay  路  3Comments