aptcc: Crash on resolve() (triggered by Plasma Discover) #177

Closed
ximion opened this Issue Nov 23, 2016 · 11 comments

Comments

Projects
None yet
6 participants
Collaborator

ximion commented Nov 23, 2016

I just came across a Debian testing machine at my university where Plasma Discover was crashing PackageKit while performing a Resolve() call:

Thread 7 "PK-Backend" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff0a4e700 (LWP 2127)]
0x00007ffff21df0aa in pkgDepCache::operator[] (this=0x7fffdc00be50, I=...) at /usr/include/apt-pkg/depcache.h:371
371     /usr/include/apt-pkg/depcache.h: Datei oder Verzeichnis nicht gefunden.
#0  0x00007ffff21df0aa in pkgDepCache::operator[] (this=0x7fffdc00be50, I=...) at /usr/include/apt-pkg/depcache.h:371
No locals.
#1  pkgCacheFile::operator[] (this=0x7fffdc004580, I=...) at /usr/include/apt-pkg/cachefile.h:64
No locals.
#2  AptCacheFile::findCandidateVer (this=0x7fffdc004580, pkg=...) at apt-cache-file.cpp:411
No locals.
#3  0x00007ffff21ed3d1 in AptIntf::resolvePackageIds (this=this@entry=0x555555a0cae0, package_ids=0x7fffdc006060, filters=filters@entry=1)
    at apt-intf.cpp:2067
        ver = @0x7ffff0a4dbb0: {<pkgCache::Iterator<pkgCache::Version, pkgCache::VerIterator>> = {<std::iterator<std::forward_iterator_tag, pkgCache::Version, long, pkgCache::Version*, pkgCache::Version&>> = {<No data fields>}, S = 0x7fffe3d496e0, Owner = 0x7fffdc00ed90}, <No data fields>}
        candidateVer = <optimized out>
        pkg = {<pkgCache::Iterator<pkgCache::Package, pkgCache::PkgIterator>> = {<std::iterator<std::forward_iterator_tag, pkgCache::Package, long, pkgCache::Package*, pkgCache::Package&>> = {<No data fields>}, S = 0x7fffe23535b8, Owner = 0x7fffdc00ed90}, HashIndex = 0}
        grp = {<pkgCache::Iterator<pkgCache::Group, pkgCache::GrpIterator>> = {<std::iterator<std::forward_iterator_tag, pkgCache::Group, long, pkgCache::Group*, pkgCache::Group&>> = {<No data fields>}, S = 0x7fffe2340000, Owner = 0x7fffdc00ed90}, HashIndex = 0}
        name = {static npos = 18446744073709551615,
          _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
            _M_p = 0x7ffff0a4dc90 "xnetcardconfig"}, _M_string_length = 14, {_M_local_buf = "xnetcardconfig\000",
            _M_allocated_capacity = 7237954630920269432}}
        i = 100
        pi = <optimized out>
        ret = {<std::vector<pkgCache::VerIterator, std::allocator<pkgCache::VerIterator> >> = {<std::_Vector_base<pkgCache::VerIterator, std::allocator<pkgCache::VerIterator> >> = {
              _M_impl = {<std::allocator<pkgCache::VerIterator>> = {<__gnu_cxx::new_allocator<pkgCache::VerIterator>> = {<No data fields>}, <No data fields>}, _M_start = 0x7fffdc009980, _M_finish = 0x7fffdc00a610, _M_end_of_storage = 0x7fffdc00a980}}, <No data fields>}, <No data fields>}
#4  0x00007ffff21ef89f in pk_backend_resolve_thread (job=<optimized out>, params=<optimized out>, user_data=<optimized out>)
    at pk-backend-aptcc.cpp:667
        search = 0x7fffdc006060
        filters = 262144
        apt = 0x555555a0cae0
        pkgs = {<std::vector<pkgCache::VerIterator, std::allocator<pkgCache::VerIterator> >> = {<std::_Vector_base<pkgCache::VerIterator, std::allocator<pkgCache::VerIterator> >> = {
              _M_impl = {<std::allocator<pkgCache::VerIterator>> = {<__gnu_cxx::new_allocator<pkgCache::VerIterator>> = {<No data fields>}, <No data fields>}, _M_start = 0x5555558294f0, _M_finish = 0x55555556be2d <pk_backend_thread_start+77>,
                _M_end_of_storage = 0x7fffffffe04f}}, <No data fields>}, <No data fields>}
