Skip to content

Commit

Permalink
Fix a seqfault which occured when loading large maps
Browse files Browse the repository at this point in the history
  • Loading branch information
lennarthaller committed Jul 25, 2019
1 parent c67a6c4 commit b507ce8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions orb_slam2/src/System.cc
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,13 @@ bool System::LoadMap(const string &filename) {
return false;
}

const rlim_t kNewStackSize = 64L * 1024L * 1024L; // min stack size = 64 Mb
const rlim_t kDefaultCallStackSize = GetCurrentCallStackSize();
if (!SetCallStackSize(kNewStackSize)) {
std::cerr << "Error changing the call stack size; Aborting" << std::endl;
return false;
}

std::cout << "Loading map file: " << map_file << std::flush;
boost::archive::binary_iarchive ia(in, boost::archive::no_header);
ia >> mpMap;
Expand All @@ -638,6 +645,8 @@ bool System::LoadMap(const string &filename) {

std::cout << " ... done" << std::endl;
in.close();

SetCallStackSize(kDefaultCallStackSize);

return true;
}
Expand Down

0 comments on commit b507ce8

Please sign in to comment.