https://bugs.kde.org/show_bug.cgi?id=443904
Bug ID: 443904 Summary: Crash on invalid pattern file Product: krita Version: git master (please specify the git hash!) Platform: Mint (Ubuntu based) OS: Linux Status: REPORTED Severity: normal Priority: NOR Component: File formats Assignee: krita-bugs-n...@kde.org Reporter: tamtamy.tym...@gmail.com Target Milestone: --- Created attachment 142537 --> https://bugs.kde.org/attachment.cgi?id=142537&action=edit Test pattern file SUMMARY If Krita encounters a pattern file with a wrong file suffix, it will crash because of trying incompatible data. STEPS TO REPRODUCE 1. Put the test file pattern into your `patterns/` folder in resource folder (note that it must have endinf `.png.pat`). 2. Start Krita in gdb. 3. See the crash. OBSERVED RESULT Crash EXPECTED RESULT No crash SOFTWARE/OS VERSIONS Krita Version: 5.1.0-prealpha (git ae9a8ff) Languages: en_US, en, en_US, en, en_US, en, pl_PL, pl, pl_PL, pl Hidpi: true Qt Version (compiled): 5.11.1 Version (loaded): 5.11.1 CRASH LOG (whole) terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Thread 1 "krita" received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: Nie ma takiego pliku ani katalogu. (gdb) bt #0 0x00007ffff5587ed7 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x00007ffff5569535 in __GI_abort () at abort.c:79 #2 0x00007ffff57e8911 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #3 0x00007ffff57f438c in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #4 0x00007ffff57f43f7 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #5 0x00007ffff57f46a9 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #6 0x00007ffff57e8522 in () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #7 0x00007ffff4895a28 in KoPattern::init(QByteArray&) (this=0x555559468d90, bytes=...) at /home/tymon/kritadev/krita/libs/pigment/resources/KoPattern.cpp:207 #8 0x00007ffff4896531 in KoPattern::loadPatFromDevice(QIODevice*) (this=0x555559468d90, dev=0x7fffffffcfc0) at /home/tymon/kritadev/krita/libs/pigment/resources/KoPattern.cpp:81 #9 0x00007ffff489674f in KoPattern::loadFromDevice(QIODevice*, QSharedPointer<KisResourcesInterface>) (this=0x555559468d90, dev=<optimized out>, resourcesInterface=...) at /home/tymon/kritadev/krita/libs/pigment/resources/KoPattern.cpp:148 #10 0x00007ffff6bd6fcd in KisFolderStorage::loadVersionedResource(QSharedPointer<KoResource>) (this=0x555557abb7b0, resource=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:312 #11 0x00007ffff6bcf634 in KisStoragePlugin::resource(QString const&) (this=0x555557abb7b0, url=...) at /usr/include/c++/8/bits/atomic_base.h:295 #12 0x00007ffff6ba1205 in KisResourceStorage::resource(QString const&) (this=<optimized out>, url=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:312 #13 0x00007ffff6b8a16b in KisResourceCacheDb::synchronizeStorage(QSharedPointer<KisResourceStorage>) (storage=...) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:312 #14 0x00007ffff6b9c23e in KisResourceLocator::synchronizeDb() (this=0x555557ad7840) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:330 #15 0x00007ffff6b9ca85 in KisResourceLocator::initialize(QString const&) (this=0x555557ad7840, installationResourcesLocation=...) at /home/tymon/kritadev/krita/libs/resources/KisResourceLocator.cpp:126 #16 0x00007ffff7c33056 in KisApplication::registerResources() (this=0x7fffffffdc60) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qstringbuilder.h:313 #17 0x00007ffff7c35bd7 in KisApplication::start(KisApplicationArguments const&) (this=0x7fffffffdc60, args=...) at /home/tymon/kritadev/krita/libs/ui/KisApplication.cpp:416 #18 0x000055555555d5c0 in main (argc=<optimized out>, argv=<optimized out>) at /home/tymon/kritadev/krita/krita/main.cc:672 #19 0x00007ffff556ab6b in __libc_start_main (main=0x55555555a460 <main>, argc=1, argv=0x7fffffffde48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffde38) at ../csu/libc-start.c:308 #20 0x000055555555e6ca in _start () at /home/tymon/kritadev/krita/krita/main.cc:493 -- You are receiving this mail because: You are watching all bug changes.