Skip to content

Fix Windows text-mode file reading in processor tests - #42

Merged
illwieckz merged 2 commits into
masterfrom
illwieckz/windows-clrf
Oct 13, 2026
Merged

illwieckz merged 2 commits into
masterfrom
illwieckz/windows-clrf

Conversation

@illwieckz

@illwieckz illwieckz commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

On Windows, text-mode file streams translate CRLF line endings, which can cause reads to return fewer bytes than expected when the file size is determined by seeking to the end.

Read symbol files in source_line_resolver_base and microdump files in microdump_processor_unittest in binary mode to avoid this conversion and ensure the expected number of bytes can be read.

These changes fix test failures on Windows caused by CRLF translation.

Imported from:

The issue was observed while running the MinGW Clang CI job on a Windows ARM64 system. It is not specific to ARM64, this was simply the first Windows system on which I ran these checks.

The issue did not reproduce in the MinGW GCC CI job for AMD64, which runs on Linux under Wine. This suggests that Wine's file-stream behavior may differ from native Windows in this case, potentially masking the issue. It could be a Wine bug that might affect other software in the opposite direction, and may be worth reporting separately.

…CRLF conversion on Windows

On Windows, text-mode file streams translate CRLF line endings,
which can cause reads to return fewer bytes than expected when
the file size is determined by seeking to the end.
…id CRLF conversion on Windows

On Windows, text-mode file streams translate CRLF line endings,
which can cause reads to return fewer bytes than expected when
the file size is determined by seeking to the end.
@slipher

slipher commented Oct 12, 2026

Copy link
Copy Markdown
Member

The issue did not reproduce in the MinGW GCC CI job for AMD64, which runs on Linux under Wine. This suggests that Wine's file-stream behavior may differ from native Windows in this case, potentially masking the issue.

Probably a test that reads from a .sym file checked into the repository? Then it would have LF due to being checked out on a Linux host.

LGTM but it would be good to have the reasoning in the commit message

@illwieckz
illwieckz force-pushed the illwieckz/windows-clrf branch from 5bfc05a to 8a60dd7 Compare October 13, 2026 02:34
@illwieckz

Copy link
Copy Markdown
Member Author

LGTM but it would be good to have the reasoning in the commit message

OK done.

@illwieckz
illwieckz merged commit fa809dc into master Oct 13, 2026
@illwieckz
illwieckz deleted the illwieckz/windows-clrf branch October 13, 2026 03:04
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.

2 participants