Summary: | Discover asserts in Category::sortCategories | ||
---|---|---|---|
Product: | [Applications] Discover | Reporter: | Miste Lee <asd3245908066> |
Component: | discover | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | 4sfvnla7, aleixpol, arsenijnochevnyj, d3d5, gunanovo, hyperrecursion, nate, nicolas.fella, postix, rybshchun, sitter |
Priority: | HI | Keywords: | drkonqi, qt6 |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 6.1.4 | |
Sentry Crash Report: |
Description
Miste Lee
2024-02-14 00:57:39 UTC
https://discuss.kde.org/t/plasma6-discover-crashed-when-startup-in-simplified-chinese-locale/11337 suggests this happens only when the locale is set to chinese, but even with that I can't reproduce *** Bug 482046 has been marked as a duplicate of this bug. *** *** Bug 483043 has been marked as a duplicate of this bug. *** I think I have encountered the same bug (ASSERT: "isSorted(cats)" in file ./libdiscover/Category/Category.cpp, line 240). Some of my observations: 1) the KDE neon was installed in Simplified Chinese. At this moment Discover could be opened normally (if I correctly recall). 2) after at most one day (with many things like update packages, install nvidia driver, etc.), Discover started to crash with the error above. At this moment I could circumvent it with LC_ALL=en_US.utf8. 3) after several days, the workaround in 2) stopped working (crash with the same error). I can still circumvent it with LC_ALL=POSIX or LC_ALL=C (C.utf8 or ja_JP.utf8 crash with the same error); the workaround does not affect display of CJK characters in Discover. I installed Japanese as 2nd language in system settings in the meantime; idk if that's relevant. KDE neon 6.0, Plasma 6.0.2, Framework 6.0.0, Qt 6.6.2, Linux 6.5.0-25-generic x86-64, wayland. *** Bug 484331 has been marked as a duplicate of this bug. *** I find it suspicious that this only happens on neon. Sentry trace also only has neon https://crash-reports.kde.org/organizations/kde/issues/3676 Found the problem. The hints about only some languages being affected was incredibly helpful! What happens is that some languages have ambiguous translations of category names e.g. msgctxt "Category" msgid "Simulation" msgstr "模拟" vs. msgctxt "Category" msgid "Emulators" msgstr "模拟" which then trips up implicit uniqueness requirements we have in our assertions. It also plain makes no sense to have the same translation used for different categories. They need to be disambiguated one way or another or the user won't be able to differentiate what they are. The reason only neon is affected is probably because it builds with assertions on. A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/830 *** Bug 486797 has been marked as a duplicate of this bug. *** *** Bug 487070 has been marked as a duplicate of this bug. *** Git commit 40995bd1c41f19f9bba259081ffc11afd3a853cf by Harald Sitter. Committed on 21/07/2024 at 20:00. Pushed by sitter into branch 'master'. category: assert names aren't duplicated this is an implicit requirement of our sorting logic that can break when categories are non-uniquely translated specifically it makes no sense to have ambiguous category names on the same "level", the user isn't able to tell them apart (in particular also in a a11y context -- e.g. screenreaders). so it makes no sense at all guard against this with a simplistic test that loads all categories in all known languages M +18 -5 libdiscover/Category/CategoriesReader.cpp M +5 -2 libdiscover/Category/CategoriesReader.h M +73 -5 libdiscover/Category/Category.cpp M +11 -1 libdiscover/Category/Category.h M +27 -1 libdiscover/tests/CategoriesTest.cpp https://invent.kde.org/plasma/discover/-/commit/40995bd1c41f19f9bba259081ffc11afd3a853cf A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/880 Git commit 9188ab187ff428b473c82cd3e13dc85963b04363 by Harald Sitter. Committed on 22/07/2024 at 06:04. Pushed by sitter into branch 'Plasma/6.1'. category: assert names aren't duplicated this is an implicit requirement of our sorting logic that can break when categories are non-uniquely translated specifically it makes no sense to have ambiguous category names on the same "level", the user isn't able to tell them apart (in particular also in a a11y context -- e.g. screenreaders). so it makes no sense at all guard against this with a simplistic test that loads all categories in all known languages (cherry picked from commit 40995bd1c41f19f9bba259081ffc11afd3a853cf) Co-authored-by: Harald Sitter <sitter@kde.org> M +18 -5 libdiscover/Category/CategoriesReader.cpp M +5 -2 libdiscover/Category/CategoriesReader.h M +73 -5 libdiscover/Category/Category.cpp M +11 -1 libdiscover/Category/Category.h M +27 -1 libdiscover/tests/CategoriesTest.cpp https://invent.kde.org/plasma/discover/-/commit/9188ab187ff428b473c82cd3e13dc85963b04363 Should be fixed as per the commits. Translations now get checked for validity by the CI and as a second line of defense we disable them at runtime should a malformed translation make it through to production. |