In order to fix T10987 we need to apply the same fix as in commit b1a251ebb96b86c8cb, i.e. make LibarchivePlugin::doKill() return false at least for AddJobs.
However this change currently exposes the following crash:
==21862== Invalid read of size 8 ==21862== at 0x168510B2: archive_write_client_write (archive_write.c:385) ==21862== by 0x1685099B: __archive_write_filter (archive_write.c:237) ==21862== by 0x1685B385: archive_compressor_gzip_close (archive_write_add_filter_gzip.c:316) ==21862== by 0x16850A38: __archive_write_close_filter (archive_write.c:260) ==21862== by 0x1685158B: _archive_write_close (archive_write.c:524) ==21862== by 0x168501D7: archive_write_close (archive_virtual.c:68) ==21862== by 0x168517A8: _archive_write_free (archive_write.c:585) ==21862== by 0x16850194: archive_free (archive_virtual.c:62) ==21862== by 0x16850244: archive_write_free (archive_virtual.c:87) ==21862== by 0x1679CABF: LibarchivePlugin::ArchiveWriteCustomDeleter::cleanup(archive*) (libarchiveplugin.h:75) ==21862== by 0x1679ABEF: QScopedPointer<archive, LibarchivePlugin::ArchiveWriteCustomDeleter>::~QScopedPointer() (qscopedpointer.h:107) ==21862== by 0x1679DAB6: ReadWriteLibarchivePlugin::~ReadWriteLibarchivePlugin() (readwritelibarchiveplugin.cpp:51) ==21862== Address 0x135d5bd0 is 0 bytes inside a block of size 32 free'd ==21862== at 0x48399AB: free (vg_replace_malloc.c:530) ==21862== by 0x1685131A: archive_write_client_close (archive_write.c:441) ==21862== by 0x16850A38: __archive_write_close_filter (archive_write.c:260) ==21862== by 0x1685B4E0: archive_compressor_gzip_close (archive_write_add_filter_gzip.c:341) ==21862== by 0x16850A38: __archive_write_close_filter (archive_write.c:260) ==21862== by 0x1685158B: _archive_write_close (archive_write.c:524) ==21862== by 0x168501D7: archive_write_close (archive_virtual.c:68) ==21862== by 0x1679F0BB: ReadWriteLibarchivePlugin::finish(bool) (readwritelibarchiveplugin.cpp:412) ==21862== by 0x1679E747: ReadWriteLibarchivePlugin::addFiles(QVector<Kerfuffle::Archive::Entry*> const&, Kerfuffle::Archive::Entry const*, Kerfuffle::CompressionOptions const&, unsigned int) (readwritelibarchiveplugin.cpp:137) ==21862== by 0x489CEC1: Kerfuffle::AddJob::doWork() (jobs.cpp:684) ==21862== by 0x489851C: Kerfuffle::Job::Private::run() (jobs.cpp:66) ==21862== by 0x6857DEB: ??? (in /usr/lib/libQt5Core.so.5.13.0) ==21862== Block was alloc'd at ==21862== at 0x483AB65: calloc (vg_replace_malloc.c:752) ==21862== by 0x16850D6A: archive_write_client_open (archive_write.c:301) ==21862== by 0x168509F4: __archive_write_open_filter (archive_write.c:250) ==21862== by 0x1685AE04: archive_compressor_gzip_open (archive_write_add_filter_gzip.c:187) ==21862== by 0x168509F4: __archive_write_open_filter (archive_write.c:250) ==21862== by 0x16850C7A: archive_write_open (archive_write.c:480) ==21862== by 0x16857D38: archive_write_open_fd (archive_write_open_fd.c:75) ==21862== by 0x1679EA7B: ReadWriteLibarchivePlugin::initializeWriter(bool, Kerfuffle::CompressionOptions const&) (readwritelibarchiveplugin.cpp:267) ==21862== by 0x1679DD17: ReadWriteLibarchivePlugin::addFiles(QVector<Kerfuffle::Archive::Entry*> const&, Kerfuffle::Archive::Entry const*, Kerfuffle::CompressionOptions const&, unsigned int) (readwritelibarchiveplugin.cpp:67) ==21862== by 0x489CEC1: Kerfuffle::AddJob::doWork() (jobs.cpp:684) ==21862== by 0x489851C: Kerfuffle::Job::Private::run() (jobs.cpp:66) ==21862== by 0x6857DEB: ??? (in /usr/lib/libQt5Core.so.5.13.0) ==21862== ==21862== Invalid read of size 8 ==21862== at 0x168510DD: archive_write_client_write (archive_write.c:388) ==21862== by 0x1685099B: __archive_write_filter (archive_write.c:237) ==21862== by 0x1685B385: archive_compressor_gzip_close (archive_write_add_filter_gzip.c:316) ==21862== by 0x16850A38: __archive_write_close_filter (archive_write.c:260) ==21862== by 0x1685158B: _archive_write_close (archive_write.c:524) ==21862== by 0x168501D7: archive_write_close (archive_virtual.c:68) ==21862== by 0x168517A8: _archive_write_free (archive_write.c:585) ==21862== by 0x16850194: archive_free (archive_virtual.c:62) ==21862== by 0x16850244: archive_write_free (archive_virtual.c:87) ==21862== by 0x1679CABF: LibarchivePlugin::ArchiveWriteCustomDeleter::cleanup(archive*) (libarchiveplugin.h:75) ==21862== by 0x1679ABEF: QScopedPointer<archive, LibarchivePlugin::ArchiveWriteCustomDeleter>::~QScopedPointer() (qscopedpointer.h:107) ==21862== by 0x1679DAB6: ReadWriteLibarchivePlugin::~ReadWriteLibarchivePlugin() (readwritelibarchiveplugin.cpp:51) ==21862== Address 0x135d5bd0 is 0 bytes inside a block of size 32 free'd ==21862== at 0x48399AB: free (vg_replace_malloc.c:530) ==21862== by 0x1685131A: archive_write_client_close (archive_write.c:441) ==21862== by 0x16850A38: __archive_write_close_filter (archive_write.c:260) ==21862== by 0x1685B4E0: archive_compressor_gzip_close (archive_write_add_filter_gzip.c:341) ==21862== by 0x16850A38: __archive_write_close_filter (archive_write.c:260) ==21862== by 0x1685158B: _archive_write_close (archive_write.c:524) ==21862== by 0x168501D7: archive_write_close (archive_virtual.c:68) ==21862== by 0x1679F0BB: ReadWriteLibarchivePlugin::finish(bool) (readwritelibarchiveplugin.cpp:412) ==21862== by 0x1679E747: ReadWriteLibarchivePlugin::addFiles(QVector<Kerfuffle::Archive::Entry*> const&, Kerfuffle::Archive::Entry const*, Kerfuffle::CompressionOptions const&, unsigned int) (readwritelibarchiveplugin.cpp:137) ==21862== by 0x489CEC1: Kerfuffle::AddJob::doWork() (jobs.cpp:684) ==21862== by 0x489851C: Kerfuffle::Job::Private::run() (jobs.cpp:66) ==21862== by 0x6857DEB: ??? (in /usr/lib/libQt5Core.so.5.13.0) ==21862== Block was alloc'd at ==21862== at 0x483AB65: calloc (vg_replace_malloc.c:752) ==21862== by 0x16850D6A: archive_write_client_open (archive_write.c:301) ==21862== by 0x168509F4: __archive_write_open_filter (archive_write.c:250) ==21862== by 0x1685AE04: archive_compressor_gzip_open (archive_write_add_filter_gzip.c:187) ==21862== by 0x168509F4: __archive_write_open_filter (archive_write.c:250) ==21862== by 0x16850C7A: archive_write_open (archive_write.c:480) ==21862== by 0x16857D38: archive_write_open_fd (archive_write_open_fd.c:75) ==21862== by 0x1679EA7B: ReadWriteLibarchivePlugin::initializeWriter(bool, Kerfuffle::CompressionOptions const&) (readwritelibarchiveplugin.cpp:267) ==21862== by 0x1679DD17: ReadWriteLibarchivePlugin::addFiles(QVector<Kerfuffle::Archive::Entry*> const&, Kerfuffle::Archive::Entry const*, Kerfuffle::CompressionOptions const&, unsigned int) (readwritelibarchiveplugin.cpp:67) ==21862== by 0x489CEC1: Kerfuffle::AddJob::doWork() (jobs.cpp:684) ==21862== by 0x489851C: Kerfuffle::Job::Private::run() (jobs.cpp:66) ==21862== by 0x6857DEB: ??? (in /usr/lib/libQt5Core.so.5.13.0) ==21862== ==21862== Invalid read of size 4 ==21862== at 0x16857F14: file_write (archive_write_open_fd.c:125) ==21862== by 0x168510E1: archive_write_client_write (archive_write.c:387) ==21862== by 0x1685099B: __archive_write_filter (archive_write.c:237) ==21862== by 0x1685B385: archive_compressor_gzip_close (archive_write_add_filter_gzip.c:316) ==21862== by 0x16850A38: __archive_write_close_filter (archive_write.c:260) ==21862== by 0x1685158B: _archive_write_close (archive_write.c:524) ==21862== by 0x168501D7: archive_write_close (archive_virtual.c:68) ==21862== by 0x168517A8: _archive_write_free (archive_write.c:585) ==21862== by 0x16850194: archive_free (archive_virtual.c:62) ==21862== by 0x16850244: archive_write_free (archive_virtual.c:87) ==21862== by 0x1679CABF: LibarchivePlugin::ArchiveWriteCustomDeleter::cleanup(archive*) (libarchiveplugin.h:75) ==21862== by 0x1679ABEF: QScopedPointer<archive, LibarchivePlugin::ArchiveWriteCustomDeleter>::~QScopedPointer() (qscopedpointer.h:107) ==21862== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==21862== ==21862== ==21862== Process terminating with default action of signal 11 (SIGSEGV): dumping core ==21862== Access not within mapped region at address 0x0 ==21862== at 0x16857F14: file_write (archive_write_open_fd.c:125) ==21862== by 0x168510E1: archive_write_client_write (archive_write.c:387) ==21862== by 0x1685099B: __archive_write_filter (archive_write.c:237) ==21862== by 0x1685B385: archive_compressor_gzip_close (archive_write_add_filter_gzip.c:316) ==21862== by 0x16850A38: __archive_write_close_filter (archive_write.c:260) ==21862== by 0x1685158B: _archive_write_close (archive_write.c:524) ==21862== by 0x168501D7: archive_write_close (archive_virtual.c:68) ==21862== by 0x168517A8: _archive_write_free (archive_write.c:585) ==21862== by 0x16850194: archive_free (archive_virtual.c:62) ==21862== by 0x16850244: archive_write_free (archive_virtual.c:87) ==21862== by 0x1679CABF: LibarchivePlugin::ArchiveWriteCustomDeleter::cleanup(archive*) (libarchiveplugin.h:75) ==21862== by 0x1679ABEF: QScopedPointer<archive, LibarchivePlugin::ArchiveWriteCustomDeleter>::~QScopedPointer() (qscopedpointer.h:107) `
This is possibly due to m_tempFile and m_archiveWriter being class member (since @mvlabat's GSoC refactoring), while they used to be local variables in ReadWriteLibarchivePlugin::addFiles().