Skip to content

Fix a crash with hardened_malloc

Heiko Becker requested to merge work/fix-crash-with-hardened_malloc into master

Palapeli crashed when starting with the backtrace below and hardened_malloc complaining about "fatal allocator error: sized deallocation mismatch (small)".

#0 0x00007ffff5cbe16c in __pthread_kill_implementation () from /usr/x86_64-pc-linux-gnu/lib/libc.so.6 #1 0x00007ffff5c6eb36 in raise () from /usr/x86_64-pc-linux-gnu/lib/libc.so.6 #2 0x00007ffff5c57835 in abort () from /usr/x86_64-pc-linux-gnu/lib/libc.so.6 #3 0x00007ffff7fb90e9 in fatal_error () from /usr/x86_64-pc-linux-gnu/lib/libhardened_malloc-light.so #4 0x00007ffff7fb9233 in deallocate_small[cold] () from /usr/x86_64-pc-linux-gnu/lib/libhardened_malloc-light.so #5 0x00007ffff7fbc2c0 in free_sized () from /usr/x86_64-pc-linux-gnu/lib/libhardened_malloc-light.so #6 0x00007ffff7fbcb8e in operator delete(void*, unsigned long) () from /usr/x86_64-pc-linux-gnu/lib/libhardened_malloc-light.so #7 0x00007ffff7f5ee99 in Pala::IntegerProperty::~IntegerProperty (this=, this=) at /var/tmp/paludis/build/kde-palapeli-scm/work/palapeli-scm/libpala/slicerproperty.cpp:169 #8 0x00007ffff7f609b6 in qDeleteAll<QList<Pala::SlicerProperty const>::const_iterator> (end=..., begin=...) at /usr/x86_64-pc-linux-gnu/include/qt6/QtCore/qalgorithms.h:27 #9 qDeleteAll<QList<Pala::SlicerProperty const> > (c=...) at /usr/x86_64-pc-linux-gnu/include/qt6/QtCore/qalgorithms.h:35 #10 Pala::Slicer::~Slicer (this=, this=) at /var/tmp/paludis/build/kde-palapeli-scm/work/palapeli-scm/libpala/slicer.cpp:36 #11 0x0000739689c5cba3 in GoldbergSlicer::~GoldbergSlicer (this=, this=) at /var/tmp/paludis/build/kde-palapeli-scm/work/palapeli-scm/slicers/goldberg/slicer-goldberg.h:16 #12 GoldbergSlicer::~GoldbergSlicer (this=, this=) at /var/tmp/paludis/build/kde-palapeli-scm/work/palapeli-scm/slicers/goldberg/slicer-goldberg.h:16 #13 0x00005555555bd1e5 in std::default_deletePala::Slicer::operator() (__ptr=0x73c9a5b9fe70, this=) at /usr/x86_64-pc-linux-gnu/include/c++/13/bits/unique_ptr.h:93 #14 std::unique_ptr<Pala::Slicer, std::default_deletePala::Slicer >::~unique_ptr (this=, this=) at /usr/x86_64-pc-linux-gnu/include/c++/13/bits/unique_ptr.h:404

Merge request reports