Bug 458561

Summary: Crash on startup in QCoreApplication
Product: [Applications] krita Reporter: Tiar <tamtamy.tymona>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: crash CC: halla, penguinflyer2222
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Mint (Ubuntu based)   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Crash log for all threads

Description Tiar 2022-08-31 15:47:07 UTC
Created attachment 151739 [details]
Crash log for all threads

SUMMARY
It happens randomly, I don't see anything specific in the crash log.
Possibly I caused it myself by 148a5e9bb784d4d84ff5595 (both cases when it happened it was with that changes) but I don't see how it could be relevant...

STEPS TO REPRODUCE
1. Start Krita.
2. Possibly press some buttons (I think I was typing at the moment, both times it happened I was doing something)
3. Krita steals the focus and crashes.

OBSERVED RESULT
Segfault/crash

EXPECTED RESULT
No crash

SOFTWARE/OS VERSIONS
Krita

 Version: 5.2.0-prealpha (git 148a5e9bb7)
 Hidpi: true

Qt

  Version (compiled): 5.12.8
  Version (loaded): 5.12.8

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.13.0-35-generic
  Pretty Productname: Linux Mint 20.3
  Product Type: linuxmint
  Product Version: 20.3
  Desktop: X-Cinnamon

ADDITIONAL INFORMATION
QImage::scaled: Image is a null image
QImage::scaled: Image is a null image
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setPen: Painter not active
QPainter::drawRects: Painter not active
QObject::killTimer: Timers cannot be stopped from another thread
QObject::~QObject: Timers cannot be stopped from another thread

Thread 1 "krita" received signal SIGSEGV, Segmentation fault.
0x00007ffff5d994c6 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
(gdb) bt
#0  0x00007ffff5d994c6 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#1  0x00007ffff67b1a55 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#2  0x00007ffff67bb0f0 in QApplication::notify(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#3  0x00007ffff7cc2eae in KisApplication::notify(QObject*, QEvent*) (this=0x7fffffffdce0, receiver=0x7fffa8071c88, event=0x7fffffffd5e0) at /home/tymon/kritadev/krita/libs/ui/KisApplication.cpp:757
#4  0x00007ffff5d9980a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff5df0780 in QTimerInfoList::activateTimers() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff5df10b4 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff35a317d in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8  0x00007ffff35a3400 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007ffff35a34a3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff5df1435 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007ffff5d983ab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007ffff69b5c6d in QDialog::exec() () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#13 0x00007ffff7cc4a48 in KisApplication::checkAutosaveFiles() (this=0x7fffffffdce0) at /home/tymon/kritadev/krita/libs/ui/KisApplication.cpp:917
#14 0x00007ffff7cc583f in KisApplication::start(KisApplicationArguments const&) (this=<optimized out>, args=...) at /home/tymon/kritadev/krita/libs/ui/KisApplication.cpp:527
#15 0x000055555555d9e4 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /home/tymon/kritadev/krita/krita/main.cc:715
Comment 1 Freya Lupen 2022-08-31 23:32:20 UTC
I can reproduce this with an empty image in my Recent Documents, on 5.1.0 as well as 5.2.x. I'm almost convinced it happens more consistently when File Explorer is open and not minimized...
The same warnings are logged to the console. The warnings about stopping timers only show up preceding a crash.

The crash gives either the same backtrace as above, or this one:
Qt5Core.dll!QCoreApplication::notifyInternal2+0x73  [C:/Packaging/KritaDepsBuild/ext_qt/s/qtbase/src/corelib/kernel/qcoreapplication.cpp @ 1084]
Qt5Core.dll!QEventDispatcherWin32Private::sendTimerEvent+0xcd  [C:/Packaging/KritaDepsBuild/ext_qt/s/qtbase/src/corelib/kernel/qeventdispatcher_win.cpp @ 455]
Qt5Core.dll!qt_internal_proc+0x288  [C:/Packaging/KritaDepsBuild/ext_qt/s/qtbase/src/corelib/kernel/qeventdispatcher_win.cpp @ 239]
USER32.dll!UserCallWinProcCheckWow+0x2f8
USER32.dll!DispatchMessageWorker+0x249
Qt5Core.dll!QEventDispatcherWin32::processEvents+0x7cb  [C:/Packaging/KritaDepsBuild/ext_qt/s/qtbase/src/corelib/kernel/qeventdispatcher_win.cpp @ 642]
qwindows.dll!QWindowsGuiEventDispatcher::processEvents+0x15  [C:/Packaging/KritaDepsBuild/ext_qt/s/qtbase/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher.cpp @ 74]
Qt5Core.dll!QEventLoop::exec+0x1e5  [C:/Packaging/KritaDepsBuild/ext_qt/s/qtbase/src/corelib/kernel/qeventloop.cpp @ 138]
Qt5Core.dll!QCoreApplication::exec+0x6d  [C:/Packaging/KritaDepsBuild/ext_qt/s/qtbase/src/corelib/kernel/qcoreapplication.cpp @ 1389]
krita.dll!krita_main+0x4397  [C:/mykrita/src/krita/main.cc @ 721]
Comment 2 Halla Rempt 2022-09-20 10:16:40 UTC
The backtracens aren't very informative, though -- though Tiar's shows that the autosave dialog got opened, which is missing in Freya's backtrace. I
Comment 3 Freya Lupen 2022-09-22 14:18:41 UTC
I'm pretty sure this is the same bug as 459512. I used .psd files to reproduce it originally, and after reverting the commit that fixed that report, I cannot no longer reproduce this one.
Comment 4 Halla Rempt 2022-09-22 14:28:06 UTC
Okay, let's mark it as a duplicate.

*** This bug has been marked as a duplicate of bug 459512 ***