File: core/sys/info/platform_windows.odin, line 385
Introduced in: the update-odin-2026-02 merge that removed context/temp allocator usage from init_gpu_info and read_reg_string.
utf16.decode_to_utf8(res_buf[:result_size], buf_utf16[:])RegGetValueW writes the number of bytes consumed in the UTF-16 output buffer back into result_size. For the string "NVIDIA RTX PRO 5000 Blackwell Generation Laptop GPU" (51 chars + null terminator = 52 UTF-16 code units = 104 bytes), result_size comes back as 104.
This value is then used to slice res_buf, the UTF-8 destination buffer, as res_buf[:104]. But res_buf is backed by buf_scratch: [100]u8 at the call site (line 302), so the slice 0:104 is out of range for a 100-element buffer.
Runtime error:
platform_windows.odin(385:30) Invalid slice indices 0:104 is out of range 0..<100
The crash triggers when DriverDesc (or ProviderName) exceeds 50 characters, making the UTF-16 byte count exceed 100. Example from an affected machine:
| Entry | Value | UTF-8 len | UTF-16 bytes (incl null) |
|---|---|---|---|
| 0000 ProviderName | NVIDIA |
6 | 14 |
| 0000 DriverDesc | NVIDIA RTX PRO 5000 Blackwell Generation Laptop GPU |
51 | 104 |
| 0001 ProviderName | Intel Corporation |
17 | 36 |
| 0001 DriverDesc | Intel(R) Graphics |
17 | 36 |
The "Blackwell Generation Laptop GPU" branding pushes it over. Shorter GPU names like NVIDIA GeForce RTX 4090 (23 chars, 48 UTF-16 bytes) would never trigger this.
- Wrong size domain:
result_sizeis in UTF-16 bytes, but it's indexing the UTF-8 destination. The destination should be the fullres_buf, and the source should bebuf_utf16[:result_size / size_of(u16)]. buf_scratchis too small: even with correct slicing, a[100]u8buffer can't hold strings approaching 100 characters. The old code used a 4096-byte temp-allocated buffer. Thescratchbuffer used informat_display_versiona few lines above is[512]u8.
// line 385: use full res_buf as destination, convert byte count to u16 count for source
utf16.decode_to_utf8(res_buf, buf_utf16[:result_size / size_of(u16)])And bump buf_scratch on line 302 from [100]u8 to [512]u8.