Show backtraces on sigsegv

This commit is contained in:
Sebastian Messmer 2015-09-29 22:44:19 +02:00
parent bf02682734
commit dd39f242a2
3 changed files with 5 additions and 2 deletions

View File

@ -44,7 +44,6 @@ unique_ref<fspp::OpenFile> CryDir::createAndOpenFile(const string &name, mode_t
auto child = device()->CreateBlob();
Key childkey = child->key();
(*blob)->AddChildFile(name, childkey, mode, uid, gid);
//TODO Do we need a return value in createDir for fspp? If not, change fspp Dir interface!
auto childblob = FileBlob::InitializeEmptyFile(std::move(child));
return make_unique_ref<CryOpenFile>(std::move(childblob));
}

View File

@ -27,7 +27,6 @@ namespace cryfs {
DirBlob::DirBlob(unique_ref<Blob> blob, CryDevice *device) :
_device(device), _blob(std::move(blob)), _entries(), _changed(false) {
//TODO generally everywhere: asserts are bad, because they crash the filesystem. Rather return a fuse error!
ASSERT(magicNumber() == MagicNumbers::DIR, "Loaded blob is not a directory");
_readEntriesFromBlob();
}

View File

@ -4,6 +4,7 @@
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <messmer/cpp-utils/assert/backtrace.h>
#include "messmer/fspp/fuse/Fuse.h"
#include "messmer/fspp/impl/FilesystemImpl.h"
@ -25,6 +26,8 @@ using std::cout;
using std::endl;
using std::vector;
//TODO Support files > 4GB
void showVersion() {
cout << "CryFS Version " << version::VERSION_STRING << endl;
if (version::IS_DEV_VERSION) {
@ -48,6 +51,8 @@ void runFilesystem(const ProgramOptions &options) {
}
int main(int argc, char *argv[]) {
cpputils::showBacktraceOnSigSegv();
showVersion();
ProgramOptions options = program_options::Parser(argc, argv).parse();
runFilesystem(options);