Bug 382693 - Muon crashes during package install/remove(in QApt::Backend::package(QLatin1String) const ())(encoding?)
Summary: Muon crashes during package install/remove(in QApt::Backend::package(QLatin1S...
Status: REPORTED
Alias: None
Product: libqapt
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Harald Sitter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-25 07:22 UTC by V字龍(Vdragon)
Modified: 2019-01-24 04:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description V字龍(Vdragon) 2017-07-25 07:22:08 UTC
Backtrace: 

```
#0  0x00007ffff765ce2f in QApt::Backend::package(QLatin1String) const ()
   from /usr/lib/x86_64-linux-gnu/libQApt.so.3
#1  0x00007ffff765ebcb in QApt::Backend::search(QString const&) const ()
   from /usr/lib/x86_64-linux-gnu/libQApt.so.3
#2  0x0000000000433e75 in PackageProxyModel::search (this=0x71eba0, searchText=...)
    at /workspace/build/src/PackageModel/PackageProxyModel.cpp:71
#3  0x0000000000438962 in PackageWidget::startSearch (this=0x730f40)
    at /workspace/build/src/PackageModel/PackageWidget.cpp:410
#4  0x0000000000428062 in ManagerWidget::reload (this=<optimized out>)
    at /workspace/build/src/ManagerWidget.cpp:63
#5  0x0000000000426eee in MainWindow::reload (this=0x731bf0) at /workspace/build/src/MainWindow.cpp:370
#6  0x0000000000426fb5 in MainWindow::transactionStatusChanged (this=0x731bf0, status=<optimized out>)
    at /workspace/build/src/MainWindow.cpp:304
#7  0x000000000045365b in MainWindow::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, 
    _id=<optimized out>, _a=<optimized out>)
    at /workspace/build/obj-x86_64-linux-gnu/src/moc_MainWindow.cpp:179
#8  0x00007ffff4efbc19 in QMetaObject::activate (sender=0x1efea30, signalOffset=<optimized out>, 
    local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3766
#9  0x00007ffff7690751 in QApt::Transaction::statusChanged(QApt::TransactionStatus) ()
   from /usr/lib/x86_64-linux-gnu/libQApt.so.3
#10 0x00007ffff768342e in QApt::Transaction::updateProperty(int, QDBusVariant const&) ()
   from /usr/lib/x86_64-linux-gnu/libQApt.so.3
#11 0x00007ffff769163f in ?? () from /usr/lib/x86_64-linux-gnu/libQApt.so.3
#12 0x00007ffff4efbc19 in QMetaObject::activate (sender=0x1d61f30, signalOffset=<optimized out>, 
    local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3766
#13 0x00007ffff768e328 in ?? () from /usr/lib/x86_64-linux-gnu/libQApt.so.3
#14 0x00007ffff768f7b0 in ?? () from /usr/lib/x86_64-linux-gnu/libQApt.so.3
#15 0x00007ffff385aee3 in QDBusConnectionPrivate::deliverCall (this=<optimized out>, object=<optimized out>, 
    msg=..., metaTypes=..., slotIdx=<optimized out>) at qdbusintegrator.cpp:998
#16 0x00007ffff4efcc59 in QObject::event (this=0x1d61f30, e=<optimized out>) at kernel/qobject.cpp:1246
#17 0x00007ffff58373fc in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x1d61f30, 
    e=0x7fffd80270a0) at kernel/qapplication.cpp:3717
#18 0x00007ffff583ee07 in QApplication::notify (this=0x7fffffffdb20, receiver=0x1d61f30, e=0x7fffd80270a0)
    at kernel/qapplication.cpp:3476
#19 0x00007ffff4ecf798 in QCoreApplication::notifyInternal2 (receiver=0x1d61f30, 
    event=event@entry=0x7fffd80270a0) at kernel/qcoreapplication.cpp:1018
#20 0x00007ffff4ed1f7b in QCoreApplication::sendEvent (event=0x7fffd80270a0, receiver=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:233
#21 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, 
    data=0x689d60) at kernel/qcoreapplication.cpp:1678
#22 0x00007ffff4ed23e8 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, 
    event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1532
#23 0x00007ffff4f25323 in postEventSourceDispatch (s=0x6c9c80) at kernel/qeventdispatcher_glib.cpp:276
#24 0x00007fffeffaf197 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007fffeffaf3f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007fffeffaf49c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007ffff4f2492f in QEventDispatcherGlib::processEvents (this=0x6c9d00, flags=...)
    at kernel/qeventdispatcher_glib.cpp:423
#28 0x00007ffff4ecd7ca in QEventLoop::exec (this=this@entry=0x7fffffffda30, flags=..., flags@entry=...)
    at kernel/qeventloop.cpp:212
#29 0x00007ffff4ed6704 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1291
#30 0x00007ffff52b82ec in QGuiApplication::exec () at kernel/qguiapplication.cpp:1679
#31 0x00007ffff5837355 in QApplication::exec () at kernel/qapplication.cpp:2905
#32 0x00000000004253c6 in main (argc=1, argv=<optimized out>) at /workspace/build/src/main.cpp:62
```

Additional info: 
* KDE neon 5.10(user edition)
* Locale: 

```
LANG=zh_TW.UTF-8
LANGUAGE=zh_TW:zh_CN
LC_CTYPE="zh_TW.UTF-8"
LC_NUMERIC="zh_TW.UTF-8"
LC_TIME="zh_TW.UTF-8"
LC_COLLATE="zh_TW.UTF-8"
LC_MONETARY="zh_TW.UTF-8"
LC_MESSAGES="zh_TW.UTF-8"
LC_PAPER="zh_TW.UTF-8"
LC_NAME="zh_TW.UTF-8"
LC_ADDRESS="zh_TW.UTF-8"
LC_TELEPHONE="zh_TW.UTF-8"
LC_MEASUREMENT="zh_TW.UTF-8"
LC_IDENTIFICATION="zh_TW.UTF-8"
LC_ALL=
```

* I have added some APT Pinning in /etc/apt/preferences.d , and due to a README.markdown is put in this directory apt will emitt an warning message in terminal, which is:

```
N: 略過 '/etc/apt/preferences.d/' 目錄的 'README.markdown' 檔案,因其檔案副檔名無效
```

Which might related to the crash if it's not reproducible universally.
Comment 1 V字龍(Vdragon) 2017-07-26 15:52:42 UTC
I rebuilt libqapt and muon with -g -O0, here's the stack trace:

```
Thread 1 "muon" received signal SIGSEGV, Segmentation fault.
0x00007ffff7648bed in pkgDepCache::FindPkg (this=0x0, Name="dgit") at /usr/include/apt-pkg/depcache.h:358
358        inline PkgIterator FindPkg(std::string const &Name) {return Cache->FindPkg(Name);};
```

```
#0  0x00007ffff7648bed in pkgDepCache::FindPkg (this=0x0, Name="dgit") at /usr/include/apt-pkg/depcache.h:358
#1  0x00007ffff763fe28 in QApt::Backend::package (this=0xa35d80, name=...)
    at libqapt-3.0.3+p16.04+git20170630.2221/src/backend.cpp:346
#2  0x00007ffff7640e1d in QApt::Backend::search (this=0xa35d80, searchString=...)
    at libqapt-3.0.3+p16.04+git20170630.2221/src/backend.cpp:585
#3  0x000000000043acfa in PackageProxyModel::search (this=0x735980, searchText=...)
    at muon-5.7.0-0+16.04+xenial+build4/src/PackageModel/PackageProxyModel.cpp:71
#4  0x00000000004432b2 in PackageWidget::startSearch (this=0x736030)
    at muon-5.7.0-0+16.04+xenial+build4/src/PackageModel/PackageWidget.cpp:410
#5  0x000000000042a1fa in ManagerWidget::reload (this=0x736030)
    at muon-5.7.0-0+16.04+xenial+build4/src/ManagerWidget.cpp:63
#6  0x00000000004289da in MainWindow::reload (this=0x745000)
    at muon-5.7.0-0+16.04+xenial+build4/src/MainWindow.cpp:370
#7  0x00000000004284ae in MainWindow::transactionStatusChanged (this=0x745000, status=QApt::FinishedStatus)
    at muon-5.7.0-0+16.04+xenial+build4/src/MainWindow.cpp:304
#8  0x000000000045dfac in MainWindow::qt_static_metacall (_o=0x745000, _c=QMetaObject::InvokeMetaMethod, 
    _id=12, _a=0x7fffffffd040)
    at muon-5.7.0-0+16.04+xenial+build4/obj-x86_64-linux-gnu/src/moc_MainWindow.cpp:179
#9  0x00007ffff4edbc19 in QMetaObject::activate (sender=0x1d55a00, signalOffset=<optimized out>, 
    local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3766
#10 0x00007ffff7682b9f in QApt::Transaction::statusChanged (this=0x1d55a00, _t1=QApt::FinishedStatus)
    at libqapt-3.0.3+p16.04+git20170630.2221/obj-x86_64-linux-gnu/src/moc_transaction.cpp:539
#11 0x00007ffff7671964 in QApt::Transaction::updateProperty (this=0x1d55a00, type=3, variant=...)
    at libqapt-3.0.3+p16.04+git20170630.2221/src/transaction.cpp:632
#12 0x00007ffff7681d37 in QApt::Transaction::qt_static_metacall (_o=0x1d55a00, 
    _c=QMetaObject::InvokeMetaMethod, _id=24, _a=0x7fffffffd2e0)
    at libqapt-3.0.3+p16.04+git20170630.2221/obj-x86_64-linux-gnu/src/moc_transaction.cpp:286
#13 0x00007ffff4edbc19 in QMetaObject::activate (sender=0x1d72f50, signalOffset=<optimized out>, 
    local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3766
#14 0x00007ffff767ee8b in OrgKubuntuQaptworker3TransactionInterface::propertyChanged (this=0x1d72f50, _t1=3, 
    _t2=...)
    at libqapt-3.0.3+p16.04+git20170630.2221/obj-x86_64-linux-gnu/src/transactioninterface_p.moc:372
#15 0x00007ffff767e203 in OrgKubuntuQaptworker3TransactionInterface::qt_static_metacall (_o=0x1d72f50, 
    _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fffffffd4b0)
    at libqapt-3.0.3+p16.04+git20170630.2221/obj-x86_64-linux-gnu/src/transactioninterface_p.moc:188
#16 0x00007ffff767eba9 in OrgKubuntuQaptworker3TransactionInterface::qt_metacall (this=0x1d72f50, 
    _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fffffffd4b0)
    at libqapt-3.0.3+p16.04+git20170630.2221/obj-x86_64-linux-gnu/src/transactioninterface_p.moc:313
#17 0x00007ffff383aee3 in QDBusConnectionPrivate::deliverCall (this=<optimized out>, object=<optimized out>, 
    msg=..., metaTypes=..., slotIdx=<optimized out>) at qdbusintegrator.cpp:998
#18 0x00007ffff4edcc59 in QObject::event (this=0x1d72f50, e=<optimized out>) at kernel/qobject.cpp:1246
#19 0x00007ffff58173fc in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x1d72f50, 
    e=0x7fffd8029aa0) at kernel/qapplication.cpp:3717
#20 0x00007ffff581ee07 in QApplication::notify (this=0x7fffffffdb70, receiver=0x1d72f50, e=0x7fffd8029aa0)
    at kernel/qapplication.cpp:3476
#21 0x00007ffff4eaf798 in QCoreApplication::notifyInternal2 (receiver=0x1d72f50, 
    event=event@entry=0x7fffd8029aa0) at kernel/qcoreapplication.cpp:1018
#22 0x00007ffff4eb1f7b in QCoreApplication::sendEvent (event=0x7fffd8029aa0, receiver=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:233
#23 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, 
    data=0x69fd60) at kernel/qcoreapplication.cpp:1678
#24 0x00007ffff4eb23e8 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, 
    event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1532
#25 0x00007ffff4f05323 in postEventSourceDispatch (s=0x6e9ce0) at kernel/qeventdispatcher_glib.cpp:276
#26 0x00007fffeff8f197 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007fffeff8f3f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007fffeff8f49c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007ffff4f0492f in QEventDispatcherGlib::processEvents (this=0x6e05e0, flags=...)
    at kernel/qeventdispatcher_glib.cpp:423
#30 0x00007ffff4ead7ca in QEventLoop::exec (this=this@entry=0x7fffffffda70, flags=..., flags@entry=...)
    at kernel/qeventloop.cpp:212
#31 0x00007ffff4eb6704 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1291
#32 0x00000000004261b5 in main (argc=1, argv=0x7fffffffdcb8)
    at muon-5.7.0-0+16.04+xenial+build4/src/main.cpp:62
```
Comment 2 Harald Sitter 2018-01-04 12:15:13 UTC
Your apt is broken it fails to open the depcache. Why it doesn't report so during initialization is anyone's guess. Nothing much we can do about this.