Bug 441258 - haruna crashes when loading file
Summary: haruna crashes when loading file
Status: RESOLVED FIXED
Alias: None
Product: Haruna
Classification: Applications
Component: generic (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: george fb
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-20 17:52 UTC by Luigi Baldoni
Modified: 2021-08-24 07:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
haruna 0.7.0 console crash log (660 bytes, text/x-log)
2021-08-20 17:52 UTC, Luigi Baldoni
Details
haruna git snapshot console log (425 bytes, text/x-log)
2021-08-23 10:21 UTC, Luigi Baldoni
Details
haruna_20210823.c4057c7_gdb log (9.71 KB, text/x-log)
2021-08-24 05:41 UTC, Luigi Baldoni
Details
installed packages on leap 15.3 (827.67 KB, text/plain)
2021-08-24 06:15 UTC, george fb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luigi Baldoni 2021-08-20 17:52:09 UTC
Created attachment 140882 [details]
haruna 0.7.0 console crash log

SUMMARY
Haruna crashes after opening file

STEPS TO REPRODUCE
1. Build and install haruna 0.7.0
2. Run it
3. Open file

OBSERVED RESULT
Haruna crashes.

EXPECTED RESULT
Haruna plays the file.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Leap 15.3/5.18.6
(available in About System)
KDE Plasma Version: 5.18.6
KDE Frameworks Version: 5.76.0
Qt Version: 5.12.7

ADDITIONAL INFORMATION
plasma5-pa version 5.18.5

Same version of haruna appears to function correctly on openSUSE Tumbleweed
Comment 1 george fb 2021-08-21 06:29:50 UTC
It works if I set the style to fusion instead of org.kde.desktop, so it's something in older versions of org.kde.desktop style.
So it's not a bug in Haruna.

See https://bugs.kde.org/show_bug.cgi?id=430261.
Comment 2 Fabian Vogt 2021-08-22 12:14:12 UTC
Downstream bug report: https://bugzilla.opensuse.org/show_bug.cgi?id=1189682
Relaying here as well:

This is most likely https://bugreports.qt.io/browse/QTBUG-75605 (the referenced https://bugreports.qt.io/browse/QTBUG-75605 has a similar crash).

The reason is that BasicListItem defines a contentItem itself (which is referenced through other properties), which is immediately overwritten (before the delegate is complete) by the custom delegate in qqc2-style-crash. This triggers immediate deletion of the old contentItem, but that is still being constructed at that point.

When a component has an id assigned, it forces the engine to perform construction synchronously instead of deferred. With deferred construction, the contentItem is overwritten after construction is complete, and the deletion no longer affects an item during construction. This is why removing the id avoids the crash.

This got fixed by https://github.com/qt/qtquickcontrols2/commit/80f1186338bcf8c7d692b4fadfc46531c002c6b0, and I can confirm that with that commit applied on top of Leap 15.3's libqt5-qtquickcontrols2 package, the crash disappears.

However, it is documented as "[ChangeLog][Important Behavior Changes]", so I don't think it should be backported at this stage.

Fortunately there's a rather simple workaround (which is also recommended in the Qt documentation) which is to just omit the id. Additionally, I don't think that it makes sense to use BasicListItem and overwrite its contentItem, because there's not much of BasicListItem left and just using AbstractListItem should have the same result, but avoiding the crash.
Comment 3 george fb 2021-08-22 19:16:30 UTC
Git commit a2bf43ce527bad90353ec911c4c24412ff703445 by George Florea Bănuș.
Committed on 22/08/2021 at 19:12.
Pushed by georgefb into branch 'master'.

PlayList: remove ids from playlist items

Having ids crashes the app on older versions of Qt

M  +6    -2    src/qml/PlayListItem.qml
M  +1    -8    src/qml/PlayListItemWithThumbnail.qml

https://invent.kde.org/multimedia/haruna/commit/a2bf43ce527bad90353ec911c4c24412ff703445
Comment 4 george fb 2021-08-22 20:17:38 UTC
(In reply to Fabian Vogt from comment #2)

Thanks for the info.
Comment 5 Luigi Baldoni 2021-08-23 10:21:03 UTC
Created attachment 140973 [details]
haruna git snapshot console log
Comment 6 Luigi Baldoni 2021-08-23 10:21:20 UTC
Still failing on openSUSE Leap 15.3, see attachment.
Comment 7 Luigi Baldoni 2021-08-23 10:25:56 UTC
> Thread 1 "haruna" received signal SIGSEGV, Segmentation fault.
> 0x00007ffff2644129 in QQmlBinding::setEnabled(bool, QFlags<QQmlPropertyData::WriteFlag>) () from /usr/lib64/libQt5Qml.so.5

That's what gdb shows.
Comment 8 george fb 2021-08-23 10:28:50 UTC
I missed an id in the patch listed here. Removed it in https://invent.kde.org/multimedia/haruna/-/commit/79fa60a45ed631b102bf4975588326775eaad772 so make sure you build with that commit too.
Comment 9 Luigi Baldoni 2021-08-23 11:09:24 UTC
(In reply to george fb from comment #8)
> I missed an id in the patch listed here. Removed it in
> https://invent.kde.org/multimedia/haruna/-/commit/
> 79fa60a45ed631b102bf4975588326775eaad772 so make sure you build with that
> commit too.

The tarball I tried contains that commit. I checked the source files for good measure.
Comment 10 george fb 2021-08-23 11:20:18 UTC
I can't reproduce. I works for me on Leap 15.3.
Share the tarball your building.
Comment 11 Luigi Baldoni 2021-08-23 11:31:07 UTC
(In reply to george fb from comment #10)
> I can't reproduce. I works for me on Leap 15.3.
> Share the tarball your building.

If you have an obs account it's available here https://build.opensuse.org/package/show/home:alois/haruna-git .

Otherwise please tell me, and I'll upload it somewhere.
Comment 12 george fb 2021-08-23 11:53:17 UTC
I downloaded and installed haruna-0.7.0+git20210823.c4057c7-lp153.2.1.x86_64.rpm from https://build.opensuse.org/package/binaries/home:alois/haruna-git/openSUSE_Leap_15.3 and I could play files just fine.
Comment 13 Luigi Baldoni 2021-08-24 05:41:10 UTC
Created attachment 140993 [details]
haruna_20210823.c4057c7_gdb log

(In reply to george fb from comment #12)
> I downloaded and installed
> haruna-0.7.0+git20210823.c4057c7-lp153.2.1.x86_64.rpm from
> https://build.opensuse.org/package/binaries/home:alois/haruna-git/
> openSUSE_Leap_15.3 and I could play files just fine.

I don't know what to think. I'm seeing the same result on bare metal and in a virtual machine. Attaching gdb backtrace, hope it can shed some light.

Are you running plasma as well? Could you please include a list of the installed packages on your 15.3 system?
Comment 14 george fb 2021-08-24 06:15:26 UTC
Created attachment 140997 [details]
installed packages on leap 15.3

Try deleting the .cache folder maybe it's the same bug as  https://bugs.kde.org/show_bug.cgi?id=420877#c3
"Qt crashing on stale qmlcache files after updating"

I tested with a new user on Leap too and it works. Same on Ubuntu 20.10 where it used to crash too, but after a git pull it works.
Comment 15 Luigi Baldoni 2021-08-24 07:11:04 UTC
(In reply to george fb from comment #14)
> Try deleting the .cache folder maybe it's the same bug as 
> https://bugs.kde.org/show_bug.cgi?id=420877#c3
> "Qt crashing on stale qmlcache files after updating"

That was it!
I had no idea the cache could create such problems, sorry for the wild goose chase.