Bug 431422

Summary: Elisa intermittently crashed in KFileMetaData::Property::Property() when fetching lyrics tag
Product: [Applications] Elisa Reporter: Be <be.0>
Component: generalAssignee: Matthieu Gallien <matthieu_gallien>
Status: RESOLVED FIXED    
Severity: normal CC: nate, stefan.bruens
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=458607
Latest Commit: Version Fixed In: 20.12.2
Attachments: backtrace of the crash

Description Be 2021-01-11 05:33:50 UTC
Created attachment 134728 [details]
backtrace of the crash

SUMMARY
This crash occurs sometimes at the end of a track before starting to play the next one. See attached backtrace.


SOFTWARE/OS VERSIONS
Elisa: master branch, commit 422afda69bad7160f86c3d0607ab4487ccd94ce6
Linux: Fedora 33 
KDE Frameworks Version: 5.78
Qt Version: 5.15.2
Comment 1 Nate Graham 2021-01-11 22:51:35 UTC
Crash is somewhere in KFileMetadata while trying to fetch lyrics; moving.

Do you have Baloo indexing turned off?

Is there any pattern? Does it always crash on one file or a set of files? Do all of the files that is crashes while trying to load have lyrics tags? Or do none of them? Or is it random?
Comment 2 Be 2021-01-12 04:27:23 UTC
In Elisa's preferences "Music indexing" defaulted to "Scan the filesystem directly". I tried switching that to "Use fast native indexer" but the crash still occurs.

There is no pattern other than it happens at the end of tracks. It does not happen consistently with any particular files.

AFAIK none of my files have lyrics tags. I just checked some files in Picard and did not see any lyrics tags.
Comment 3 Nate Graham 2021-01-12 19:51:41 UTC
Thanks.
Comment 4 Stefan Brüns 2021-01-22 16:25:55 UTC
@ngraham: The crash is in elisa, when iterating a QMap coming from KFM. Please provide any proof the QMap is incorrect. This has to be investigated in elisa first.
Comment 5 Matthieu Gallien 2021-01-22 18:41:03 UTC
(In reply to Stefan Brüns from comment #4)
> @ngraham: The crash is in elisa, when iterating a QMap coming from KFM.
> Please provide any proof the QMap is incorrect. This has to be investigated
> in elisa first.

I wanted to have a look as soon as I can to the different crashes including this one.

I have just noticed that the flatpak build seems mostly unaffected while a local build is crashing on me at each track changes.
Comment 6 Matthieu Gallien 2021-01-22 22:12:46 UTC
So this is a stupid concurrent access on one attributes of an object all within elisa's code.
Comment 7 Bug Janitor Service 2021-01-22 22:58:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/elisa/-/merge_requests/215
Comment 8 Matthieu Gallien 2021-01-23 22:47:29 UTC
Git commit e2845b589170de36851ff37d36d76697adde7440 by Matthieu Gallien.
Committed on 22/01/2021 at 22:51.
Pushed by mgallien into branch 'release/20.12'.

avoid concurrent access when fetching lyrics

M  +4    -2    src/models/trackmetadatamodel.cpp
M  +3    -0    src/models/trackmetadatamodel.h

https://invent.kde.org/multimedia/elisa/commit/e2845b589170de36851ff37d36d76697adde7440