Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skwasm: allocating memory until we crash! #143800

Closed
kevmoo opened this issue Feb 21, 2024 · 6 comments · Fixed by flutter/engine#50887 or flutter/engine#51077
Closed

skwasm: allocating memory until we crash! #143800

kevmoo opened this issue Feb 21, 2024 · 6 comments · Fixed by flutter/engine#50887 or flutter/engine#51077
Assignees
Labels
e: wasm Issues related to the wasm build of Flutter Web. e: web_skwasm Skwasm rendering backend for web

Comments

@kevmoo
Copy link
Contributor

kevmoo commented Feb 21, 2024

See https://vote-dart.web.app/

Flutter 3.20.0-10.0.pre.58 • channel master • git@github.com:flutter/flutter.git
Framework • revision 718c81704f (6 hours ago) • 2024-02-20 13:07:59 -0500
Engine • revision e16a260265
Tools • Dart 3.4.0 (build 3.4.0-157.0.dev) • DevTools 2.33.0-dev.6
@kevmoo kevmoo added e: wasm Issues related to the wasm build of Flutter Web. e: web_skwasm Skwasm rendering backend for web labels Feb 21, 2024
@kevmoo
Copy link
Contributor Author

kevmoo commented Feb 21, 2024

image

@jonahwilliams
Copy link
Member

For me this is:

Uncaught (in promise) DOMException: Failed to execute 'createImageBitmap' on 'WorkerGlobalScope': The source image height is 0.
    at Gc (https://www.gstatic.com/flutter-canvaskit/e16a260265ade2ed0240784db86144f808fec01a/skwasm.js:62:319)
    at https://www.gstatic.com/flutter-canvaskit/e16a260265ade2ed0240784db86144f808fec01a/skwasm.wasm:wasm-function[7994]:0x1e40c0
    at w._surface_renderPictureOnWorker (https://www.gstatic.com/flutter-canvaskit/e16a260265ade2ed0240784db86144f808fec01a/skwasm.js:128:374)
    at e (https://www.gstatic.com/flutter-canvaskit/e16a260265ade2ed0240784db86144f808fec01a/skwasm.js:61:236)
    ```

@eyebrowsoffire
Copy link
Contributor

I don't think this is a memory leak thing. In my repro of it, it happens immediately on the first frame, and it's trying to create an image bitmap 20 billion pixels tall, so I think that is the issue.

@eyebrowsoffire
Copy link
Contributor

I have a fix out for review for this, but it has merge conflicts because it was built on top of #140429, which had to be reverted. Relanding that is dependent on a dart issue that is being worked on. Rather than rewrite this twice, once for the old way the rendering worked and once for the new way, I'm going to wait until the Skwasm frame timing callbacks PR relands before I merge this.

auto-submit bot pushed a commit to flutter/engine that referenced this issue Feb 27, 2024
…50887)

This fixes flutter/flutter#143800, where we are attempting to capture an image that is way too large. We only need to render the part of the image that will be visible in the window.
@kevmoo
Copy link
Contributor Author

kevmoo commented Feb 29, 2024

Reopen as the fix was reverted. 3rd times the charm!

@kevmoo kevmoo reopened this Feb 29, 2024
auto-submit bot pushed a commit to flutter/engine that referenced this issue Feb 29, 2024
…ndow." (#51077)

This fixes flutter/flutter#143800, where we are attempting to capture an image that is way too large. We only need to render the part of the image that will be visible in the window.

This includes some additional fixes for regressions in the original fix.
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
e: wasm Issues related to the wasm build of Flutter Web. e: web_skwasm Skwasm rendering backend for web
Projects
None yet
3 participants