matteoserva / MegaFuse

MEGA client for linux, based on FUSE
Other
249 stars 79 forks source link

Crash on filesizes over 1GB #46

Open Hundter opened 8 years ago

Hundter commented 8 years ago

It seems that megafuse crashes when trying to read from a file thats bigger than 1GB. This happened while using plex to watch movie files through megafuse. Files under 1GB were loading just fine. If it's any help, it seems to happen after line 113 in MegaFuseApp.cpp printf("topen riuscito\n"); Atleast that's the last thing printed before the crash.

Edit: This issue happens at ~2GB. I'm now certain that this issue is because of the size values of files are stored in 32bit signed integers. However i can't figure out how to efficiently fix this. I have however succeded in stopping the program from crashing when reading files over 2GB. It still cant play/load the files correctly in plex though. The integers will have to be changed to unsigned 32 bit integers for double the file size or 64 bit integers to completely remove the problem.

Edit 2: I seem to have fixed the issue now. Updated some of the values around the code from size_t and int to unsigned int's. Will probably try making them 64 bit integers later. Plex loads the over 2GB files now, however it should have problems with over 4GB files. I probably changed more than what was necessary, but it seems to work. Code isn't tested properly yet. Can't upload my zip here for some reason though, use the link to grab the code instead.

https://mega.nz/#!ns9CUIoQ!mk7XF_-eRQg-apLy9e3SmCnoTtrVNF7ACYN7NEUuboI

Edit 3: As expected files over ~4.3GB crashes the program. Working on the 64 bit signed integers.

Edit 4: MegaFuse now loads programs of almost infinite filesizes. Praise 64bit integers. Program is probably full of bugs and i will have to use it for some time to sort those out. In the meantime anyone can take a look at it here:

https://mega.nz/#!S8kmTKxI!sGEokle3vNc9frez0J6V4guInp-kaluNRdOAplg5MJc

note: Make sure to compile as 64bit program.

sparomba commented 7 years ago

Thank you for this workaround! I get one error tho. When starting MegaFuse (64) with a config file the cache folder doesn't seem to get recognized anymore. I'm not sure if this is really the case or just an screen output error, because uploading/downloading works just fine. The error I get when starting with any valid config file:

caricata la variabile USERNAME con il valore caricata la variabile PASSWORD con il valore caricata la variabile APPKEY con il valore *** caricata la variabile MOUNTPOINT con il valore /home/mega/tmp Could not understand the keyword at line18: CACHEPATH

This error only appears with this 64bit version of MegaFuse.

Did you modify the Cache handling of MegaFuse?

Hundter commented 7 years ago

To be honest with you, it's a long time since i made this fix and even then it was kinda buggy. I did not get cache errors back then though but had crashes on simultaneous downloads. It's been a while since i've used the program and i feel that it has quite a lot of different oddities. I ended up getting more storage on my server instead of using mega accounts to store large files on :) Sorry if i'm not to much help.

tYYGH commented 7 years ago

Hi! CACHEPATH is a “new” parameter, from a pull request I submitted. It was probably absent from the sources that @technoten has been using. However, my pull request was very simple, so it should be very easy to apply the patch to what @technoten did :-) See here: https://github.com/matteoserva/MegaFuse/pull/36