#5  0x0000555555573bea in pk_backend_job_thread_setup (thread_data=0x555555a0c870) at pk-backend-job.c:813
        helper = 0x555555a0c870
#6  0x00007ffff6bc9345 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#7  0x00007ffff6941464 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
No symbol table info available.
#8  0x00007ffff66849df in clone () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.

I have no clue what causes this crash and why it only happens on that particular machine - I will investigate this later (but this bug should make people aware of the issue, since I have a feeling that quite a few people might run into it).
Tested with PackageKit 1.1.4 (with protect-zero-length patch and all other Debian patches).

I can confirm this happens to me too. I can reliably reproduce it at the moment by constantly hitting ctrl+r in discover.

Backtrace from discover ( in case relevant ):

Application: Discover (plasma-discover), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f6d7e5da8c0 (LWP 13470))]

Thread 9 (Thread 0x7f6d4125b700 (LWP 13503)):
#0  0x00007ffee66ea939 in ?? ()
#1  0x00007ffee66eabc9 in clock_gettime ()
#2  0x00007f6d7aed3886 in clock_gettime () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007f6d7b955001 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007f6d7badd379 in QTimerInfoList::updateCurrentTime() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f6d7badd925 in QTimerInfoList::timerWait(timespec&) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007f6d7badef64 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007f6d768e6edd in g_main_context_prepare () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8  0x00007f6d768e791b in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007f6d768e7b0c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007f6d7badf6fb in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007f6d7ba8907a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007f6d7b8ab0d3 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007f6d7b8afd88 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007f6d787f7464 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#15 0x00007f6d7aec69df in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 8 (Thread 0x7f6d4cfe2700 (LWP 13482)):
#0  0x00007f6d7aeb95dd in read () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6d7692bc40 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f6d768e74be in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6d768e7994 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f6d768e7d82 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f6d4f0384f6 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#6  0x00007f6d7690f345 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007f6d787f7464 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#8  0x00007f6d7aec69df in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 7 (Thread 0x7f6d4d7e3700 (LWP 13481)):
#0  0x00007f6d7aeb95dd in read () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6d7692bc40 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f6d768e74be in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6d768e7994 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f6d768e7b0c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f6d768e7b51 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007f6d7690f345 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007f6d787f7464 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#8  0x00007f6d7aec69df in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 6 (Thread 0x7f6d5b7fe700 (LWP 13476)):
#0  0x00007f6d7aebd56d in poll () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6d768e79f6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f6d768e7b0c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6d7badf6fb in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007f6d7ba8907a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f6d7b8ab0d3 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007f6d7b8afd88 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007f6d787f7464 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#8  0x00007f6d7aec69df in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 5 (Thread 0x7f6d5bfff700 (LWP 13475)):
#0  0x00007f6d7aeb95dd in read () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6d7692bc40 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f6d768e74be in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6d768e7994 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f6d768e7b0c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f6d7badf6fb in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007f6d7ba8907a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007f6d7b8ab0d3 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007f6d7de9b856 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5
#9  0x00007f6d7b8afd88 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007f6d787f7464 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#11 0x00007f6d7aec69df in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 4 (Thread 0x7f6d6357a700 (LWP 13473)):
#0  0x00007f6d7692cfe9 in g_mutex_lock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007f6d768e79b2 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f6d768e7b0c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6d7badf6fb in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007f6d7ba8907a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f6d7b8ab0d3 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007f6d7c2435d5 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#7  0x00007f6d7b8afd88 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007f6d787f7464 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#9  0x00007f6d7aec69df in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 3 (Thread 0x7f6d6478b700 (LWP 13472)):
#0  0x00007f6d7692d004 in g_mutex_unlock () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007f6d768e6ed0 in g_main_context_prepare () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f6d768e791b in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6d768e7b0c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f6d7badf6fb in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f6d7ba8907a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007f6d7b8ab0d3 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007f6d7e71f6d5 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#8  0x00007f6d7b8afd88 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007f6d787f7464 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#10 0x00007f6d7aec69df in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 2 (Thread 0x7f6d6d294700 (LWP 13471)):
#0  0x00007f6d7aebd56d in poll () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f6d76479150 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007f6d7647aee9 in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007f6d6f7f3b69 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#4  0x00007f6d7b8afd88 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f6d787f7464 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#6  0x00007f6d7aec69df in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 1 (Thread 0x7f6d7e5da8c0 (LWP 13470)):
[KCrash Handler]
#6  0x0000000000000020 in ?? ()
#7  0x00007f6d4f7766ec in PackageKit::TransactionPrivate::destroy (this=0x5564e3909b60) at ./src/transactionprivate.cpp:259
#8  0x00007f6d4f776988 in PackageKit::TransactionPrivate::daemonQuit (this=0x5564e3909b60) at ./src/transactionprivate.cpp:279
#9  0x00007f6d4f774d19 in PackageKit::Transaction::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at ./obj-x86_64-linux-gnu/src/moc_transaction.cpp:1184
#10 0x00007f6d7bab6c89 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007f6d4f76f1ae in PackageKit::DaemonPrivate::serviceOwnerChanged (this=0x5564ded839a0, service=..., oldOwner=..., newOwner=...) at ./src/daemonprivate.cpp:56
#12 0x00007f6d4f76a688 in PackageKit::Daemon::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at ./obj-x86_64-linux-gnu/src/moc_daemon.cpp:228
#13 0x00007f6d7bab6c89 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007f6d7e77891f in QDBusServiceWatcher::serviceOwnerChanged(QString const&, QString const&, QString const&) () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#15 0x00007f6d7e7789df in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#16 0x00007f6d7e778f5f in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#17 0x00007f6d7e779330 in QDBusServiceWatcher::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#18 0x00007f6d7e72ba10 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#19 0x00007f6d7bab7b39 in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007f6d7ca02b2c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007f6d7ca0a2e1 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007f6d7ba8b090 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x00007f6d7ba8d81d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007f6d7badf2d3 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x00007f6d768e77f7 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007f6d768e7a60 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007f6d768e7b0c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007f6d7badf6df in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x00007f6d7ba8907a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#30 0x00007f6d7ba917ec in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x00005564dc72b9a9 in ?? ()
#32 0x00007f6d7adfe2b1 in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#33 0x00005564dc72baca in _start ()
0

