Skip to content

Fix filelight#202990

Merged
vcunat merged 2 commits intoNixOS:masterfrom
anund:fix_filelight
Nov 29, 2022
Merged

Fix filelight#202990
vcunat merged 2 commits intoNixOS:masterfrom
anund:fix_filelight

Conversation

@anund
Copy link
Contributor

@anund anund commented Nov 26, 2022

Description of changes

filelight crashes during startup with the following segfault

> filelight                  
QQmlComponent: Component is not ready
[1]    1114430 segmentation fault (core dumped)  filelight
Things done

Add missing dependency on kirigami and kquickcharts. Looks like they are needed for (at least?) v22.07.08+ see here for the commit that makes the dependency visible at build time.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@anund anund requested a review from ttuegel as a code owner November 26, 2022 06:56
@github-actions github-actions bot added the 6.topic: qt/kde Object-oriented framework for GUI creation label Nov 26, 2022
@ofborg ofborg bot requested review from FRidh and vcunat November 26, 2022 07:07
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Nov 26, 2022
@vcunat
Copy link
Member

vcunat commented Nov 26, 2022

I wonder why it won't crash on my machine.

@vcunat
Copy link
Member

vcunat commented Nov 26, 2022

🤔 Does it still print this during startup for you as well?

kf.kirigami: Failed to find a Kirigami platform plugin
(and then some other soft-errors)

The build log is also still a bit suspicious:

-- The following RUNTIME packages have not been found:

 * KF5QQC2DesktopStyle (required version >= 5.94.0)
 * org.kde.kirigami-QMLModule, QML module 'org.kde.kirigami' is a runtime dependency.
 * org.kde.quickcharts-QMLModule, QML module 'org.kde.quickcharts' is a runtime dependency.

@anund
Copy link
Contributor Author

anund commented Nov 26, 2022

It appears these all ~innocuous errors that don't indicate unique issues with the running application. I am unsure why it works for you. As a quick check, does filelight --version return filelight 22.08.3 for you?

Kirigami warning

kf.kirigami: Failed to find a Kirigami platform plugin

Comes up for kirigami based apps when either libsForQt5.qqc2-desktop-style or libsForQt5.qqc2-breeze-style are not installed. (some background). It's the first error in the runtime packages error about KF5QQC2DesktopStyle. Technically adding qqc2-desktop-style removes the warning for KF5QQC2DesktopStyle but probably causes problems if it's added to propogatedBuildInputs if users want to use qqc2-breeze-style. (I'm not sure)

Runtime deps

See the notes towards the end of #137669 (comment) and several other ~spooky references about qmlplugindump in nixpkgs.

My kde cmake extension understanding is limited. The ecm_find_qmlmodule call that adds these warnings wants to do things with the qmlplugindump at build time.

It appears systemsettings has the same behaviour with the same cmake code here

-- The following RUNTIME packages have not been found:

 * org.kde.kcm-QMLModule, QML module 'org.kde.kcm' is a runtime dependency.

Plasma?

Given these are all runtime dependencies perhaps your system has them pulled in some other way? It appears just adding the libs to your environment isn't enough to avoid a crash. (often the case when running kde apps within qt5ct rather than the full desktop install)

>nix-shell --pure -p libsForQt5.kirigami2 libsForQt5.kquickcharts filelight
[nix-shell:~/local-nixpkgs]$ filelight
QQmlComponent: Component is not ready
Segmentation fault (core dumped)

@vcunat
Copy link
Member

vcunat commented Nov 26, 2022

The version is right for me. I tried to run the build from latest master before my first reply. Yes, I have some KDE apps installed through systemPackages, so it's (theoretically) possible that some dependencies get found that way in my case.

@anund
Copy link
Contributor Author

anund commented Nov 27, 2022

The backtrace is the following (ish, getting gdb working with qt/kde things is taking a lot of time). The error when doing a dev build is line 109 and 110 when it's not. https://invent.kde.org/utilities/filelight/-/blob/v22.08.3/src/mainContext.cpp#L108-110.

#0  0x00007f5cf5cf4bc7 in __pthread_kill_implementation () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
#1  0x00007f5cf5ca7b46 in raise () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
#2  0x00007f5cf5c924b5 in abort () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
#3  0x00007f5cf62276ab in qt_message_fatal (message=<synthetic pointer>..., context=...) at global/qlogging.cpp:1914
#4  QMessageLogger::fatal (this=this@entry=0x7ffd70ac8568, msg=msg@entry=0x7f5cf651b110 "ASSERT: \"%s\" in file %s, line %d") at global/qlogging.cpp:893
#5  0x00007f5cf62265be in qt_assert (assertion=assertion@entry=0x43c141 "object", file=file@entry=0x43bf30 "/build/filelight-22.08.3/src/mainContext.cpp", line=line@entry=109) at global/qglobal.cpp:3366
#6  0x0000000000413571 in Filelight::MainContext::setupActions (this=0x7ffd70ac8ab0, engine=0x22cdb40) at /build/filelight-22.08.3/src/mainContext.cpp:109
#7  0x0000000000432b33 in Filelight::MainContext::MainContext (this=this@entry=0x7ffd70ac8ab0, parent=parent@entry=0x0) at /build/filelight-22.08.3/src/mainContext.cpp:56
#8  0x000000000041404f in main (argc=<optimized out>, argv=<optimized out>) at /build/filelight-22.08.3/src/main.cpp:76

From the source perhaps something in this QQmlComponent creation finds a fallback on your system but not for mine when it crashes. (object ends up as null post the call to create)

QQmlComponent component(engine, QUrl(QStringLiteral("qrc:/ui/Action.qml")));
QObject *object = component.create();

@vcunat vcunat merged commit 2a2f324 into NixOS:master Nov 29, 2022
@github-actions
Copy link
Contributor

Successfully created backport PR #203572 for release-22.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: qt/kde Object-oriented framework for GUI creation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants