Bug 417312 - Krita nightly terminated after splash
Summary: Krita nightly terminated after splash
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: macOS (DMG) macOS
: NOR critical
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-08 17:32 UTC by Manga Tengu
Modified: 2020-03-16 19:31 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
krita-crash-macos-console.log (9.65 KB, text/plain)
2020-03-12 08:54 UTC, Sorin Sbarnea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Manga Tengu 2020-02-08 17:32:10 UTC
Launching krita ba4e484 fails. After the splash screen, krita is terminated without prompt.
Before that I was using e383c2a

STEPS TO REPRODUCE
Launch krita

OBSERVED RESULT
Krita window never shows, the process is killed after splash screen

EXPECTED RESULT
Krita launches and informs me I have won 1 million dollars (US)...

SOFTWARE/OS VERSIONS
macOS: latest


ADDITIONAL INFORMATION
I have an early 2019 15' macbook pro
Comment 1 amyspark 2020-02-08 17:35:00 UTC
The mentioned git hash is https://binary-factory.kde.org/job/Krita_Nightly_MacOS_Build/290/ .
It works correctly in Mojave 10.14.6 (MBP, early 2015).
Comment 2 Manga Tengu 2020-02-08 18:28:49 UTC
My mac has Catalina 10.15.3 (19D76)
Comment 3 vanyossi 2020-02-08 18:32:56 UTC
Tested ba4e484 on macOS 10.15.1 on early MacBook 2015 and opens normally.

Does you MacBook have a discrete and an integrated graphics card? It probably is not related, I guess the problem could be in one of the resources being loaded.

Got to ~/Library/Application Support and rename krita to krita_old. If krita opens after that then you need to find out what resource is causing the crash. Close krita and move back krita_old to krita. Now launch krita from terminal. 

- On finder: Cmd + shift + A
- Right click on krita -> show package contents
- Navigate to Contents/MacOS
- right click on "krita" and choose "open with terminal"
Read the output from the terminal, it should show the resource its failing.

On a Fresh system this is the output I get

=======
Set style "fusion"
Loading plugin "/Applications/krita.app/Contents/PlugIns/kritagaussianhighpassfilter.so" failed,  "Cannot load library /Applications/krita.app/Contents/PlugIns/kritagaussianhighpassfilter.so: (dlopen(/Applications/krita.app/Contents/PlugIns/kritagaussianhighpassfilter.so, 133): Library not loaded: @rpath/libkritaplugin.19.dylib\n  Referenced from: /Applications/krita.app/Contents/PlugIns/kritagaussianhighpassfilter.so\n  Reason: image not found)"
Loading plugin "/Applications/krita.app/Contents/PlugIns/kritapalettize.so" failed,  "Cannot load library /Applications/krita.app/Contents/PlugIns/kritapalettize.so: (dlopen(/Applications/krita.app/Contents/PlugIns/kritapalettize.so, 133): Library not loaded: @rpath/libkritaplugin.19.dylib\n  Referenced from: /Applications/krita.app/Contents/PlugIns/kritapalettize.so\n  Reason: image not found)"
Invalid profile :  "/Library/ColorSync/Profiles//WebSafeColors.icc" "Web Safe Colors"
Loading plugin "/Applications/krita.app/Contents/PlugIns/kritasnapshotdocker.so" failed,  "Cannot load library /Applications/krita.app/Contents/PlugIns/kritasnapshotdocker.so: (dlopen(/Applications/krita.app/Contents/PlugIns/kritasnapshotdocker.so, 133): Library not loaded: @rpath/libkritaplugin.19.dylib\n  Referenced from: /Applications/krita.app/Contents/PlugIns/kritasnapshotdocker.so\n  Reason: image not found)"
QObject::startTimer: Timers cannot have negative intervals
/Applications/krita.app/Contents/Frameworks/krita-python-libs/krita added to PYTHONPATH

======
Comment 4 Manga Tengu 2020-02-08 18:56:09 UTC
I did as you said (moved my krita to krita-old) still not working
Launched from terminal the way you described, then it works (but only that way). Here is the output:

macbook "pro" have 2 graphics cards, one dedicated and one integrated. And I have disabled the automatic switch a year ago so I always use the dedicated gpu
=========
No "breeze" available.
Set style "fusion"
WARNING: configured swap location is not writable, using a fall-back location "/Users/nour/Library/Application Support/krita/swap" -> "/private/var/folders/4t/xdmnfpwn7sn97qp1ygb9cwkw0000gn/T"
WARNING: configured swap location is not writable, using a fall-back location "/Users/nour/Library/Application Support/krita/swap" -> "/private/var/folders/4t/xdmnfpwn7sn97qp1ygb9cwkw0000gn/T"
Invalid profile :  "/Library/ColorSync/Profiles//WebSafeColors.icc" "Web Safe Colors"
QObject::startTimer: Timers cannot have negative intervals
WARNING: configured swap location is not writable, using a fall-back location "/Users/nour/Library/Application Support/krita/swap" -> "/private/var/folders/4t/xdmnfpwn7sn97qp1ygb9cwkw0000gn/T"
/Applications/krita.app/Contents/Frameworks/krita-python-libs/krita added to PYTHONPATH
QLayout: Attempting to add QLayout "" to QWidget "", which already has a layout
Shortcut for action  "wrap_around_mode" "&Wrap Around Mode" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
Shortcut for action  "view_ruler" "Show &Rulers" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
Shortcut for action  "view_show_guides" "Show Guides" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
Shortcut for action  "view_lock_guides" "Lock Guides" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
Shortcut for action  "new_from_visible" "&New Layer From Visible" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
Shortcut for action  "add_new_transparency_mask" "&Transparency Mask" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
Shortcut for action  "toggle_layer_visibility" "Toggle layer &visibility" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
Shortcut for action  "toggle_layer_inherit_alpha" "Toggle layer alpha &inheritance" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
Shortcut for action  "toggle_layer_alpha_lock" "Toggle layer &alpha" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
Shortcut for action  "view_toggle_painting_assistants" "S&how Painting Assistants" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
Shortcut for action  "view_toggle_assistant_previews" "Show &Assistant Previews" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
Shortcut for action  "reload_preset_action" "Reload Original Preset" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
Shortcut for action  "selectopaque" "Select &Opaque (Replace)" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
Shortcut for action  "file_export_file" "E&xport..." set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
Shortcut for action  "view_toggledockers" "&Show Dockers" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.


=============
Comment 5 Bug Janitor Service 2020-02-09 04:33:16 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 6 Halla Rempt 2020-02-17 14:53:25 UTC
Hm, no that log doesn't show anything special, I'm afraid. Does this still happen now we've got updated dependencies for macOS as well? Does it also happen if you run Krita as another user?
Comment 7 Manga Tengu 2020-02-18 08:51:23 UTC
(In reply to Boudewijn Rempt from comment #6)
> Hm, no that log doesn't show anything special, I'm afraid. Does this still
> happen now we've got updated dependencies for macOS as well? Does it also
> happen if you run Krita as another user?

Yes it still happens, even with a new session. The workaround for me is to launch krita through terminal:
open -n -a /Applications/krita.app
Comment 8 Bug Janitor Service 2020-02-19 04:33:15 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 9 Sorin Sbarnea 2020-03-12 08:54:43 UTC
Created attachment 126741 [details]
krita-crash-macos-console.log
Comment 10 Sorin Sbarnea 2020-03-12 08:57:04 UTC
I can confirm the same bug, happens on two different systems (imac 2017, mbp 2018) exactly as described. Both 4.2.9 beta and nigtly are affected but the 4.2.8 old release is not.

Also please find a way to sign nightly too, is a huge PITA to start an app that is not signed properly.

I was asked to use the debugger but guess what, when executing from CLI the bug does not happen, it seems to be specific to launching from Finder.
Comment 11 Halla Rempt 2020-03-12 10:48:58 UTC
"Also please find a way to sign nightly too, is a huge PITA to start an app that is not signed properly."

Yes, we would, _obviously_ like that as well. But at least until recently KDE didn't have an apple developer account, but that seems to have changed. And the effing notarization process (which needs to be done twice, on the app bundle _and_ on the dmg) can easily add half an hour to the build process...
Comment 12 Sorin Sbarnea 2020-03-13 17:30:46 UTC
Confirmed workarund for this bug: start the app from console with `open -n -a /Applications/krita.app` or by directly picking the executable from inside the bundle. 

* Once started, go to Settings and reselect the language. 
* Restart app.
* Now you can start the app from finder

What happens is that ~/Library/Preferences/klanguageoverridesrc is created with 
[Language]
Krita=@ByteArray(en_US)


This is enough to fix the broken launching.
Comment 13 Manga Tengu 2020-03-13 17:46:17 UTC
Deeper into weirdness :)
Indeed reselecting the language solves opening krita BUT if I open a kra file while krita is closed, it will fail and propose to relaunch. Then when I click "reopen", it will work.
I can redo it as much as I want, the first open will fail if I click a kra file rather than the krita.app
Comment 14 vanyossi 2020-03-15 01:19:29 UTC
Git commit decff9302904cc0d133025ab92b4022c6a9ea005 by Ivan Yossi.
Committed on 15/03/2020 at 01:19.
Pushed by ivany into branch 'krita/4.2'.

Fix krita crashing on splashscreen in macOS

in macOS Python >=3.7 does not like locale without the last
encoding part. Hardcoded UTF-8 to make it work on any xx_yy
lang combination. 

M  +7    -3    krita/main.cc

https://invent.kde.org/kde/krita/commit/decff9302904cc0d133025ab92b4022c6a9ea005
Comment 15 vanyossi 2020-03-15 01:27:02 UTC
Git commit d87b55a8bf1a9edeba77c18e4f12c4066e97e4e8 by Ivan Yossi.
Committed on 15/03/2020 at 01:24.
Pushed by ivany into branch 'master'.

Fix krita crashing on splashscreen in macOS

in macOS Python >=3.7 does not like locale without the last
encoding part. Hardcoded UTF-8 to make it work on any xx_yy
lang combination. 

M  +7    -3    krita/main.cc

https://invent.kde.org/kde/krita/commit/d87b55a8bf1a9edeba77c18e4f12c4066e97e4e8
Comment 16 Manga Tengu 2020-03-16 10:14:06 UTC
When opening a kra file with krita NOT launched, krita fails to start and needs to be reopened.

build 9dffafb
Comment 17 vanyossi 2020-03-16 16:01:54 UTC
(In reply to Manga Tengu from comment #16)
> When opening a kra file with krita NOT launched, krita fails to start and
> needs to be reopened.
> 
> build 9dffafb

Could you report it as a separate bug?
Comment 18 Manga Tengu 2020-03-16 19:31:53 UTC
Sure !
https://bugs.kde.org/show_bug.cgi?id=418937