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

Zeal::ListModel::removeDocset didn't check NULL leads crash #420

Closed
comicfans opened this issue Nov 4, 2015 · 3 comments
Closed

Zeal::ListModel::removeDocset didn't check NULL leads crash #420

comicfans opened this issue Nov 4, 2015 · 3 comments
Milestone

Comments

@comicfans
Copy link

git version 58e2080

docset downloaded complete trigger this problem.

listmodel.cpp:198

DocsetItem *docsetItem = m_docsetItems.take(name); --->docsetItem = 0x0
qDeleteAll(docsetItem->groups);  --->crash

backtrace shows as

#0  0x000000000041d850 in QListData::end (this=0x10) at /usr/include/qt/QtCore/qlist.h:109
#1  0x0000000000440a04 in QList<Zeal::ListModel::GroupItem*>::end (this=0x10) at /usr/include/qt/QtCore/qlist.h:304
#2  0x000000000043ffca in qDeleteAll<QList<Zeal::ListModel::GroupItem*> > (c=...) at /usr/include/qt/QtCore/qalgorithms.h:325
#3  0x000000000043f8d2 in Zeal::ListModel::removeDocset (this=0x75fad0, name=...) at registry/listmodel.cpp:199   
#4  0x00000000004416ce in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QString const&>, void, void (Zeal::ListModel::*)(QString const&)>::call (f=
    (void (Zeal::ListModel::*)(Zeal::ListModel * const, const QString &)) 0x43f836 <Zeal::ListModel::removeDocset(QString const&)>, o=0x75fad0, arg=0x7fffffffc830) at /usr/include/qt/QtCore/qobjectdefs_impl.h:501
#5  0x0000000000441533 in QtPrivate::FunctionPointer<void (Zeal::ListModel::*)(QString const&)>::call<QtPrivate::List<QString const&>, void> (f=
    (void (Zeal::ListModel::*)(Zeal::ListModel * const, const QString &)) 0x43f836 <Zeal::ListModel::removeDocset(QString const&)>, o=0x75fad0, arg=0x7fffffffc830) at /usr/include/qt/QtCore/qobjectdefs_impl.h:520
#6  0x00000000004411c5 in QtPrivate::QSlotObject<void (Zeal::ListModel::*)(QString const&), QtPrivate::List<QString const&>, void>::impl (which=1, this_=0x75ffb0, r=0x75fad0, a=0x7fffffffc830, ret=0x0)
    at /usr/include/qt/QtCore/qobject_impl.h:143
#7  0x00007ffff2f08fb7 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5
#8  0x0000000000474cf3 in Zeal::DocsetRegistry::docsetAboutToBeRemoved (this=0x73d410, _t1=...) at ../.moc/moc_docsetregistry.cpp:183
#9  0x0000000000439f21 in Zeal::DocsetRegistry::remove (this=0x73d410, name=...) at registry/docsetregistry.cpp:77
#10 0x000000000045a85b in Zeal::SettingsDialog::downloadCompleted (this=0x760050) at ui/settingsdialog.cpp:334

Havn't trace whole controlflow, not sure if removeDocset should check NULL here.

@trollixx
Copy link
Member

trollixx commented Nov 5, 2015

Hi,

Thank you for taking time and debugging the crash. Your assumption is correct, ListModel::removeDocset should never be called with non-existent docset.

I wonder what docset were you downloading or updating?

@trollixx trollixx added this to the 0.1.2 milestone Nov 7, 2015
@comicfans
Copy link
Author

sorry for my late reply...

  1. first start, when docset UI appears , it seems display duplicate docsets. (same list repeast twice).
  2. then I choose Qt4 Qt5 android docset and begin downloading. not sure which docset triggered bug.
  3. maybe my internet connection lost , or DNS didn't reply quickly enough, one docset failed to download completely.
  4. this bug fired

hopeful this can help.

drognanar pushed a commit to drognanar/zeal that referenced this issue Dec 21, 2015
According to the bug report sometimes ListModel::removeDocset() is called
for docsets not in the model. This change adds a simple check, but
does not address the real unknown issue.
@lock
Copy link

lock bot commented Sep 16, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for a related request.

@lock lock bot locked and limited conversation to collaborators Sep 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants