Summary: | Crash after closing audio project | ||
---|---|---|---|
Product: | [Applications] k3b | Reporter: | Mark <phobian> |
Component: | Audio Project | Assignee: | k3b developers <k3b> |
Status: | RESOLVED WORKSFORME | ||
Severity: | crash | CC: | bugseforuns, michalm, trueg, zhaixiang |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Mark
2017-08-22 10:11:55 UTC
this crash was fixed in k3b 17.08. https://bugs.kde.org/show_bug.cgi?id=381863 I'm using latest GIT. Crash is not fixed. Weird, I can't reproduce the crash with K3b 17.08 from Arch repositories. Not sure what I can add. k3b is GIT cloned less than a day ago. All Qt, Plasma, KDE is compiled from source with no added patches. For me, this has been a consistent bug since the Qt5 port. Can try looking further into it in the next few days. Hi Mark, > I'm using latest GIT. Crash is not fixed. Let's find out the root cause! please enable -g: $ mkdir build $ cd build $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Debug \ -DKDE_INSTALL_LIBDIR=lib \ -DKDE_INSTALL_LIBEXECDIR=lib \ -DBUILD_TESTING=ON \ -DK3B_ENABLE_PERMISSION_HELPER=ON $ make -j4 gdb ./build/src/k3b then set breakpoint b libk3b/plugin/k3baudiodecoder.cpp:549 r Creating an audio project, adding tracks, then closing it, goto breakpoint, then p d->metaDataCollection and backtrace show there might be issue during the destructor of KFileMetaData::Extractor, so please download kfilemetadata-5.36.0's tarball https://download.kde.org/stable/frameworks/5.36/kfilemetadata-5.36.0.tar.xz $ tar xvf kfilemetadata-5.36.0.tar.xz $ cd kfilemetadata-5.36.0 add -g for CMakesList.txt: diff --git a/CMakeLists.txt b/CMakeLists.txt index acedc03..4db0051 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,7 @@ endif() # TYPE OPTIONAL PURPOSE "Support for mobi metadata") add_definitions(-DTRANSLATION_DOMAIN=\"kfilemetadata5\") +add_definitions(-g) add_subdirectory(src) if (BUILD_TESTING) $ mkdir build $ cd build $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr \ -DKDE_INSTALL_LIBDIR=lib $ make -j4 # make install then it is able to set breakpoint for the destructor of KFileMetaData::Extractor b /yourpath/kfilemetadata/src/extractor.cpp:32 p d->m_plugin Regards, Leslie Zhai Hi Leslie, A quick reply, running out of time today but got a bit more info into my backtrace. I'll do more in next day or two. Lastest bt after gdb ./build/src/k3b b libk3b/plugin/k3baudiodecoder.cpp:549 No symbol "d" in current context. (gdb) bt #0 0x0000000000000000 in () #1 0x00007fffede65884 in KFileMetaData::Extractor::~Extractor() () at /opt/kf5/lib/libKF5FileMetaData.so.3 #2 0x00007fffede658a9 in KFileMetaData::Extractor::~Extractor() () at /opt/kf5/lib/libKF5FileMetaData.so.3 #3 0x00007fffede66ece in KFileMetaData::ExtractorCollection::~ExtractorCollection() () at /opt/kf5/lib/libKF5FileMetaData.so.3 #4 0x00007fffede66f49 in KFileMetaData::ExtractorCollection::~ExtractorCollection() () at /opt/kf5/lib/libKF5FileMetaData.so.3 #5 0x00007ffff7a75983 in K3b::AudioDecoder::cleanup() (this=0x1156310) at /home/mark/Downloads/k3b/libk3b/plugin/k3baudiodecoder.cpp:550 #6 0x00007ffff7a73d3d in K3b::AudioDecoder::~AudioDecoder() (this=0x1156310, __in_chrg=<optimized out>) at /home/mark/Downloads/k3b/libk3b/plugin/k3baudiodecoder.cpp:166 #7 0x00007fffc8dcc32e in () at /opt/kf5/lib/plugins/k3bwavedecoder.so #8 0x00007fffc8dcc34a in () at /opt/kf5/lib/plugins/k3bwavedecoder.so #9 0x00007ffff7ad2ef5 in K3b::AudioDoc::decreaseDecoderUsage(K3b::AudioDecoder*) (this=0x1038700, decoder=0x1156310) at /home/mark/Downloads/k3b/libk3b/projects/audiocd/k3baudiodoc.cpp:1056 #10 0x00007ffff7ad6e69 in K3b::AudioFile::~AudioFile() (this=0x11f35f0, __in_chrg=<optimized out>) at /home/mark/Downloads/k3b/libk3b/projects/audiocd/k3baudiofile.cpp:53 #11 0x00007ffff7ad6ea6 in K3b::AudioFile::~AudioFile() (this=0x11f35f0, __in_chrg=<optimized out>) at /home/mark/Downloads/k3b/libk3b/projects/audiocd/k3baudiofile.cpp:54 #12 0x00007ffff7ac619e in K3b::AudioTrack::~AudioTrack() (this=0x11f3250, __in_chrg=<optimized out>) at /home/mark/Downloads/k3b/libk3b/projects/audiocd/k3baudiotrack.cpp:101 #13 0x00007ffff7ac6240 in K3b::AudioTrack::~AudioTrack() (this=0x11f3250, __in_chrg=<optimized out>) at /home/mark/Downloads/k3b/libk3b/projects/audiocd/k3baudiotrack.cpp:106 #14 0x00007ffff7aca85c in K3b::AudioDoc::~AudioDoc() (this=0x1038700, __in_chrg=<optimized out>) at /home/mark/Downloads/k3b/libk3b/projects/audiocd/k3baudiodoc.cpp:101 #15 0x00007ffff7aca904 in K3b::AudioDoc::~AudioDoc() (this=0x1038700, __in_chrg=<optimized out>) at /home/mark/Downloads/k3b/libk3b/projects/audiocd/k3baudiodoc.cpp:107 #16 0x0000000000488958 in K3b::MainWindow::closeProject(K3b::Doc*) (this=0x93c740, doc=0x1038700) at /home/mark/Downloads/k3b/src/k3b.cpp:1081 #17 0x00000000004887b5 in K3b::MainWindow::slotFileClose(K3b::Doc*) (this=0x93c740, doc=0x1038700) at /home/mark/Downloads/k3b/src/k3b.cpp:1041 #18 0x00000000005ae7c0 in K3b::MainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x93c740, _c=QMetaObject::InvokeMetaMethod, _id=35, _a=0x7fffffffbf30) at /home/mark/Downloads/k3b/build/src/k3b_autogen/EWIEGA46WW/moc_k3b.cpp:300 #19 0x00007fffeef5b977 in QMetaObject::activate(QObject*, int, int, void**) () at /opt/qt5/lib/libQt5Core.so.5 #20 0x00000000005b5db1 in K3b::ProjectTabWidget::tabCloseRequested(K3b::Doc*) (this=0x973a00, _t1=0x1038700) at /home/mark/Downloads/k3b/build/src/k3b_autogen/EWIEGA46WW/moc_k3bprojecttabwidget.cpp:150 #21 0x000000000047d8c7 in K3b::ProjectTabWidget::slotTabCloseRequested(int) (this=0x973a00, index=0) at /home/mark/Downloads/k3b/src/k3bprojecttabwidget.cpp:229 #22 0x00000000005b5bdc in K3b::ProjectTabWidget::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x973a00, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0x7fffffffc0e0) at /home/mark/Downloads/k3b/build/src/k3b_autogen/EWIEGA46WW/moc_k3bprojecttabwidget.cpp:94 Mark G'Day again Leslie, No idea why but can't get a breakpoint to take in gdb. All I then get is "No symbol 'd' in current context." The info I'm providing here probably misses the crucial point but it seems to be the best I can do. After numerous runs, I've noticed that the first track is always deleted correctly. To get at least some info, I modified kfilemetadata-5.36.0/src/extractor.cpp thus: Extractor::~Extractor() { qDebug() << "---In Extractor Destructor---"; qDebug() << "\t" << "DEBUG d->m_plugin" << d->m_plugin; delete d->m_plugin; qDebug() << "\t" << "DEBUG d" << d; delete d; } and the resultant output and backtrace: (K3b::AudioDoc::increaseDecoderUsage) (K3b::AudioDoc::increaseDecoderUsage) finished (K3b::AudioDoc::slotTrackChanged K3b::AudioTrack(0x10ef0b0) (K3b::AudioDoc::slotTrackChanged done (K3b::AudioTrack::moveAfter( K3b::AudioTrack(0x11ab770) ) (K3b::AudioDoc::slotTrackChanged K3b::AudioTrack(0x10ef0b0) (K3b::AudioDoc::slotTrackChanged done (K3b::AudioDoc::AudioDoc) deleting track 1 of 3 K3b::AudioTrack(0x1101970) deleting sources. ---In Extractor Destructor--- DEBUG d->m_plugin KFileMetaData::EPubExtractor(0x1100410) DEBUG d 0x1102b80 ---In Extractor Destructor--- DEBUG d->m_plugin KFileMetaData::Exiv2Extractor(0x1104a40) DEBUG d 0x1104aa0 ---In Extractor Destructor--- DEBUG d->m_plugin KFileMetaData::FFmpegExtractor(0x1108270) DEBUG d 0x1107d50 ---In Extractor Destructor--- DEBUG d->m_plugin KFileMetaData::OdfExtractor(0x1107d70) DEBUG d 0x1109070 ---In Extractor Destructor--- DEBUG d->m_plugin KFileMetaData::Office2007Extractor(0x1107f00) DEBUG d 0x11099a0 ---In Extractor Destructor--- DEBUG d->m_plugin KFileMetaData::OfficeExtractor(0x110a7f0) DEBUG d 0x110a6e0 ---In Extractor Destructor--- DEBUG d->m_plugin KFileMetaData::PlainTextExtractor(0x110ac40) DEBUG d 0x110a8f0 ---In Extractor Destructor--- DEBUG d->m_plugin KFileMetaData::POExtractor(0x1109f90) DEBUG d 0x110a6a0 ---In Extractor Destructor--- DEBUG d->m_plugin KFileMetaData::PopplerExtractor(0x110ca00) DEBUG d 0x110ca40 ---In Extractor Destructor--- DEBUG d->m_plugin KFileMetaData::TagLibExtractor(0x110cef0) DEBUG d 0x1112fc0 finished (K3b::AudioDoc::AudioDoc) deleted. (K3b::AudioDoc::AudioDoc) deleting track 2 of 3 K3b::AudioTrack(0x11ab770) deleting sources. finished (K3b::AudioDoc::AudioDoc) deleted. (K3b::AudioDoc::AudioDoc) deleting track 3 of 3 K3b::AudioTrack(0x10ef0b0) deleting sources. ---In Extractor Destructor--- Thread 1 "k3b" received signal SIGSEGV, Segmentation fault. 0x00007ffff7f9e4e8 in ?? () (gdb) bt #0 0x00007ffff7f9e4e8 in () #1 0x00007fffeef5aa24 in operator<<(QDebug, QObject const*) () at /opt/qt5/lib/libQt5Core.so.5 #2 0x00007fffede5adf7 in KFileMetaData::Extractor::~Extractor() (this=0x10ee260, __in_chrg=<optimized out>) at /home/mark/Downloads/kfilemetadata-5.36.0/src/extractor.cpp:36 #3 0x00007fffede5af04 in KFileMetaData::Extractor::~Extractor() (this=0x10ee260, __in_chrg=<optimized out>) at /home/mark/Downloads/kfilemetadata-5.36.0/src/extractor.cpp:40 #4 0x00007fffede5e66a in qDeleteAll<QList<KFileMetaData::Extractor*>::iterator>(QList<KFileMetaData::Extractor*>::iterator, QList<KFileMetaData::Extractor*>::iterator) (begin=..., end=...) at /opt/qt5/include/QtCore/qalgorithms.h:320 #5 0x00007fffede5d1b4 in KFileMetaData::ExtractorCollection::~ExtractorCollection() (this=0x119e350, __in_chrg=<optimized out>) at /home/mark/Downloads/kfilemetadata-5.36.0/src/extractorcollection.cpp:61 #6 0x00007fffede5d1f2 in KFileMetaData::ExtractorCollection::~ExtractorCollection() (this=0x119e350, __in_chrg=<optimized out>) at /home/mark/Downloads/kfilemetadata-5.36.0/src/extractorcollection.cpp:63 #7 0x00007ffff7a75983 in K3b::AudioDecoder::cleanup() (this=0x10ee0a0) at /home/mark/Downloads/k3b/libk3b/plugin/k3baudiodecoder.cpp:550 #8 0x00007ffff7a73d3d in K3b::AudioDecoder::~AudioDecoder() (this=0x10ee0a0, __in_chrg=<optimized out>) at /home/mark/Downloads/k3b/libk3b/plugin/k3baudiodecoder.cpp:166 #9 0x00007fffc8dcc32e in () at /opt/kf5/lib/plugins/k3bwavedecoder.so #10 0x00007fffc8dcc34a in () at /opt/kf5/lib/plugins/k3bwavedecoder.so #11 0x00007ffff7ad2ef5 in K3b::AudioDoc::decreaseDecoderUsage(K3b::AudioDecode Mark Hi Mark, Thanks for your investigation. please try this patch for kfilemetadata: diff --git a/src/extractor.cpp b/src/extractor.cpp index 7becc41..e863f02 100644 --- a/src/extractor.cpp +++ b/src/extractor.cpp @@ -31,7 +31,10 @@ Extractor::Extractor() Extractor::~Extractor() { - delete d->m_plugin; + if (d->m_plugin) { + delete d->m_plugin; + d->m_plugin = NULL; + } delete d; } then try again to set breakpoint. Regards, Leslie Zhai This edit makes a workaround: Extractor::~Extractor() { //delete d->m_plugin; d->m_plugin = NULL; delete d; } Removing /opt/kf5/lib/plugins/kf5/kfilemetadata/*extractor.so also fixes the issue. So it would seem the problem is with my installation of kfilemetadata. Problem is, every other thing that depends on kfilemetadata works correctly - baloo, digikam, kdenlive. I just built Tellico and ran the test suite, all good. I only use k3b to burn audio so is it possible to make depending on kfilemetadata optional? I presume taglib would be enough. > This edit makes a workaround: > Extractor::~Extractor() > { > //delete d->m_plugin; Memory leak... > d->m_plugin = NULL; > delete d; > } > > I only use k3b to burn audio so is it possible to make depending on > kfilemetadata optional? I presume taglib would be enough. Welcome patch! Solved! ....maybe The problem seems involved between k3b and kfilemetadata. So seemed to me there might be some kind of name collision. grepped the k3b source and found clues. Now, this works for me (tried a number of times) but I don't know what other problems it would cause. src/projects/k3bprojectplugindialog.cpp:22 K3b::ProjectPluginDialog::ProjectPluginDialog( K3b::ProjectPlugin* plugin, K3b::Doc* doc, QWidget* parent ) : K3b::InteractionDialog( parent, QString(), QString(), START_BUTTON|CANCEL_BUTTON, START_BUTTON, plugin->metaObject()->className() ) //m_plugin(plugin) { m_pluginGui = plugin->createGUI( doc, this ); m_plugin is a name also used in kfilemetadata. > //m_plugin(plugin) yes, ProjectPlugin* m_plugin is Dead assignment http://www.leetcode.cn/2016/11/analyzing-code-for-kde-qt-open-source-components.html#k3b it never be used after assginment during constructor. diff --git a/src/projects/k3bprojectplugindialog.cpp b/src/projects/k3bprojectplugindialog.cpp index 994424f..84841f6 100644 --- a/src/projects/k3bprojectplugindialog.cpp +++ b/src/projects/k3bprojectplugindialog.cpp @@ -25,8 +25,7 @@ K3b::ProjectPluginDialog::ProjectPluginDialog( K3b::ProjectPlugin* plugin, K3b:: QString(), START_BUTTON|CANCEL_BUTTON, START_BUTTON, - plugin->metaObject()->className() ), - m_plugin(plugin) + plugin->metaObject()->className() ) { m_pluginGui = plugin->createGUI( doc, this ); Q_ASSERT( m_pluginGui ); diff --git a/src/projects/k3bprojectplugindialog.h b/src/projects/k3bprojectplugindialog.h index 8a085c5..a799703 100644 --- a/src/projects/k3bprojectplugindialog.h +++ b/src/projects/k3bprojectplugindialog.h @@ -36,7 +36,6 @@ namespace K3b { void loadSettings( const KConfigGroup& config ); private: - ProjectPlugin* m_plugin; ProjectPluginGUIBase* m_pluginGui; }; } but I argue that it might not the root cause... Git commit 3cbe1f53c5e79864d4594879402297db902da703 by Leslie Zhai. Committed on 25/08/2017 at 03:31. Pushed by lesliezhai into branch 'master'. Remove dead assignment private variable. M +1 -2 src/projects/k3bprojectplugindialog.cpp M +0 -1 src/projects/k3bprojectplugindialog.h https://commits.kde.org/k3b/3cbe1f53c5e79864d4594879402297db902da703 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. 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! This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now 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 Thank you for helping us make KDE software even better for everyone! |