Skip to content

Windows: page host crashes at launch, String.fromCharCode(...bytes) on whole blobs overflows the stack (still in HEAD) #124

Open

Description

@revouwu

Summary

On Windows 11 (150% display scaling), raea 0.1.1 crashed every time it launched, before the login screen appeared. app.log.window.err ended with:

raea-runtime-js: js:     at <anonymous> (bundle.js:75:2108)
    at <anonymous> (bundle.js:75:1539)
    at <anonymous> (prelude.js:64:24)

thread 'main' (24552) has overflowed its stack

bundle.js:75:2108 is the FileReader.readAsDataURL polyfill, and :1539 is the _read timer that calls it. It passes a whole blob to String.fromCharCode(...bytes), so each byte becomes a separate argument. The overflow happened right after symphonia_format_isomp4 parsed an MP4 at startup.

Still present at HEAD (a983349)

  • sdk/ui/src/platform/blob.ts:167: readAsBinaryString
  • sdk/ui/src/platform/blob.ts:170: readAsDataURL
  • sdk/ui/src/platform/fetch.ts:331: request body
  • sdk/ui/src/platform/audio.ts:198: WebSocket.send binary

sdk/ui/src/dom/document.ts:176 already splits the conversion into 0x8000-byte pieces. These four sites could do the same.

What fixed it locally

  1. Replaced the 4 spread calls in the built feed/page/app.js and artifact.js with a 1 KB-chunked String.fromCharCode.apply. After that, the JS stack trace was gone, but the overflow continued in native code.
  2. Raised raea-page-host.exe's stack reserve from 1 MB to 8+ MB. With that, it launches and runs. I see v0.1.2-rc3 now sets 8 MB in .cargo/config.toml; the rc3 raea-page-host.exe shows an 8 MB reserve, so that part is fixed.

Also seen on Windows

  • 0.1.1 renders the UI at 1x and stretches it (blurry/pixelated at 150%). rc3 fixes it: the log shows a 2160x1350 page for a 1440x900 window.
  • raea-page: a frame's script /artifact.js isn't a file inside the page's root appears on every launch, even though feed\page\artifact.js exists. RAEA_PAGE_ROOT is a ;-separated list on Windows. Not investigated further.
  • v0.1.2-rc3 has only a windows-x86_64.zip (binaries), with no .app.exe. To try it, I swapped raea\ inside an existing 0.1.1 app install.
  • The 0.1.1 installer's folder under %LOCALAPPDATA%\Programs\raea grants Users only read/execute (only Administrators can write), so it can't be patched or updated in place without admin.

Activity

  1. added a commit that references this issue on Nov 13, 2026
  2. shinyobjectz commented on Nov 13, 2026

    @shinyobjectz
    Owner

    Thank you for tracking this down so precisely. It's fixed on main for 0.1.2:

    • The spread: the four sites you found, plus a fifth in the native node shim's Buffer#toString('latin1'), now go through one helper that converts a 32 KB slice at a time. A test runs a 4 MB buffer through it, where the spread throws.
    • The stack: as you saw, rc3 already gives every Windows executable an 8 MB main-thread stack (Windows app: raea-page-host.exe crashes with a main-thread stack overflow (1 MB stack, 0xc000041d) #112).
    • /artifact.js isn't a file inside the page's root: the cause was the drive letter, not the ; list. Resolved against a page at file:///C:/..., /artifact.js becomes C:\artifact.js. The check that looks for a root-absolute path under each root only stripped a leading /, which a Windows path doesn't have. It now drops the drive and root before joining.
    • 1x scaling: fixed in rc3, as you saw (Page: give Blitz its viewport in device pixels (a Retina window's interface sits in a quarter of it) #120).
    • No .exe on the rc: release candidates ship engine binaries only. The app installer is built when the release is published.
    • Install folder permissions: the installer runs as you (no admin) into %LOCALAPPDATA%\Programs\raea, so the files belong to your user. If you see Users with only read/execute, it may be an inherited entry beside your own user's full control, or a run of the installer as administrator. The Windows app doesn't update itself yet: 0.1.2's installer replaces 0.1.1 in place.

    Could you confirm on the 0.1.2 installer once it's out?

  3. added
    needs confirmingFixed in a build; waiting for the reporter to confirm it on their machine
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs confirmingFixed in a build; waiting for the reporter to confirm it on their machine

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions