You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BinDiff: panic when its output fills a Git Bash pipe #74
[VERIFIED] Found while testing #65. Zig 0.17.1 panics when stdout is an asynchronous pipe that fills up (.PENDING => unreachable for a handle not marked nonblocking, lib/std/Io/Threaded.zig). Pipes of Git Bash/MSYS are asynchronous.
[VERIFIED] p3p-bindiff --elf on two synthetic ELFs with 3,000 changed sections, Windows, Git Bash: output to a file is 1,083,473 bytes, exit 1. | cat stops after about 73 KB with panic: reached unreachable code, exit 3, in text and --json mode.
[VERIFIED] The risk in normal use is low: byte mode prints at most about 6.3 KB, and --elf --json on the real EBOOT against itself prints 919 bytes. It takes roughly 200 changed sections or segments to fill the pipe.
Scope
Write stdout on Windows through WriteFile, which waits for a pending write, as tools/cpk does (#73). Exit codes stay as they are.
Verification
A CLI test with an overlapped pipe on Windows that fails with exit 3 before the fix (the pipes of Python's subprocess are synchronous, so they don't show this).
The reproduction above through a Git Bash pipe gives the same bytes as the output to a file.
Activity