My laptop shut down in the middle of a GIt commit and corrupted a handful of files in the repository. I read some of your research and and believe this software could be very helpful for recovering some of these files, but am having problems compiling it. I know this is a few years old but would you be willing to explain some of the source code to hopefully help with these compilation errors?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My laptop shut down in the middle of a GIt commit and corrupted a handful of files in the repository. I read some of your research and and believe this software could be very helpful for recovering some of these files, but am having problems compiling it. I know this is a few years old but would you be willing to explain some of the source code to hopefully help with these compilation errors?
I went ahead and made a few changes based on make compiler errors:
- Added explicit casts (char andunsigned char as necessary) in frctype2.C, frhtml.C, and frreader.C due to type conversion errors
- Added #include <unistd.h> to resolve undeclared methods in frlocate.C, frmem.C, and frcpfile.C due to wnarrowing
- Changed false return values to nullptr return values in frclient.C due to type coversion errors
With these band-aids, ziprec compiled successfully (I also generated a .lang file using mklang). However, I'm not sure they were all appropriate as the program is causing segmentation fault errors. Any suggestions on alternate fixes for these compiler errors or direction on how to diagnose the segfaults?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The segfault in mklang turns out to be due to a new optimization based
on the assumption that 'this' will never be NULL (which my code
violates when the linked list is empty). That breaks the implicit
guard of the while loop in WordList::eraseList()....
Adding guards around those calls in main() in mklang.C fixes the
segfault. You can also compile with "make DEBUG=1" as a workaround,
since that disables the problematic optimization.
e.g.
if (frequencies)
{
frequencies->eraseList() ;
frequencies = nullptr ;
}
if (words)
{
words->eraseList() ;
words = nullptr ;
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My laptop shut down in the middle of a GIt commit and corrupted a handful of files in the repository. I read some of your research and and believe this software could be very helpful for recovering some of these files, but am having problems compiling it. I know this is a few years old but would you be willing to explain some of the source code to hopefully help with these compilation errors?
Sure, I can try to help you get the program compiled. What is your
environment (OS, compiler, etc)?
On Sat, Jun 22, 2019 at 4:11 PM Hunter
formula-hunter@users.sourceforge.net wrote:
OS --
Windows 10 Pro
v 1803
build 17134.829
compiler --
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
Ubuntu bash --
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
kernel/version: 4.4.0-17134-Microsoft #706-Microsoft Mon Apr 01 18:13:00 PST 2019
I went ahead and made a few changes based on
makecompiler errors:- Added explicit casts (
charandunsigned charas necessary) infrctype2.C,frhtml.C, andfrreader.Cdue to type conversion errors- Added
#include <unistd.h>to resolve undeclared methods infrlocate.C,frmem.C, andfrcpfile.Cdue to wnarrowing- Changed
falsereturn values tonullptrreturn values infrclient.Cdue to type coversion errorsWith these band-aids, ziprec compiled successfully (I also generated a .lang file using
mklang). However, I'm not sure they were all appropriate as the program is causing segmentation fault errors. Any suggestions on alternate fixes for these compiler errors or direction on how to diagnose the segfaults?The segfault in mklang turns out to be due to a new optimization based
on the assumption that 'this' will never be NULL (which my code
violates when the linked list is empty). That breaks the implicit
guard of the while loop in WordList::eraseList()....
Adding guards around those calls in main() in mklang.C fixes the
segfault. You can also compile with "make DEBUG=1" as a workaround,
since that disables the problematic optimization.
e.g.
if (frequencies)
{
frequencies->eraseList() ;
frequencies = nullptr ;
}
if (words)
{
words->eraseList() ;
words = nullptr ;
}
Hi!
I'm cutting start of .gz file, and started recover it, using
I'm getting segfault.
On whole file getting it too.
And on cut and whole .zip files getting it too, on reverse function, same as .gz file
Stack trace from gdb here:
Last edit: ggrcrsh 2024-08-03