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

Application crashes when uploading/downloading big files #4264

Open
abugandar opened this issue Jun 10, 2017 · 11 comments
Open

Application crashes when uploading/downloading big files #4264

abugandar opened this issue Jun 10, 2017 · 11 comments
Labels
A-Media P2 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect

Comments

@abugandar
Copy link
Contributor

Description

When uploading video files above 500MB the application becomes white and freezes. After restart of the app it works but I am unable to upload a big video file. This happens only when dragging and dropping the video file.

Steps to reproduce

  • Open the app and start a chat
  • drag a video file more than 500 MB (I tried about 750MB)

I upload smaller videos 130 MB in size, it uploads, shows a player and I can play my uploaded file. I expected the same with a big video file. But it crashes.

Log: not sent

Version information

  • Platform: desktop

For the desktop app:

  • OS: Windows 8.1 32 bit
  • Version: 0.10.2
@MTRNord
Copy link
Contributor

MTRNord commented Jun 10, 2017

What is the output in the console?

@turt2live
Copy link
Member

turt2live commented Jun 10, 2017

@MTRNord
image

Edit: Slightly more information

Steps I used:

  • Find a suitably large video (1.1gb mp4/h264 in my case)
  • Drag it onto a room
  • Note that the upload bar freezes at 0B/0B for a while
  • Crash screen as shown above after several seconds

@abugandar
Copy link
Contributor Author

This issue must be fixed

@t3chguy
Copy link
Member

t3chguy commented Jun 11, 2017

@abugandar all issues must be fixed :)

@lampholder lampholder added T-Defect S-Minor Impairs non-critical functionality or suitable workarounds exist P2 labels Jun 20, 2017
@lampholder
Copy link
Member

It might be simpler to whack a max filesize on the UX for starters, though this might be a relatively easy fix to stream upload the file rather than store the whole thing in memory first.

@turt2live
Copy link
Member

I'm starting to see this happen on files as little as 100mb. Granted, my riot tab is also a few GB in size.

@Half-Shot
Copy link
Member

Basically this is a huge no-no and we should be streaming the file but I guess it's easier to be lazy and do it this way.

@Half-Shot
Copy link
Member

Half-Shot commented Sep 26, 2018

Did a little digging tonight when I couldn't upload a file. We would be better off not thumbnailing until after we have uploaded the file, because we block waiting for the video element to become ready before we upload.

EDIT: Seems to crash way before the upload stage, at https://github.com/matrix-org/matrix-react-sdk/blob/master/src/ContentMessages.js#L166

EDIT 2:

Okay so what I think is the problem, and I feel kinda dim for not spotting this sooner is that we create DataURLs for files when we thumbnail them. Now picture that with 100MB, and then a GB. Yeah? Oh dear.

Right, so the easy solution is to do something like URL.createObjectURL(videoFile); and then just be sensible to delete it after use. This creates a blob link rather than a base64 string and means the thumbnailer will appear near instantly and will not try to stream the entire contents of the file into a base 64 string.

@turt2live turt2live changed the title Application crashes when uploading big videos Application crashes when uploading/downloading big files Jun 14, 2022
@turt2live
Copy link
Member

this also applies to download

@SethFalco
Copy link

Just want to forward some of my findings and be explicit here that in impacts uploading profile pictures too.

Tested on Ubuntu 18.04, Riot 1.5.3.

  • Setting the profile picture to a 3.8 GB MKV file causes a crash.
  • Setting the profile picture to a 1.2 GB image file stalls the application. It eventually recovers, but the profile picture does not appear.

For large image files I would expect either a clear file size limit such as 1024 KB or 8 MB, and for the application to not stop responding during the uploading of the image.


Later I can confirm the behavior with the latest version of Element, for now, I just ported the information from my previous bug report.

@Yannick7777
Copy link

Yannick7777 commented Nov 27, 2024

bump as I still get problems uploading files >=1.6GB with the same symptoms as #21094.
This problem only occurs in encrypted rooms..
File uploads fail instantly and return follow generic error: The file 'test' failed to upload.
It seems like only files are affected with a size of exactly 1.6GB or more.
fallocate -l 1.599999G test creates a file which is still able to be uploaded without any problems. A file created with fallocate -l 1.6G test fails instantly tho.

Tested with version 1.11.86 on Linux and Docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Media P2 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect
Projects
None yet
Development

No branches or pull requests

9 participants