Bug 483439 - File browser crashing Strawberry and similar programs
Summary: File browser crashing Strawberry and similar programs
Status: RESOLVED FIXED
Alias: None
Product: plasma-integration
Classification: Plasma
Component: general (show other bugs)
Version: 6.0.3
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-13 13:19 UTC by Mike Koss
Modified: 2024-05-03 15:32 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: Qt 6.7.2


Attachments
Screen recording showing Strawberry crashing when using file browser (1.24 MB, video/mp4)
2024-03-13 13:19 UTC, Mike Koss
Details
Backtrace for crash described in report (40.80 KB, text/plain)
2024-03-13 14:42 UTC, Mike Koss
Details
Strawberry closing itself when canceling file open dialog (46.47 KB, text/plain)
2024-03-14 09:38 UTC, pmargeti34
Details
Qmmp closes itself after canceling file open dialog (37.84 KB, text/plain)
2024-03-14 09:46 UTC, pmargeti34
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Koss 2024-03-13 13:19:13 UTC
Created attachment 167099 [details]
Screen recording showing Strawberry crashing when using file browser

SUMMARY
Since updating my Arch setup to Plasma 6, when I do anything in Strawberry music player that involves using the file browser (e.g., trying to load a file by selecting the file in the file browser), the entire program exits.

STEPS TO REPRODUCE
1. Open Strawberry
2. In Playlist menu, choose Add File
3. Select any file or choose Cancel
4. Strawberry exits completely

OBSERVED RESULT
Strawberry completely closes and returns to its standard state when reopened; nothing selected in the file browser before closing appears.

EXPECTED RESULT
When file is selected, Strawberry should remain open and the selected file should appear in the playlist.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux Kernel 6.7.9
(available in About System)
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
In a discussion of this on the Arch Linux Reddit board, another user said that they are having the exact same problem when running Qmmp.
Comment 1 Antonio Rojas 2024-03-13 13:40:17 UTC
Please provide a backtrace

NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
Comment 2 Mike Koss 2024-03-13 14:42:33 UTC
Created attachment 167103 [details]
Backtrace for crash described in report
Comment 3 Mike Koss 2024-03-13 14:43:16 UTC
Backtrace attached
Comment 4 Antonio Rojas 2024-03-13 14:56:39 UTC
There's no crash in that gdb output. Please see https://wiki.archlinux.org/title/Debugging/Getting_traces#Getting_the_trace
Comment 5 Mike Koss 2024-03-13 15:05:35 UTC
(In reply to Antonio Rojas from comment #4)
> There's no crash in that gdb output. Please see
> https://wiki.archlinux.org/title/Debugging/Getting_traces#Getting_the_trace

I followed the instructions in that section of the Wiki to get the backtrace file I originally attached. I'm not sure how to modify what I did to obtain more information. Do you know if there's something else I can do that would be more helpful? (Sorry, this is my first time doing this kind of debugging, so I'm figuring out the process as I go.)
Comment 6 pmargeti34 2024-03-14 09:38:03 UTC
Created attachment 167156 [details]
Strawberry closing itself when canceling file open dialog

This was generated with strawberry-debug package on Archlinux running on Plasma 6.0.2
Comment 7 pmargeti34 2024-03-14 09:46:52 UTC
Created attachment 167157 [details]
Qmmp closes itself after canceling file open dialog

This trace was generated with qmmp-debug package installed
Comment 8 pmargeti34 2024-03-14 09:48:53 UTC
It seems qt6 software that uses KDE file picker dialog simply exits (without a crash). I've attached two examples, strawberry and qmmp from archlinux repos with their respective debug packages installed.
Comment 9 Antonio Rojas 2024-03-14 12:01:18 UTC
Can confirm with telegram-desktop and qmmp
Comment 10 Antonio Rojas 2024-03-16 16:17:49 UTC
*** Bug 483757 has been marked as a duplicate of this bug. ***
Comment 11 Nicolas Fella 2024-03-17 01:01:11 UTC
Cannot reproduce with Strawberry.

What's the exit code?

Are there any relevant log entries?
Comment 12 Nicolas Fella 2024-03-17 01:41:07 UTC
Actually I can reproduce if
- Strawberry is using Qt6
- The system tray icon is *not* enabled

The cause is described in https://bugs.kde.org/show_bug.cgi?id=471941. It's not really a bug in KDE code but a behavior change in Qt6 that applications need to adapt to
Comment 13 pmargeti34 2024-03-17 02:30:45 UTC
Thank you for looking into this @Nicolas Fella. I've opened an issue with Strawberry (https://github.com/strawberrymusicplayer/strawberry/issues/1401)
Comment 14 wolf.seifert 2024-03-17 13:20:16 UTC
Not only "Strawberry", many other applications will suffer from this Kf5->Kf6 change. I had the same problem with a qt6 port of "Octopi", where an innocent looking QFileDialog closed the application.

And this problem does not occur at build time, but at runtime only, making the problem even worse.

To insert a "QCoreApplication::setQuitLockEnabled(false)" is easy when you build from sources and know what to do. But what if not?

A fix on the KDE side would be very useful (e.g. in KJob or KFileWidget) and avoid many upcoming bug reports of this kind.
Comment 15 Nicolas Fella 2024-03-19 22:23:02 UTC
I don't see how it could be fixed in a way that doesn't break functionality or isn't a huge hack
Comment 16 wolf.seifert 2024-03-23 08:48:57 UTC
Deleting these lines

    // eventLoopLocker prevents QCoreApplication from exiting when the last
    // window is closed until the job has finished running
    QEventLoopLocker eventLoopLocker;

from kjob_p.h did the trick for me.

Maybe this "breaks functionality", but I could not find any documentation about this KJob feature.
Comment 18 volodarolathana 2024-04-17 19:08:57 UTC
not reproduceable with 
telegram: 4.16.7-1
xdg-desktop-portal-kde: 6.0.4-1
os: arch linux
Comment 19 equeim 2024-04-19 16:27:41 UTC
(In reply to volodarolathana from comment #18)
> not reproduceable with 
> telegram: 4.16.7-1
> xdg-desktop-portal-kde: 6.0.4-1
> os: arch linux

I don't think this issue exists with portals. When app uses portals (e.g. because of Flatpak) the file dialog is opened in a separate processusing dbus. This bug only occurs for "native" Qt apps, that open file dialog directly in-process.
Comment 20 volodarolathana 2024-04-19 16:56:48 UTC
i see, nonetheless i cant reproduce this with any of my native qt applications
Comment 21 equeim 2024-04-19 19:52:51 UTC
(In reply to volodarolathana from comment #20)
> i see, nonetheless i cant reproduce this with any of my native qt
> applications

I can reproduce it with my own app (tremotesf) on openSUSE Tumbleweed with Plasma 6.0.4 and Frameworks 6.1.0
Comment 22 Nicolas Fella 2024-05-03 15:32:37 UTC
This is fixed with https://codereview.qt-project.org/c/qt/qtbase/+/556573