Bug 425811 - Crash when clicking update button the moment it becomes enabled
Summary: Crash when clicking update button the moment it becomes enabled
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: KNewStuff Backend (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Dan Leinir Turthra Jensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-26 00:20 UTC by Nate Graham
Modified: 2020-08-28 18:10 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.74


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2020-08-26 00:20:09 UTC
I've got a 100% reproducible crasher with Discover. If I click the "Update" button on the updates page *the very moment* it becomes enabled after the page loads, Discover crashes with the following backtrace:


(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff51bd539 in __GI_abort () at abort.c:79
#2  0x00007ffff5217827 in __libc_message
    (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff5326e29 "%s\n")
    at ../sysdeps/posix/libc_fatal.c:155
#3  0x00007ffff521eb2c in malloc_printerr
    (str=str@entry=0x7ffff5329240 "double free or corruption (!prev)")
    at malloc.c:5347
#4  0x00007ffff522017c in _int_free
    (av=0x7fffa0000020, p=0x7fffa0009fa0, have_lock=<optimized out>)
    at malloc.c:4317
#5  0x00007fffe026e1a8 in KPackageTask::run()::{lambda()#1}::operator()() const (__closure=0x7fffa0009110)
    at /home/nate/kde/build/knewstuff/src/core/KF5NewStuffCore_autogen/include/kpackagejob.moc:152
#6  QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KPackageTask::run()::{lambda()#1}>::call({lambda()#1}&, void**)
    (arg=<optimized out>, f=...)
    at /usr/include/qt5/QtCore/qobjectdefs_impl.h:146
#7  QtPrivate::Functor<KPackageTask::run()::{lambda()#1}, 0>::call<QtPrivate::List<>, void>({lambda()#1}&, void*, {lambda()#1}&*)
    (arg=<optimized out>, f=...)
    at /usr/include/qt5/QtCore/qobjectdefs_impl.h:256
#8  QtPrivate::QFunctorSlotObject<KPackageTask::run()::{lambda()#1}, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
    (which=<optimized out>, this_=0x7fffa0009100, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:443
#9  0x00007ffff597fb41 in QObject::event(QEvent*)
    (this=0x53e7750, e=0x7fffa0008530) at kernel/qobject.cpp:1314
#10 0x00007ffff6b330cf in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x53e7750, e=0x7fffa0008530)
    at kernel/qapplication.cpp:3671
#11 0x00007ffff5953c1a in QCoreApplication::notifyInternal2(QObject*, QEvent*)
    (receiver=0x53e7750, event=0x7fffa0008530)
    at ../../include/QtCore/5.15.0/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:325
#12 0x00007ffff5956641 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x477280)
    at kernel/qcoreapplication.cpp:1815
#13 0x00007ffff59ab9d3 in postEventSourceDispatch(GSource*, GSourceFunc, gpoint--Type <RET> for more, q to quit, c to continue without paging--
er) (s=s@entry=0x579e10) at kernel/qeventdispatcher_glib.cpp:277
#14 0x00007ffff3fb82b7 in g_main_dispatch (context=0x7fffec005000)
    at ../glib/gmain.c:3309
#15 g_main_context_dispatch (context=0x7fffec005000) at ../glib/gmain.c:3974
#16 0x00007ffff3fb8638 in g_main_context_iterate
    (context=context@entry=0x7fffec005000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4047
#17 0x00007ffff3fb86ef in g_main_context_iteration
    (context=0x7fffec005000, may_block=may_block@entry=1)
    at ../glib/gmain.c:4108
#18 0x00007ffff59ab05f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x56c300, flags=...)
    at kernel/qeventdispatcher_glib.cpp:423
#19 0x00007ffff59525db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffffffcdd0, flags=..., flags@entry=...)
    at ../../include/QtCore/../../src/corelib/global/qflags.h:141
#20 0x00007ffff595a840 in QCoreApplication::exec() ()
    at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#21 0x00007ffff5d87a8c in QGuiApplication::exec() ()
    at kernel/qguiapplication.cpp:1867
#22 0x00007ffff6b33045 in QApplication::exec() ()
    at kernel/qapplication.cpp:2811
#23 0x0000000000415e79 in main(int, char**)
    (argc=<optimized out>, argv=<optimized out>)
    at /home/nate/kde/src/discover/discover/main.cpp:183
Comment 1 Bug Janitor Service 2020-08-26 10:53:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/knewstuff/-/merge_requests/41
Comment 2 Dan Leinir Turthra Jensen 2020-08-28 18:07:09 UTC
Git commit edd790b9d7c18a468ab2fbe76cb11694b1c336dd by Dan Leinir Turthra Jensen.
Committed on 28/08/2020 at 18:07.
Pushed by leinir into branch 'master'.

Make the internal kpackage job task less fragile

This is done to ensure we don't end up emitting things on an
already-deleted object, which breaks. We cannot simply swap the existing
code out for a connection that's queued, as we may end up not emitting
the result, which would be a problem in itself.

Also clean up the error reporting a touch while we're at it.

M  +41   -19   src/core/jobs/kpackagejob.cpp

https://invent.kde.org/frameworks/knewstuff/commit/edd790b9d7c18a468ab2fbe76cb11694b1c336dd