Open Jose-Moreno opened 8 years ago
OK, thank you @Jose-Moreno for so many clues. I'll try to fix the case C first, and keep track on other 2 cases.
@chchwy I forgot that Case B had a password. The password is "pencil" without quotes.
Last week someone reported they had another crash and it soft-wiped their pencil file only. This happened when coloring. I've read accounts on tumblr that describe a similar occurence when they tried to color. Everytime it happens when they have a lot of frames. I think we have to review how Pencil2D manages the memory allocation of images, because I've made tests on my own and everytime I create a bunch of new empty frames the memory footprint left by the software becomes huge. Considering that it is also reading and writing data constantly there must be a way to optimize and thus eliminate these much hated crashes.
I'm trying to advertise for coders without much luck and I'm really busy due to my job so I can't be helping as much as I want. Hope things are well, talk to you soon!
I'm really interested in solving this issues to use be able to use this software at work.
For CASE A.I think that some complex error or memory exhaustation is causing error at loading file. When an error at loading happends then call this function.
Object* FileManager::cleanUpWithErrorCode( Status error ) { mError = error; removePFFTmpDirectory( mstrLastTempFolder ); return nullptr; }
and could cause deletion of project files.
Case C fixed. 20891445508a9e238f67fd3491ec8a409684f9fa
[2018 Review] For the past 2 years thanks to chchwy's work these cases have become less and less.
Case B seems to remain elusive but lately the only thing that happens is that the XML file disappears, so at least the whole project does not corrupt and makes it possible to extract the files, however a secondary coordinate file (an autosaved backup text file or similar) would be great.
For CASE A, I think that it might still have to do with the new save bug, it's just that perhaps before the thing crashed silently and corrupted the files, whereas today the manager is crashing first so even though people can't save, the project as a whole is not getting damaged (theya r eonly losing their session work).
Once we fix those I'll close this as I think lately there's not been a single report where the projects have been wiped clean like before.
--Issue Overview--
This is perhaps the most complex bug to date in Pencil2D, there are several case-scenarios that need to be addressed, but I believe they all relate to the same memory management problem within Pencil2D.
CASE A: Pencil2D Save & Silent File Wipe:
In this case, several reports indicate that people have been saving their files "normally" in different OS, however when they reopen the files everything inside the file has been erased without a clear error warning.
Reference Forum Threads:
CASE B: Pencil2D Crash & File Wipe / Corruption
In this case Pencil distinctively crashes once and completely corrupts the PCL file, as well as the .data folder and every other file inside of it.
Reference Forum Threads:
There is another situation where the user shared their project. Every file had different file sizes consistent with having data, but it wouldn't open in any way, so I looked at them with a HEX Editor and everything inside was "zeored", meaning that the bytesize was kind of "dead weight" as every bit was reset to 0.The original thread for this problem was deleted somehow (or I couldn't find it), but some details were shared roughly as follows: The project had A LOT of frames, the user had the first crash at around ~300 frames, and had to restart everything, then had a second crash at ~200 frames. Both resulted in the same corruption pattern, I was shared the project with everything, I'll put a password on it so only devs can use it with tact as I don't know if there is copyrighted material inside.
CASE C: Pencil2D Crash, Working File, Crashes when Opened.
In this case, Pencil2D crashes (most likely due to the memory leak) and when people try to open the file the file jsut won't open and Pencil crashes again. However the file is still potentially working, a.k.a not corrupted. It seems there is a distinct relationship of this branch of the problem appearing due to the new PCLX filetype and how it handles the information contained within, but it has also happened with PCL files.
In this particular story the user shared the problem file. This file can only be opened in November 23rd 2015 Nightly Build, it crashes with any other NB after said version. http://www.pencil2d.org/forums/topic/opening-a-pcxl-crashes-pencil2d-cant-find-png-files/
--System Information-- Pencil2D Nightly Build 1st JULY 2016 (I can reproduce CASE C with this version) Windows 7 64bits SP1 ATI Radeon HD 6770 1GB AMD Phenom II X4 965 BE 3.4 GHZ 4 GB RAM