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

Large animated GIFs cause ImageDecoder to die #425

Open
thatoddmailbox opened this issue Jul 4, 2024 · 2 comments
Open

Large animated GIFs cause ImageDecoder to die #425

thatoddmailbox opened this issue Jul 4, 2024 · 2 comments
Labels
bug Something isn't working has repro We have a way to reproduce this bug. web compatibility

Comments

@thatoddmailbox
Copy link
Contributor

Today's Google Doodle is an animated GIF for the Fourth of July, with 72 frames. It looks like ImageDecoder tries to send back the decoded bitmaps with one fd per frame, and there is a hardcoded limit of 64 fds per transfer:

static constexpr size_t MAX_LOCAL_SOCKET_TRANSFER_FDS = 64;

if (num_fds > MAX_LOCAL_SOCKET_TRANSFER_FDS)
return Error::from_string_literal("Too many file descriptors to send");

This means that opening the Google homepage causes ImageDecoder to crash with Too many file descriptors to send. I'm not sure the best way to fix this -- I tried locally bumping MAX_LOCAL_SOCKET_TRANSFER_FDS to 128, which worked for the Google Doodle, but obviously doesn't fix the underlying issue (what if there was an animated gif with >128 frames....).


Here's the image if it's useful as a test case:
https://www.google.com/logos/doodles/2024/fourth-of-july-2024-6753651837110246-law.gif

fourth-of-july-2024-6753651837110246-law

@nico
Copy link
Contributor

nico commented Sep 18, 2024

Possibly fixed by #688?

@thatoddmailbox
Copy link
Contributor Author

Hmm, just tried it and still getting the same error:

674715.789 ImageDecoder(4097406): ConnectionFromClient(0x00006295ec91e160) (id=1931607624) had an error (Too many file descriptors to send), disconnecting.
674715.812 WebContent(4097423): ImageDecoder disconnected trying to decode image

(you can try it too, by opening the linked GIF in my original message with Ladybird.)

I think the PR you mentioned only solves a problem where the descriptors leaked, but doesn't fundamentally change the way that this works (sending an array containing one fd for each frame, hitting a limit on the array size over IPC). But the other linked PR (#1435) should fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has repro We have a way to reproduce this bug. web compatibility
Projects
None yet
Development

No branches or pull requests

3 participants