Backtrace from packagekitd ( seems to be the same )

Thread 6 (Thread 0x7ffff10e9700 (LWP 16030)):
#0  0x00007ffff380d0aa in pkgDepCache::operator[] (this=0x7fffe000dc40, I=...) at /usr/include/apt-pkg/depcache.h:371
#1  pkgCacheFile::operator[] (this=0x7fffe0011610, I=...) at /usr/include/apt-pkg/cachefile.h:64
#2  AptCacheFile::findCandidateVer (this=0x7fffe0011610, pkg=...) at apt-cache-file.cpp:411
#3  0x00007ffff381b3d1 in AptIntf::resolvePackageIds (this=this@entry=0x5555559faea0, package_ids=0x7fffe0024b00, filters=filters@entry=1) at apt-intf.cpp:2067
#4  0x00007ffff381d89f in pk_backend_resolve_thread (job=<optimized out>, params=<optimized out>, user_data=<optimized out>) at pk-backend-aptcc.cpp:667
#5  0x0000555555573bea in pk_backend_job_thread_setup (thread_data=0x5555559fa070) at pk-backend-job.c:813
#6  0x00007ffff6bc9345 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007ffff6941464 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#8  0x00007ffff66849df in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 4 (Thread 0x7ffff2b79700 (LWP 15975)):
#0  0x00007ffff6680119 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff6be726a in g_cond_wait_until () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6b75e89 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff6b764ac in g_async_queue_timeout_pop () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff6bc9e0d in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff6bc9345 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007ffff6941464 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#7  0x00007ffff66849df in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 3 (Thread 0x7fffeba29700 (LWP 15974)):
#0  0x00007ffff667b56d in poll () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff6ba19f6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6ba1d82 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff71894f6 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007ffff6bc9345 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff6941464 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#6  0x00007ffff66849df in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 2 (Thread 0x7ffff422a700 (LWP 15973)):
#0  0x00007ffff667b56d in poll () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff6ba19f6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6ba1b0c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff6ba1b51 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff6bc9345 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff6941464 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#6  0x00007ffff66849df in clone () from /lib/x86_64-linux-gnu/libc.so.6

