Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGABRT when scanning corrupt/empty FLAC file #730

Closed
domve opened this issue Oct 11, 2020 · 3 comments · Fixed by #731
Closed

SIGABRT when scanning corrupt/empty FLAC file #730

domve opened this issue Oct 11, 2020 · 3 comments · Fixed by #731
Labels

Comments

@domve
Copy link

domve commented Oct 11, 2020

Nicotine+ version: 2.1.1 and 2.1.2-dev1
Operating System/Distribution: Fedora Workstation 32

Describe the bug

nicotine+ kept crashing when i was trying to import my collection, it kept bringing up C++ assertions and running it through gdb i found out a few of the songs in my library were only 4 bytes (half of the flac signature), removing these fixed it and i was able to continue using it.

/usr/include/c++/10/bits/stl_vector.h:1042: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = char; _Alloc = std::allocator<char>; std::vector<_Tp, _Alloc>::reference = char&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.

i realize this might not inherently be a nicotine+ issue, but some sort of warning/workaround would be nice to have.

Expected behavior

ignore these files and run as normal.

Steps to reproduce the bug

  1. unzip and add the attached file to one of the shared folders
  2. run nicotine+ and rescan shares

Additional context

gdb stacktrace:

#1  0x00007ffff7dff895 in abort () from /lib64/libc.so.6
#2  0x00007fffe8555608 in std::__replacement_assert(char const*, int, char const*, char const*) () from /lib64/libtag.so.1
#3  0x00007fffe8553bbb in TagLib::ByteVector::operator[](int) const ()
   from /lib64/libtag.so.1
#4  0x00007fffe855b59a in TagLib::FLAC::File::scan() () from /lib64/libtag.so.1
#5  0x00007fffe855b9fc in TagLib::FLAC::File::read(bool) ()
   from /lib64/libtag.so.1
#6  0x00007fffe855bddc in TagLib::FLAC::File::File(char const*, TagLib::ID3v2::FrameFactory*, bool, TagLib::AudioProperties::ReadStyle) ()
   from /lib64/libtag.so.1
#7  0x00007fffe85822f5 in TagLib::File* (anonymous namespace)::createInternal<char const*>(char const*, bool, TagLib::AudioProperties::ReadStyle) ()
   from /lib64/libtag.so.1
#8  0x00007fffea68a123 in __pyx_tp_new_6taglib_File(_typeobject*, _object*, _object*) ()
   from /usr/lib64/python3.8/site-packages/taglib.cpython-38-x86_64-linux-gnu.so
#9  0x00007ffff7bb6885 in type_call (type=0x7fffea693980, 
    args=('/home/dom/Documents/folder/test.flac',), kwds=0x0)
    at /usr/src/debug/python3-3.8.5-5.fc32.x86_64/Objects/typeobject.c:974
#10 0x00007ffff7bb6681 in _PyObject_MakeTpCall
@domve domve added the bug label Oct 11, 2020
@mathiascode
Copy link
Member

The behavior seems to vary a lot depending on the TagLib package in different operating systems. On Arch and Debian, no warning messages are shown, while a warning message from TagLib is shown on Windows. No crashes on any of these setups though.

We might just have to skip metadata scanning for files that are too small to realistically contain anything useful.

@mathiascode
Copy link
Member

I can reproduce this on Fedora 32. Preparing a workaround.

@domve
Copy link
Author

domve commented Oct 11, 2020

can confirm the workaround fixes the crashing, thanks for the quick resolution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants