Bug 420032 - Random crashes on Mac (with canvas acceleration off)
Summary: Random crashes on Mac (with canvas acceleration off)
Status: RESOLVED WORKSFORME
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.2.9
Platform: macOS (DMG) macOS
: NOR normal
Target Milestone: ---
Assignee: vanyossi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-13 14:01 UTC by Yu-Hsuan Lai
Modified: 2021-02-12 04:33 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
system.log is the crash log shown by the OS. (106.07 KB, text/plain)
2020-04-13 14:02 UTC, Yu-Hsuan Lai
Details
terminal.log is the log shown in terminal where the Krita was launched (895 bytes, text/plain)
2020-04-13 14:03 UTC, Yu-Hsuan Lai
Details
Krita Usage Log (613.97 KB, text/plain)
2020-04-14 11:58 UTC, Yu-Hsuan Lai
Details
System information (1.44 KB, text/plain)
2020-04-14 11:59 UTC, Yu-Hsuan Lai
Details
same krita instance, contradict info (256.71 KB, image/png)
2020-04-14 13:36 UTC, Yu-Hsuan Lai
Details
same krita instance, contradict info (192.18 KB, image/png)
2020-04-14 13:37 UTC, Yu-Hsuan Lai
Details
Krita Usage Log 2 (302.94 KB, text/plain)
2020-04-15 08:55 UTC, Yu-Hsuan Lai
Details
system.log is the crash log shown by the OS. (132.76 KB, text/plain)
2020-04-17 09:13 UTC, Yu-Hsuan Lai
Details
crash log from lldb (109.17 KB, application/octet-stream)
2020-06-22 18:30 UTC, Yu-Hsuan Lai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yu-Hsuan Lai 2020-04-13 14:01:57 UTC
SUMMARY
I still got random crashes on my Mac, even with canvas acceleration disabled. It happens about once a day.

STEPS TO REPRODUCE
Can't figure out the consistent reproducing steps. It seems pretty random.


OBSERVED RESULT
Crash

EXPECTED RESULT
Not crash

SOFTWARE/OS VERSIONS
macOS: 10.14.6
Krita: 4.9.2

ADDITIONAL INFORMATION
See attachment
Comment 1 Yu-Hsuan Lai 2020-04-13 14:02:20 UTC
Created attachment 127506 [details]
system.log is the crash log shown by the OS.
Comment 2 Yu-Hsuan Lai 2020-04-13 14:03:11 UTC
Created attachment 127507 [details]
terminal.log is the log shown in terminal where the Krita was launched
Comment 3 Halla Rempt 2020-04-14 09:56:07 UTC
Weird... This isn't even in Krita's own code, it looks like there are problems showing a simple combobox. Could you also attach the contents of help->show krita log for bug reports and help->show system information ?
Comment 4 Yu-Hsuan Lai 2020-04-14 11:58:37 UTC
Created attachment 127536 [details]
Krita Usage Log

This is my Krita Usage Log, but I'm not sure where the useful information is.

It crashed once at:


KRITA DID NOT CLOSE CORRECTLY
================================================================================
SESSION: 14 Apr 2020 12:43:14 +0800. Executing /Applications/krita.app/Contents/MacOS/krita
Comment 5 Yu-Hsuan Lai 2020-04-14 11:59:06 UTC
Created attachment 127537 [details]
System information
Comment 6 Yu-Hsuan Lai 2020-04-14 12:00:46 UTC
Attached. I'm not sure if this usage log covers the random crash shown in system.log tho. It might be two different crashes.
Comment 7 Halla Rempt 2020-04-14 12:30:06 UTC
Hm, could it be that there are bits and pieces of your self-compiled Krita in /Users/raincole/github/krita_buildroot/i/bin/krita.app/Contents/MacOS/krita in the path? What we're seeing are crashes deep in Qt itself, when it talks to its platform plugin.
Comment 8 Yu-Hsuan Lai 2020-04-14 13:36:07 UTC
(In reply to Boudewijn Rempt from comment #7)
> Hm, could it be that there are bits and pieces of your self-compiled Krita
> in
> /Users/raincole/github/krita_buildroot/i/bin/krita.app/Contents/MacOS/krita
> in the path? What we're seeing are crashes deep in Qt itself, when it talks
> to its platform plugin.

It sounds... likely?! Take a look at these two screenshots. One says my Krita version is 4.2.9, and one says it's 5.0.0-prealpha...!
Comment 9 Yu-Hsuan Lai 2020-04-14 13:36:59 UTC
Created attachment 127540 [details]
same krita instance, contradict info
Comment 10 Yu-Hsuan Lai 2020-04-14 13:37:20 UTC
Created attachment 127541 [details]
same krita instance, contradict info
Comment 11 Halla Rempt 2020-04-14 13:39:58 UTC
Yes, something is definitely too weird for words there. I'd make the home-built Krita inaccessible to start with, and maybe test with a clean test user.
Comment 12 Yu-Hsuan Lai 2020-04-14 13:47:24 UTC
(In reply to Boudewijn Rempt from comment #11)
> Yes, something is definitely too weird for words there. I'd make the
> home-built Krita inaccessible to start with, and maybe test with a clean
> test user.

The home-built Krita never runs actually (as I stated in https://krita-artists.org/t/improve-mac-build-instructions/5250/29, it keeps saying libKF5I18n needs Qt 5.14... but shouldn't osxbuild.sh build its own KDF framework? Why is there such a dependency conflict?).

Anyway I'd remove the home-built Krita as clean as I can and see if the problem goes away, or at least gets more exposed.
Comment 13 Halla Rempt 2020-04-14 13:50:03 UTC
Yes, it should correctly build all dependencies in the framework. I haven't managed to talk to Ivan for some days (he's in mexico, and his internet connection was flaky) and I'm in the Netherlands and was sick... And I don't know where the reference to Qt 5.14 comes from; that's not built by any of our scripts. Do you have Qt 5.14 on your mac for some other project?
Comment 14 Yu-Hsuan Lai 2020-04-14 13:56:01 UTC
(In reply to Boudewijn Rempt from comment #13)
> Yes, it should correctly build all dependencies in the framework. I haven't
> managed to talk to Ivan for some days (he's in mexico, and his internet
> connection was flaky) and I'm in the Netherlands and was sick... And I don't
> know where the reference to Qt 5.14 comes from; that's not built by any of
> our scripts. Do you have Qt 5.14 on your mac for some other project?

Yeah no hurry. I understand it's a bug tracker of open source project, not a customer support line. 

I do have Qt 5.14 installed via Homebrew (to develop an Anki plugin IIRC). Would It be relevant tho if Krita uses its own external dependencies tho?
Comment 15 Halla Rempt 2020-04-14 14:03:19 UTC
It would if cmake finds that version of Qt first and tries to build against it.
Comment 16 Yu-Hsuan Lai 2020-04-14 14:34:13 UTC
After removing the half-ass-home-built Krita, now both the "About Krita" and "Show system information" windows report Krita version 4.2.9.
Comment 17 Halla Rempt 2020-04-14 14:34:47 UTC
And is it more stable?
Comment 18 Yu-Hsuan Lai 2020-04-14 14:36:09 UTC
(In reply to Boudewijn Rempt from comment #17)
> And is it more stable?

No crash yet, but it's hard to tell for now because it only crashed one or two times a day before.
Comment 19 Yu-Hsuan Lai 2020-04-15 08:51:46 UTC
Well... the same kind of crash (same stack dump in system log) still happens even without home-built Krita.
Comment 20 Yu-Hsuan Lai 2020-04-15 08:55:53 UTC
Created attachment 127561 [details]
Krita Usage Log 2

Krita usage log. There isn't much to see tho, except this time it correctly reports Krita version of 4.2.9
Comment 21 Halla Rempt 2020-04-15 09:46:11 UTC
It might be worth it to investiage libqcocoa, since that's where the crash happens. https://forum.qt.io/topic/34280/solved-qt5-and-mac-libqcocoa/3 suggests running otool -L on libqcocoa.dylib . Maybe that has some unresolved dependencies?
Comment 22 Yu-Hsuan Lai 2020-04-15 10:05:41 UTC
(In reply to Boudewijn Rempt from comment #21)
> It might be worth it to investiage libqcocoa, since that's where the crash
> happens. https://forum.qt.io/topic/34280/solved-qt5-and-mac-libqcocoa/3
> suggests running otool -L on libqcocoa.dylib . Maybe that has some
> unresolved dependencies?

> ❯ otool -L ./Contents/PlugIns/platforms/libqcocoa.dylib
> ./Contents/PlugIns/platforms/libqcocoa.dylib:
>	libqcocoa.dylib (compatibility version 0.0.0, current version 0.0.0)
>	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1069.11.0)
>	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 162.0.0)
>	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
>	/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo (compatibility version 1.2.0, current version 1.5.0)
>	/System/Library/Frameworks/Metal.framework/Versions/A/Metal (compatibility version 1.0.0, current version 212.2.3)
>	/System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface (compatibility version 1.0.0, current version 1.0.0)
>	/usr/lib/libcups.2.dylib (compatibility version 2.0.0, current version 2.14.0)
	>. /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1673.126.0)
>	/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1348.12.4)
>	/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (compatibility version 1.0.0, current version 1.0.0)
>	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1673.126.0)
>	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
>	/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO (compatibility version 1.0.0, current version 1.0.0)
>	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1894.10.126)
	> @loader_path/../../Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.12.0, current version 5.12.7)
>	@loader_path/../../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.12.0, current version 5.12.7)
>	@loader_path/../../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.12.0, current version 5.12.7)
>	@loader_path/../../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.12.0, current version 5.12.7)
	> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
>	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
>	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
>	/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
>	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 800.7.0)
>	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
	> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 52.0.0)
> 	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

I'm not sure if there is anything abnormal here.
Comment 23 Halla Rempt 2020-04-15 10:08:44 UTC
Why are we packaging QtPrintSupport... Krita doesn't support printing. But it is present, so that's not the problem.
Comment 24 Yu-Hsuan Lai 2020-04-17 09:13:59 UTC
Created attachment 127603 [details]
system.log is the crash log shown by the OS.

Another similar crash. It happened when I pressed shift+Cmd+S to save a file under another name. But I tried to do it again and couldn't reproduce the crash.
Comment 25 Halla Rempt 2020-04-17 10:13:01 UTC
Yes... It's pretty similar. Qt wants to put a dialog on screen, and then there's a crash deep in cocoa.
Comment 26 Yu-Hsuan Lai 2020-04-17 11:40:52 UTC
(In reply to Boudewijn Rempt from comment #25)
> Yes... It's pretty similar. Qt wants to put a dialog on screen, and then
> there's a crash deep in cocoa.

Oh wait, I have "Enable native file dialogs" enabled. Do you think it's the potential problem? Should I disabled it and keep using for a while?
Comment 27 Halla Rempt 2020-04-17 12:02:25 UTC
Hm, it shouldn't matter... You can give it a try, but it's very puzzling. And I've never seen crashes like this before, either. I'll ask Ivan to chime in.
Comment 28 vanyossi 2020-04-17 17:11:30 UTC
Hi! going trouhgh the logs and the info provided I did not find anything conclusive, but I have some ideas. Another contributor helped set a better isolation environment from homebrew compiles, but apparently it did not work ery well.

I recommend you check all libraries in the build. i/lib using otool -L (for all linked libraries) and/or otool -l (for global rpath of that library), im suspecting some libraries are linked to the homebrew compiled sources instead of krita 3rdparty Qt.
Comment 29 Yu-Hsuan Lai 2020-04-18 04:05:47 UTC
(In reply to vanyossi from comment #28)
> Hi! going trouhgh the logs and the info provided I did not find anything
> conclusive, but I have some ideas. Another contributor helped set a better
> isolation environment from homebrew compiles, but apparently it did not work
> ery well.
> 
> I recommend you check all libraries in the build. i/lib using otool -L (for
> all linked libraries) and/or otool -l (for global rpath of that library), im
> suspecting some libraries are linked to the homebrew compiled sources
> instead of krita 3rdparty Qt.

But these crashes happened with official stable 4.2.9, not my home-built Krita. At the bottom of the system log, it dumps the libraries used, and it seems to link to its own Qt:

>       0x11e8ca000 -        0x11e8ddffb +sip.so (0) <C1C3FB89-751E-3E19-AB7F-1D1FFFA9F266> /Applications/krita.app/Contents/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PyQt5/sip.so
>       0x11e96d000 -        0x11e9befff +krita.so (0) <6AFF8C97-AD49-3E75-A378-004D53FE08A4> /Applications/krita.app/Contents/Frameworks/krita-python-libs/PyKrita/krita.so
>       0x11ea39000 -        0x11eba8ff3 +QtCore.so (0) <BB8DC68E-FE58-3CFE-AE34-E8A0E7519798> /Applications/krita.app/Contents/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PyQt5/QtCore.so
>       0x11ed7c000 -        0x11ef0efff +QtGui.so (0) <767C40B2-F3AD-3260-8EFC-CF6672F2CEF4> /Applications/krita.app/Contents/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PyQt5/QtGui.so
>       0x11f0fe000 -        0x11f392ffb +QtWidgets.so (0) <1CCA3B9B-D531-3AA8-A9CE-E1B1D1AC98D3> /Applications/krita.app/Contents/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PyQt5/QtWidgets.so
>       0x11f6c5000 -        0x11f6ecff3 +QtXml.so (0) <EB0AA31A-DC6E-33A4-9D02-FD80751E8910> /Applications/krita.app/Contents/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/PyQt5/QtXml.so
Comment 30 Yu-Hsuan Lai 2020-05-01 02:02:00 UTC
This particular bug doesn't seem to happen with 4.3.0. It might just be a placebo effect though. Does 4.3.0(2bae978) uses a different Qt version than 4.2.9?
Comment 31 vanyossi 2020-05-01 05:56:16 UTC
if $.3.0 deps were compiled from 4.3 branch the Qt used is:

Qt
  Version (compiled): 5.12.7
  Version (loaded): 5.12.7

You can check on Help -> Show system information for bug reports.
Comment 32 Yu-Hsuan Lai 2020-05-12 11:24:49 UTC
I've been using 4.3.0-beta1 for a while (30+ hrs) and this hasn't happened.
Comment 33 vanyossi 2020-05-13 01:44:21 UTC
Nice! I will mark this as resolved then :)
thanks for testing!
Comment 34 Yu-Hsuan Lai 2020-06-19 09:04:20 UTC
Unfortunately it happened again with 4.3.0. I'm not sure if it's regression from 4.3.0-beta1 though because it happens rather rarely (once since 4.3.0 release). Maybe I were just lucky to not get this with beta1. The system log is the same as before.
Comment 35 vanyossi 2020-06-19 16:42:33 UTC
Hi, im sorry to hear its still present, but luckily we can work on finding the cause and maybe a solution. Please attach the crash log when this happens, so i cna start investigating (old logs won't not work as code keeps changing between versions)

on macos the backtrace can be obtained like this: https://docs.krita.org/en/reference_manual/sharing_krita_logs.html#getting-backtrace-mac
Comment 36 Yu-Hsuan Lai 2020-06-22 18:30:08 UTC
Created attachment 129593 [details]
crash log from lldb

I got this crash while changing some shortcuts.
Comment 37 vanyossi 2021-01-13 20:05:17 UTC
Does this still happen to you on 4.4.2?
Comment 38 Bug Janitor Service 2021-01-28 04:33:14 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 39 Bug Janitor Service 2021-02-12 04:33:14 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!