Bug 446551

Summary: crash during audio file metadata import
Product: tellico Reporter: mark <mark>
Component: generalAssignee: Robby Stephenson <robby>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: 3.4.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 3.4.3
Attachments: podcast file that will crash tellico

Description mark 2021-12-06 13:11:50 UTC
SUMMARY
***
after upgrading  from tellico-3.4.1-1.fc34.x86_64  to  tellico-3.4.2-2.fc34.x86_64 
tellico crashes when scanning audio file metadata.  


STEPS TO REPRODUCE
1. upgrade to 3.4.2
2.  run import audio file metadata
3. crashes

OBSERVED RESULT
crash

EXPECTED RESULT
complete all file scanning

SOFTWARE/OS VERSIONS
Operating System: Fedora 34
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2
Kernel Version: 5.14.18-200.fc34.x86_64 (64-bit)
Graphics Platform: X11
Processors: 4 × AMD FX-8370E Eight-Core Processor
Memory: 11.7 GiB of RAM
Graphics Processor: llvmpipe

ADDITIONAL INFORMATION
the majority of my tag metadata is from musicbrainz

the traceback:


Application: Tellico (tellico), signal: Segmentation fault

[KCrash Handler]
#4  0x00007fd5c5e7ea68 in TagLib::String::size() const () from /lib64/libtag.so.1
#5  0x00007fd5c5e8fe65 in TagLib::String::data(TagLib::String::Type) const () from /lib64/libtag.so.1
#6  0x00007fd5c5e81f23 in TagLib::String::to8Bit[abi:cxx11](bool) const () from /lib64/libtag.so.1
#7  0x00007fd5c5e81fc7 in TagLib::String::toCString(bool) const () from /lib64/libtag.so.1
#8  0x0000561966d966d3 in Tellico::Import::AudioFileImporter::collection() ()
#9  0x0000561966cb34d9 in Tellico::MainWindow::importFile(Tellico::Import::Format, QList<QUrl> const&) ()
#10 0x0000561966ca0e38 in Tellico::MainWindow::slotFileImport(int) ()
#11 0x00007fd5c3a9a3c9 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#12 0x00007fd5c3a9af65 in QSignalMapper::mappedInt(int) () from /lib64/libQt5Core.so.5
#13 0x00007fd5c3a9c840 in QSignalMapperPrivate::emitMappedValues(QObject*) () from /lib64/libQt5Core.so.5
#14 0x00007fd5c3a9a3c9 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#15 0x00007fd5c485f916 in QAction::triggered(bool) () from /lib64/libQt5Widgets.so.5
#16 0x00007fd5c486262c in QAction::activate(QAction::ActionEvent) () from /lib64/libQt5Widgets.so.5
#17 0x00007fd5c49ec5f2 in QMenuPrivate::activateCausedStack(QVector<QPointer<QWidget> > const&, QAction*, QAction::ActionEvent, bool) () from /lib64/libQt5Widgets.so.5
#18 0x00007fd5c49f41b9 in QMenuPrivate::activateAction(QAction*, QAction::ActionEvent, bool) () from /lib64/libQt5Widgets.so.5
#19 0x00007fd5c48a8e7e in QWidget::event(QEvent*) () from /lib64/libQt5Widgets.so.5
#20 0x00007fd5c4866443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#21 0x00007fd5c486e074 in QApplication::notify(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#22 0x00007fd5c3a667b8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#23 0x00007fd5c486cb57 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () from /lib64/libQt5Widgets.so.5
#24 0x00007fd5c48c2f53 in QWidgetWindow::handleMouseEvent(QMouseEvent*) () from /lib64/libQt5Widgets.so.5
#25 0x00007fd5c48c56e5 in QWidgetWindow::event(QEvent*) () from /lib64/libQt5Widgets.so.5
#26 0x00007fd5c4866443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#27 0x00007fd5c3a667b8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#28 0x00007fd5c3ebab98 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /lib64/libQt5Gui.so.5
#29 0x00007fd5c3e9ac9c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Gui.so.5
#30 0x00007fd5a848711e in xcbSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5XcbQpa.so.5
#31 0x00007fd5b8cad4cf in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#32 0x00007fd5b8d014f8 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#33 0x00007fd5b8caac03 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#34 0x00007fd5c3ab7b98 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#35 0x00007fd5c3a651c2 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#36 0x00007fd5c3a6d704 in QCoreApplication::exec() () from /lib64/libQt5Core.so.5
#37 0x0000561966c2397f in main ()
[Inferior 1 (process 1594100) detached]
Comment 1 Robby Stephenson 2021-12-07 02:41:39 UTC
Any chance you could narrow down the particular audio file that might be causing the crash? There was a fair bit of updates in the audio file importer for 3.4.2, but just from looking at the code, everything seems to be correct, so I'm missing the cause of the crash somehow.

If not the specific audio file, could you install the debug symbols so the debug trace could tell me more specifically what area of the code might be causing the crash?

Thanks!
Comment 2 Robby Stephenson 2021-12-07 12:26:49 UTC
(In reply to Robby Stephenson from comment #1)
> If not the specific audio file, could you install the debug symbols so the
> debug trace could tell me more specifically what area of the code might be
> causing the crash?

To be clear, your bug report was great since it included the stack trace. I just can't tell which line in in Tellico::Import::AudioFileImporter::collection() is crashing, so a trace with the line numbers (a "full trace") would be invaluable if you're able to generate it.
Comment 3 mark 2021-12-07 13:06:24 UTC
i will try to narrow down which file and attempt to install debug symbols.
Comment 4 mark 2021-12-07 13:54:16 UTC
I'm closing this.  I shouldn't have been in a rush and did what i should have by narrowing down what file(s) were causing the issue.  turned out i forgot about old podcast files that were generated by clementine which i no longer use.  it seems clementine had added tags and that was causing this to crash.  i've since switched to strawberry player.  there are no issues with the files that have tags updated by musicbrainz
Comment 5 Robby Stephenson 2021-12-09 02:46:42 UTC
(In reply to mark from comment #4)
> I'm closing this.  I shouldn't have been in a rush and did what i should
> have by narrowing down what file(s) were causing the issue.  turned out i
> forgot about old podcast files that were generated by clementine which i no
> longer use.  it seems clementine had added tags and that was causing this to
> crash.  i've since switched to strawberry player.  there are no issues with
> the files that have tags updated by musicbrainz

Well, Tellico still shouldn't crash, no matter what files are used. Could you send me an example of one of those old podcast files?
Comment 6 mark 2021-12-09 11:39:22 UTC
Created attachment 144388 [details]
podcast file that will crash tellico

warning: contents of podcast for mature listener only
Comment 7 mark 2021-12-09 11:41:03 UTC
I had deleted all those files so i went and restored from my backup.  I attached the smallest file i had that would cause the crash.  You are right, a file shouldn't cause a crash even if it is bad data.   good luck
Comment 8 Robby Stephenson 2021-12-11 21:45:33 UTC
Git commit 0df7001533b578ababdddd8427bf1addc267003d by Robby Stephenson.
Committed on 11/12/2021 at 21:43.
Pushed by rstephenson into branch '3.4'.

Avoid dereferencing the first value in an empty string list

a TagLib::PropertyMap returns a StringList as a value, but checking
if the map contains the key, is not sufficient to ensure the string
list is not empty.

Also, optimize a bit to avoid additional conversions to TagLib::String
FIXED-IN: 3.4.3

M  +4    -0    ChangeLog
M  +27   -12   src/translators/audiofileimporter.cpp

https://invent.kde.org/office/tellico/commit/0df7001533b578ababdddd8427bf1addc267003d
Comment 9 Bug Janitor Service 2022-01-09 17:00:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/office/tellico/-/merge_requests/4
Comment 10 Andreas Sturmlechner 2022-01-09 17:05:31 UTC
Git commit 9d450037f708cc2300d2767e5171bb08e48077a9 by Andreas Sturmlechner, on behalf of Lars Wendler.
Committed on 09/01/2022 at 16:56.
Pushed by rstephenson into branch 'master'.

Fix build without HAVE_TAGLIB

Gentoo-bug: https://bugs.gentoo.org/830806

M  +2    -0    src/translators/audiofileimporter.cpp

https://invent.kde.org/office/tellico/commit/9d450037f708cc2300d2767e5171bb08e48077a9
Comment 11 Robby Stephenson 2022-01-09 17:06:56 UTC
Git commit 46a51a04707066050f2cd2c352b15603df5dd9cf by Robby Stephenson, on behalf of Lars Wendler.
Committed on 09/01/2022 at 17:06.
Pushed by rstephenson into branch '3.4'.

Fix build without HAVE_TAGLIB

Gentoo-bug: https://bugs.gentoo.org/830806

M  +2    -0    src/translators/audiofileimporter.cpp

https://invent.kde.org/office/tellico/commit/46a51a04707066050f2cd2c352b15603df5dd9cf