Thread 1 (Thread 0x7ffff7f3d900 (LWP 15969)):
#0  0x00007ffff667b56d in poll () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff6ba19f6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff6ba1d82 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x0000555555561df7 in main (argc=<optimized out>, argv=<optimized out>) at pk-main.c:252
Collaborator

ximion commented Nov 30, 2016

Jup, this is the same bug - I hope I can take a bit of my time at work to debug this there - I meanwhile managed to reproduce this at home, but it happens very infrequently.

My hunch is that we resolve some string to garbage and then try to do something with it in APT, but I still couldn't find the time for more investigation. In any case, this is a pretty serious bug...

Collaborator

ximion commented Dec 21, 2016

@shadeslayer Can you still reproduce the issue? I am trying it for a week now on different machines, and I just can't get it to crash again...
Meanwhile, both APT and the AppStream data have been updated though.

Nope, maybe it's fixed now?

Collaborator

ximion commented Dec 21, 2016

Only if it was an APT issue - if there was some garbage in the AppStream data, then the issue is still there but just not triggered...
In any case, I started at the code for quite a while and couldn't find any reason why this would crash... So maybe it is fixed... (I hate not being certain about it, especially if it's a crash like this in a root daemon)

I see a somewhat similar crash in ubuntu zesty 17.04, triggered by plasma-discover 5.8.5 or git master build in kubuntu CI.

05:44:13        PackageKit          transaction now ready
05:44:13        PackageKit          changing transaction to exclusive mode
05:44:13        PackageKit          4 transactions in list, 2 committed but not finished
05:44:13        PackageKit          GetUpdates method called
05:44:13        PackageKit          transaction now ready
05:44:13        PackageKit          changing transaction to exclusive mode
05:44:13        PackageKit          4 transactions in list, 3 committed but not finished
05:44:13        PackageKit          GetRepoList method called
05:44:13        PackageKit          transaction now ready
05:44:13        PackageKit          changing transaction to exclusive mode
05:44:13        PackageKit          4 transactions in list, 4 committed but not finished
05:44:13        PackageKit          install uid now 1000
05:44:13        PackageKit          install cmdline now PackageKit: resolve
05:44:13        PackageKit          setting role for /1105_cceabbde to resolve
[New Thread 0x7ffff0a37700 (LWP 11134)]
05:44:14        PackageKit          percentage value is going down to 0 from 50
05:44:14        PackageKit          percentage value is going down to 0 from 50

Thread 5 "PK-Backend" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff0a37700 (LWP 11134)]
#0  0x00007ffff2ea5414 in AptIntf::matchPackage(pkgCache::VerIterator const&, unsigned long) () from /usr/lib/x86_64-linux-gnu/packagekit-backend/libpk_backend_aptcc.so
#1  0x00007ffff2ea48a4 in AptIntf::filterPackages(PkgList const&, unsigned long) () from /usr/lib/x86_64-linux-gnu/packagekit-backend/libpk_backend_aptcc.so
#2  0x00007ffff2ea7e1a in AptIntf::resolvePackageIds(char**, unsigned long) () from /usr/lib/x86_64-linux-gnu/packagekit-backend/libpk_backend_aptcc.so
#3  0x00007ffff2eaa18f in ?? () from /usr/lib/x86_64-linux-gnu/packagekit-backend/libpk_backend_aptcc.so
#4  0x0000555555573bea in ?? ()
#5  0x00007ffff6bcb385 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007ffff694270a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#7  0x00007ffff667c0af in clone () from /lib/x86_64-linux-gnu/libc.so.6
Collaborator

ximion commented Jan 26, 2017

@dantti @julian-klode: Do you have an idea on this issue? Looks like it's happening to other people, I myself never saw it again...

Collaborator

dantti commented Jan 26, 2017

Well I have done some changes in these matching parts to fix some issues, but so far it works fine here, maybe there's some thread issue...

The code in the first comment is crashing trying to index the dependency cache. This happens by ID, suggesting to me that the depcache does not match the package (iterator), or that the package iterator is broken.

Collaborator

ximion commented Feb 14, 2017

I think @apachelogger just fixed this with #180
If I could reliably reproduce the bug I could verify this... :P - but this pretty much looks like the bugfix, so I'll close this for now and reopen the issue in case the problem happens again.
Another question would be finding out why Discover resolves bad package-ids...

FWIW: This bug will be fixed for Debian 9, getting a freeze exception for it should be easily possible.

@ximion ximion closed this Feb 14, 2017

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