Skip to content

Windows: std.libc strtol/strtoul parse a 64-bit long; pcre2 locale test skipped under code page 1252 - #2594

Merged
ehartford merged 3 commits into
mainfrom
winfix
Oct 23, 2026
Merged

ehartford merged 3 commits into
mainfrom
winfix

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

The two Windows findings of #2592, each a commit:

  1. std.libc strtol and strtoul parse a 64-bit long on every target. They were externs bound to libc's own, whose long is 32 bits on the UCRT, so the With side read a 32-bit result as 64 and the saturation point was UINT32_MAX. The promoted corpora are migrated against one LP64 C model (D112), so pcre2test's U32OVERFLOW(x) is baked as x > UINT32_MAX; on Windows a repeat count of 6e21 passed the check and asked for a 6.5 GB expansion. Now runtime helpers like strtold's: libc's where long is 64 bits, _strtoi64/_strtoui64 on the UCRT (D114: With code sees one width).
  2. pcre2-test skips the locale test where the French locale is code page 1252. Upstream's four alternatives are ISO 8859-1; the Windows CRT's fr_FR classifies \x83 \x8a \x8c \x8e \x9a \x9c \x9e \x9f as letters. The port skips with the reason only when the output lists those code units; any other difference still fails.

Darwin: :dev green, strtol/strtoul unchanged (the 64-bit saturations), pcre2 smoke green. The Windows leg from the bridge commit d527243 (these two on the bridge) is running; its pcre2-test is the proof. Draft until the battery is green.

Eric Hartford added 2 commits October 23, 2026 18:09
std.libc declared `strtol -> i64` and `strtoul -> u64` as externs bound to
libc's own, whose `long` is 32 bits on the UCRT: the With side read a
32-bit result as 64 and the saturation point was UINT32_MAX. The promoted
corpora are migrated against one LP64 C model (D112: one corpus for every
host), so pcre2test's `U32OVERFLOW(x)` was baked as `x > UINT32_MAX` and a
repeat count of 6e21 passed the check on Windows, then asked for a 6.5 GB
expansion that the runtime could not commit (pcre2 test 2 on the Windows
seed leg, #2592). The two are now runtime helpers like strtold's: libc's
strtol/strtoul where long is 64 bits, the UCRT's _strtoi64/_strtoui64
where it is 32, so With code sees one width (D114) and a corpus's overflow
check holds everywhere.
…e page 1252

Upstream's test 3 accepts any of four ISO 8859-1 French outputs. The Windows
CRT's fr_FR is code page 1252, whose letters above 0x7f (\x83 ƒ, \x8a Š,
\x8c Œ, \x8e Ž, \x9a š, \x9c œ, \x9e ž, \x9f Ÿ) are not Latin-1's, so the
output matches none of them although the library is not what differs
(#2592). The port skips the test when the output lists those code units,
with the reason; any other difference still fails.
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on 551fefc under the pinned darwin seed. Waiting for the Windows leg (bridge d527243) before marking ready: its pcre2-test is the proof of both fixes.

Test 2 appends pcre2test's `-error` run, read from its stdout, to the
test's output file. pcre2test writes the file in binary mode and stdout in
text mode, which on Windows ends a line with CRLF, so the appended block
differed from upstream's expected text by its line endings alone (the
Windows seed leg, #2592). The appended lines take the file's endings.
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN again with the line-ending fix (3 commits). The Windows leg from bridge 3edfcc6 is the proof; marking ready and merging on its green pcre2-test.

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.

1 participant