Windows: io.writeInt fails #4

Closed
opened 2025-08-07 12:57:21 +00:00 by ed · 2 comments
Owner

The newly added io.writeInt fails on Windows only.
The examples where it's failing are factorial, fibonacci, fizzbuzz, gcd, collatz and prime.

The exit code in all cases is 3221225477 aka 0xC000005 which is a memory access violation.

The newly added `io.writeInt` fails on Windows only. The examples where it's failing are factorial, fibonacci, fizzbuzz, gcd, collatz and prime. The exit code in all cases is 3221225477 aka 0xC000005 which is a memory access violation.
Author
Owner

Looking further into this, the reason seems to be a misaligned SP register in the 2nd extern call to kernel32.WriteFile in io.write.

Looking further into this, the reason seems to be a misaligned SP register in the 2nd extern call to `kernel32.WriteFile` in `io.write`.
ed self-assigned this 2025-08-07 17:05:36 +00:00
ed started working 2025-08-07 17:05:43 +00:00
Author
Owner

Fixed in 407606fcf0.

Fixed in https://git.urbach.dev/cli/q/commit/407606fcf0ec2add800b36e3c68fe803d02d3335.
ed closed this issue 2025-08-07 17:13:41 +00:00
ed stopped working 2025-08-07 17:13:41 +00:00
7 minutes 58 seconds
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Total time spent: 7 minutes 58 seconds
ed
7 minutes 58 seconds
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cli/q#4
No description provided.