Open twdragon opened 1 year ago
I investigated the reasons of such behaviour. There is an implicit construction of the SubmapSlice
object within std::map
in cartographer::io::DeserializeAndFillSubmapSlices(ProtoStreamDeserializer*, std::map<::cartographer::mapping::SubmapId, SubmapSlice>*, mapping::ValueConversionTables*
. In C++17 it leads to the creation of an uninitialized SubmapSlice
struct by the end of the container's internal storage. I am trying now to find a workaround for this issue.
I built Cartographer with Clang 15, activating Polly optimizer and C++17 for my own customized build of ROS1 for Ubuntu 22.04/Mint Linux. However, this build of Cartographer library crashes while working with Cairo submap slices. This issue exists due to unexpected calling
free()
on the content of thecairo_data
field ofSubmapSlice
structure. Below is the GDB output:Here is the cause:
The program crashes because the default destructor of
SubmapSlice
structure tries to clearcairo_data
field callingfree()
on each element.Does anyone know a workaround? And another question: does this issue come from Cairo API?