Bug 336678 - Crash in libkcddb when using Audex due to wrong thread abort in class AsyncMusicBrainzLookup
Summary: Crash in libkcddb when using Audex due to wrong thread abort in class AsyncMu...
Status: RESOLVED FIXED
Alias: None
Product: libkcddb
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 4.13.2
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Frank Schaefer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-24 19:14 UTC by Frank Schaefer
Modified: 2021-09-28 20:09 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
KCrash output (8.90 KB, text/plain)
2014-06-24 19:15 UTC, Frank Schaefer
Details
Patch to fix this bug (5.78 KB, patch)
2014-06-24 21:54 UTC, Frank Schaefer
Details
Patch to fix this bug (4.87 KB, patch)
2020-12-24 11:42 UTC, Frank Schaefer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Schaefer 2014-06-24 19:14:11 UTC
The Audex tool crashes from time to time when changing discs or starting a CDDB lookup manually.

The reason for the crashes is, that the destructor of class AsyncMusicBrainzLookup currently just deletes the lookup thread object and does not wait for the running thread to finish, which is evil.
See Qt documentation for QThread::~QThread():
"... Note that deleting a QThread object will not stop the execution of the thread it manages.
Deleting a running QThread (...) will probably result in a program crash."


Reproducible: Always

Steps to Reproduce:
(Artificial) method to trigger the bug reliable:
1.make sure libkcddb is compiled with musicbrainz5 support
2.insert a CD which is not yet cached in the local cddb (to make sure a new musicbrainz lookup is triggered)
3.start Audex
4.as soon as possible press the "fetch information" button (or however it is called in english) more than one time to trigger cddb lookups (if Audex is configured to fetch CDDB data automatically, one press should be enough).

Actual Results:  
Audex crashes

Expected Results:  
No crash

Audex should of course be fixed, too, to avoid useless duplicate/concurrent CDDB lookups. ;-)
Comment 1 Frank Schaefer 2014-06-24 19:15:25 UTC
Created attachment 87382 [details]
KCrash output
Comment 2 Frank Schaefer 2014-06-24 21:54:32 UTC
Created attachment 87385 [details]
Patch to fix this bug

Please review/submit.
Comment 3 Christoph Feck 2014-06-25 09:59:04 UTC
Thanks Frank for the patch! From what I see, the patch is not a source-compatible change (it removes a function from a public header). Is it possible to resolve this issue without introducing source and binary compatibility changes?
Comment 4 Frank Schaefer 2014-06-25 19:49:47 UTC
(In reply to comment #3)
> Thanks Frank for the patch! From what I see, the patch is not a
> source-compatible change (it removes a function from a public header). Is it
> possible to resolve this issue without introducing source and binary
> compatibility changes?

Hmm... what do you mean with "source-incompatible change" ?
AFAICS, AsyncMusicBrainzLookup is an internal thing and not part of the public libkcddb-API.
Comment 5 Christoph Feck 2014-06-25 21:23:33 UTC
In this case, ignore comment #3.
Comment 6 Harald Sitter 2014-06-26 06:21:14 UTC
I think what this patch needs is uploading to review board for easier review and discussion ;) http://techbase.kde.org/Development/Review_Board
Comment 7 Frank Schaefer 2014-06-28 10:03:13 UTC
See https://git.reviewboard.kde.org/r/118988/
Comment 8 Andrew Crouthamel 2018-11-01 13:43:20 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Bug Janitor Service 2018-11-16 11:33:20 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 Frank Schaefer 2018-11-25 16:02:54 UTC
This bug is still valid.
The attached patch to fix it is still valid (but would need to be rebased).

In the meantime I have sent a patch to the Audex developer that implements a workaround for this bug, so at least Audex doesn't crash anymore due to this bug.
If someone wants to reproduce the crash with Audex as described above, he needs to revert (Audex) commit 696c358cf3319.
Comment 11 Justin Zobel 2020-12-17 05:38:14 UTC
Thank you for the crash report.

As it has been a while since this was reported, can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved.

I have set the bug status to "needsinfo" pending your response, please change back to "reported" or "resolved/worksforme" when you respond, thank you.
Comment 12 Frank Schaefer 2020-12-24 11:39:58 UTC
Bug still exists in release 20.12.
Comment 13 Frank Schaefer 2020-12-24 11:42:36 UTC
Created attachment 134307 [details]
Patch to fix this bug

Updated+improved patch attached. Merry christmas !
Comment 14 Myriam Schweingruber 2020-12-24 13:19:54 UTC
Thank you for your patch and Merry Christmas to you!

Patches need to be submitted to https://invent.kde.org/multimedia/libkcddb/-/merge_requests with link to the bug report, not in the bug tracker.
Comment 15 Bug Janitor Service 2020-12-27 13:39:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/libkcddb/-/merge_requests/1
Comment 16 Bug Janitor Service 2021-06-13 13:55:30 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/libkcddb/-/merge_requests/3