Skip to content

Crash on filesizes over 1GB #46

@Hundter

Description

@Hundter

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions