Bug 419947 - Segfault QtPrivate::RefCount::ref
Summary: Segfault QtPrivate::RefCount::ref
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (other bugs)
Version First Reported In: 4.2.9
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-11 09:41 UTC by Bart Ribbers
Modified: 2020-04-14 08:12 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bart Ribbers 2020-04-11 09:41:33 UTC
SUMMARY

Krita crashes on launch segfaulting.


STEPS TO REPRODUCE
1. Compile Krita against Musl, or install the latest package from the Alpine Linux repositories
2. Launch the program

OBSERVED RESULT
Segfaults on start

EXPECTED RESULT
Not to segfault

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Alpine Linux edge
(available in About System)
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.68.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION
Backtrace:

#0  QtPrivate::RefCount::ref (this=0x21) at /usr/include/QtCore/qrefcount.h:55
#1  0x0000555555e4d9c3 in QString::QString (other=..., this=0x7fffffffe630) at /usr/include/QtCore/qstring.h:1051
#2  main (argc=<optimized out>, argv=0x7fffffffe748) at /home/bart/Git/aports/community/krita/src/krita-4.2.9/krita/main.cc:319

Seems a bit useless, I guess I need debug symbols of QtCore as well?
Comment 1 wolthera 2020-04-11 10:16:51 UTC
That sure is a strange place to segfault, it's just asking for the first entry in a stringlist: https://invent.kde.org/kde/krita/-/blob/krita/4.2/krita/main.cc#L319

Do you kow what your locales are set to?
Comment 2 Halla Rempt 2020-04-11 10:49:17 UTC
This cannot be a bug in Krita. It must have something to do with a broken Qt package or another distribution specific bit of brokeness. Maybe starting Krita from the terminal will print out some useful information?
Comment 3 Bart Ribbers 2020-04-11 13:33:58 UTC
Locales:

LANG=C.UTF-8
LC_CTYPE=C.UTF-8
LC_NUMERIC=C.UTF-8
LC_TIME=C.UTF-8
LC_COLLATE=C.UTF-8
LC_MONETARY=C.UTF-8
LC_MESSAGES=C.UTF-8
LC_ALL=

As for running Krita in terminal giving more useful info, nope...

▶ krita
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = krita path = /usr/bin pid = 29654
KCrash: Arguments: /usr/bin/krita 
KCrash: Attempting to start /usr/lib/libexec/drkonqi from kdeinit
sock_file=/run/user/1000/kdeinit5__0
[1]  + 29654 suspended (signal)  krita
Comment 4 Halla Rempt 2020-04-11 13:52:25 UTC
Does it make a difference if you set that to en_US.UTF-8 ?
Comment 5 Bart Ribbers 2020-04-11 14:11:54 UTC
It does indeed, it runs and works fine after that.

Seems https://invent.kde.org/kde/krita/-/commit/decff9302904cc0d133025ab92b4022c6a9ea005 broke it when the locale is set to C, as uiLanguages will be empty then.
Comment 6 Halla Rempt 2020-04-11 14:30:24 UTC
Well, then I was wrong and it is a bug :-). Thanks for checking!
Comment 7 Halla Rempt 2020-04-11 14:34:03 UTC
Git commit 3349c1dba99da9963eb275ae6ac7cdb8ed0c0e1b by Boudewijn Rempt.
Committed on 11/04/2020 at 14:33.
Pushed by rempt into branch 'master'.

Check whether the uiLanguages list isn't empty

Because Qt can crash or assert on list.first() if the list is
empty.

M  +18   -17   krita/main.cc

https://invent.kde.org/kde/krita/commit/3349c1dba99da9963eb275ae6ac7cdb8ed0c0e1b
Comment 8 Bart Ribbers 2020-04-11 16:11:43 UTC
Yup, that fixes it, thanks!
Comment 9 Halla Rempt 2020-04-14 08:12:18 UTC
Git commit 885a44d5aec36863bdde875260c52116d8f8e132 by Boudewijn Rempt.
Committed on 14/04/2020 at 08:11.
Pushed by rempt into branch 'krita/4.3'.

Check whether the uiLanguages list isn't empty

Because Qt can crash or assert on list.first() if the list is
empty.

M  +18   -17   krita/main.cc

https://invent.kde.org/kde/krita/commit/885a44d5aec36863bdde875260c52116d8f8e132