https://bugs.kde.org/show_bug.cgi?id=350140

Bernhard Übelacker <bernha...@mailbox.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bernha...@mailbox.org

--- Comment #56 from Bernhard Übelacker <bernha...@mailbox.org> ---
I received some similar crashes when closing ksysguard.
Therefore I tried to do some more investigation using rr-debugger.

It was quite good reproducible by opening ksysguard, then watching
a partial build of e.g. wine (many short lived processes).


There I could track it down to following free,
which destroys the QLabel in sbCpuStat:


(rr) reverse-cont
Continuing.

Thread 1 hit Breakpoint 6, __GI___libc_free (mem=0x562c360be2e0) at
malloc.c:3092
3092    in malloc.c
9: Toplevel = (class TopLevel *) 0x562c35c4ecf0
10: Toplevel->sbCpuStat = (class QLabel *) 0x562c360be2e0
11: Toplevel->sbCpuStat->d_ptr = {d = 0x562c36043d30}
12: x/i $pc
=> 0x7f2c687dd720 <__GI___libc_free>:   sub    $0x18,%rsp
(rr) bt
#0  __GI___libc_free (mem=0x562c360be2e0) at malloc.c:3092
#1  0x00007f2c66eacbde in QObjectPrivate::deleteChildren()
(this=this@entry=0x562c360403c0) at kernel/qobject.cpp:2104
#2  0x00007f2c67b04736 in QWidget::~QWidget() (this=0x562c36040380,
__in_chrg=<optimized out>) at kernel/qwidget.cpp:1522
#3  0x00007f2c67c72319 in QStatusBar::~QStatusBar() (this=0x562c36040380,
__in_chrg=<optimized out>) at widgets/qstatusbar.cpp:252
#4  0x00007f2c66eacbde in QObjectPrivate::deleteChildren()
(this=this@entry=0x562c35c6d420) at kernel/qobject.cpp:2104
#5  0x00007f2c67b04736 in QWidget::~QWidget() (this=0x562c35c4ecf0,
__in_chrg=<optimized out>) at kernel/qwidget.cpp:1522
#6  0x00007f2c68945aa7 in TopLevel::~TopLevel() (this=0x562c35c4ecf0,
__in_chrg=<optimized out>, __vtt_parm=<optimized out>) at
/usr/include/ksysguard/ksgrd/SensorClient.h:44
#7  TopLevel::~TopLevel() (this=0x562c35c4ecf0, __in_chrg=<optimized out>,
__vtt_parm=<optimized out>) at
./obj-x86_64-linux-gnu/gui/kdeinit_ksysguard_autogen/EWIEGA46WW/../../../../gui/ksysguard.h:41
#8  0x00007f2c66eaedaf in QObject::event(QEvent*) (this=0x562c35c4ecf0,
e=0x562c36389a10) at kernel/qobject.cpp:1301
#9  0x00007f2c6834f659 in KXmlGuiWindow::event(QEvent*) () at
/usr/lib/x86_64-linux-gnu/libKF5XmlGui.so.5
#10 0x00007f2c67ac915f in QApplicationPrivate::notify_helper(QObject*, QEvent*)
(this=<optimized out>, receiver=0x562c35c4ecf0, e=0x562c36389a10) at
kernel/qapplication.cpp:3632
#11 0x00007f2c66e82fca in QCoreApplication::notifyInternal2(QObject*, QEvent*)
(receiver=0x562c35c4ecf0, event=0x562c36389a10) at
kernel/qcoreapplication.cpp:1063
#12 0x00007f2c66e85a01 in QCoreApplicationPrivate::sendPostedEvents(QObject*,
int, QThreadData*) (receiver=0x0, event_type=0, data=0x562c35acb8f0) at
kernel/qcoreapplication.cpp:1817
#13 0x00007f2c66edae93 in postEventSourceDispatch(GSource*, GSourceFunc,
gpointer) (s=0x562c35c59fc0) at kernel/qeventdispatcher_glib.cpp:277
#14 0x00007f2c5da0ee6b in g_main_dispatch (context=0x7f2c4c005000) at
../../../glib/gmain.c:3325
#15 g_main_context_dispatch (context=0x7f2c4c005000) at
../../../glib/gmain.c:4043
#16 0x00007f2c5da0f118 in g_main_context_iterate
(context=context@entry=0x7f2c4c005000, block=block@entry=1,
dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4119
#17 0x00007f2c5da0f1cf in g_main_context_iteration (context=0x7f2c4c005000,
may_block=may_block@entry=1) at ../../../glib/gmain.c:4184
#18 0x00007f2c66eda51f in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
(this=0x562c35c6b380, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#19 0x00007f2c66e8198b in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
(this=this@entry=0x7ffcffd2dea0, flags=..., flags@entry=...) at
../../include/QtCore/../../src/corelib/global/qflags.h:69
#20 0x00007f2c66e89c00 in QCoreApplication::exec() () at
../../include/QtCore/../../src/corelib/global/qflags.h:121
#21 0x00007f2c6898206f in kdemain(int, char**) (argc=<optimized out>,
argv=<optimized out>) at ./gui/ksysguard.cpp:627
#22 0x00007f2c68779d0a in __libc_start_main (main=0x562c354bc050 <main>,
argc=1, argv=0x7ffcffd2e0c8, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7ffcffd2e0b8) at ../csu/libc-start.c:308
#23 0x0000562c354bc08a in _start ()
(rr) when
Current event: 531099


Then a little later the same also destroyed TopLevel object is referenced,
and an assignment to the sbCpuStat QLabel is done.


(rr) cont
Continuing.

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007f2c66d247a9 in operator== (s1=<error reading variable: Cannot access
memory at address 0x2e002e0020007e>, s2="CPU: 15 %\302\234\061\065 %") at
text/qstring.cpp:3437
3437        if (s1.d->size != s2.d->size)
9: Toplevel = (TopLevel *) 0x562c35c4ecf0
10: Toplevel->sbCpuStat = (QLabel *) 0x562c360be2e0
11: Toplevel->sbCpuStat->d_ptr = {d = 0x562c3609fb90}
12: x/i $pc
=> 0x7f2c66d247a9 <_ZeqRK7QStringS1_+9>:        movslq 0x4(%rax),%rsi
(rr) bt
#0  0x00007f2c66d247a9 in operator==(QString const&, QString const&) (s1=<error
reading variable: Cannot access memory at address 0x2e002e0020007e>, s2="CPU:
15 %\302\234\061\065 %") at text/qstring.cpp:3437
#1  0x00007f2c67bfd3e5 in QLabel::setText(QString const&) (this=0x562c360be2e0,
text="CPU: 15 %\302\234\061\065 %") at widgets/qlabel.cpp:323
#2  0x00007f2c68980f6b in TopLevel::answerReceived(int, QList<QByteArray>
const&) (this=0x562c35c4ecf0, id=<optimized out>, answerList=<optimized out>)
at ./gui/ksysguard.cpp:466
#3  0x00007f2c686c1b12 in KSGRD::SensorAgent::processAnswer(char const*, int)
(this=0x562c3613dfc0, buf=<optimized out>, buflen=<optimized out>) at
./ksgrd/SensorAgent.cpp:186
#4  0x00007f2c686c8081 in KSGRD::SensorShellAgent::msgRcvd()
(this=0x562c3613dfc0) at ./ksgrd/SensorShellAgent.cpp:93
#5  0x00007f2c66eb95a6 in QtPrivate::QSlotObjectBase::call(QObject*, void**)
(a=0x7ffcffd2d9d0, r=0x562c3613dfc0, this=0x562c36136f70) at
../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#6  doActivate<false>(QObject*, int, void**) (sender=0x562c36140650,
signal_index=15, argv=argv@entry=0x7ffcffd2d9d0) at kernel/qobject.cpp:3886
#7  0x00007f2c66eb2900 in QMetaObject::activate(QObject*, QMetaObject const*,
int, void**) (sender=<optimized out>, m=m@entry=0x7f2c67116d80
<QProcess::staticMetaObject>, local_signal_index=local_signal_index@entry=6,
argv=argv@entry=0x7ffcffd2d9d0) at kernel/qobject.cpp:3946
#8  0x00007f2c66df022d in
QProcess::readyReadStandardOutput(QProcess::QPrivateSignal) (this=<optimized
out>, _t1=...) at .moc/moc_qprocess.cpp:367
#9  0x00007f2c66df57ed in
QProcessPrivate::tryReadFromChannel(QProcessPrivate::Channel*)
(this=0x562c36110be0, channel=0x562c36110cf0) at io/qprocess.cpp:1073
#10 0x00007f2c66df5d25 in QProcessPrivate::_q_canReadStandardError()
(this=<optimized out>) at io/qprocess.cpp:1092
#11 QProcess::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
(_o=<optimized out>, _c=<optimized out>, _id=<optimized out>,
_a=0x7ffcffd2db80) at .moc/moc_qprocess.cpp:210
#12 0x00007f2c66eb95e0 in doActivate<false>(QObject*, int, void**)
(sender=0x562c3613b520, signal_index=3, argv=argv@entry=0x7ffcffd2db80) at
kernel/qobject.cpp:3898
#13 0x00007f2c66eb2900 in QMetaObject::activate(QObject*, QMetaObject const*,
int, void**) (sender=sender@entry=0x562c3613b520, m=m@entry=0x7f2c67119160
<QSocketNotifier::staticMetaObject>,
local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffcffd2db80)
at kernel/qobject.cpp:3946
#14 0x00007f2c66ebc9df in QSocketNotifier::activated(QSocketDescriptor,
QSocketNotifier::Type, QSocketNotifier::QPrivateSignal)
(this=this@entry=0x562c3613b520, _t1=..., _t2=<optimized out>, _t3=...) at
.moc/moc_qsocketnotifier.cpp:178
#15 0x00007f2c66ebd1db in QSocketNotifier::event(QEvent*) (this=0x562c3613b520,
e=0x7ffcffd2dc90) at kernel/qsocketnotifier.cpp:302
#16 0x00007f2c67ac915f in QApplicationPrivate::notify_helper(QObject*, QEvent*)
(this=<optimized out>, receiver=0x562c3613b520, e=0x7ffcffd2dc90) at
kernel/qapplication.cpp:3632
#17 0x00007f2c66e82fca in QCoreApplication::notifyInternal2(QObject*, QEvent*)
(receiver=0x562c3613b520, event=0x7ffcffd2dc90) at
kernel/qcoreapplication.cpp:1063
#18 0x00007f2c66edb0d5 in socketNotifierSourceDispatch(GSource*, GSourceFunc,
gpointer) (source=0x562c35b23300) at kernel/qeventdispatcher_glib.cpp:107
#19 0x00007f2c5da0ee6b in g_main_dispatch (context=0x7f2c4c005000) at
../../../glib/gmain.c:3325
#20 g_main_context_dispatch (context=0x7f2c4c005000) at
../../../glib/gmain.c:4043
#21 0x00007f2c5da0f118 in g_main_context_iterate
(context=context@entry=0x7f2c4c005000, block=block@entry=1,
dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4119
#22 0x00007f2c5da0f1cf in g_main_context_iteration (context=0x7f2c4c005000,
may_block=may_block@entry=1) at ../../../glib/gmain.c:4184
#23 0x00007f2c66eda51f in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
(this=0x562c35c6b380, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#24 0x00007f2c66e8198b in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
(this=this@entry=0x7ffcffd2dea0, flags=..., flags@entry=...) at
../../include/QtCore/../../src/corelib/global/qflags.h:69
#25 0x00007f2c66e89c00 in QCoreApplication::exec() () at
../../include/QtCore/../../src/corelib/global/qflags.h:121
#26 0x00007f2c6898206f in kdemain(int, char**) (argc=<optimized out>,
argv=<optimized out>) at ./gui/ksysguard.cpp:627
#27 0x00007f2c68779d0a in __libc_start_main (main=0x562c354bc050 <main>,
argc=1, argv=0x7ffcffd2e0c8, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7ffcffd2e0b8) at ../csu/libc-start.c:308
#28 0x0000562c354bc08a in _start ()


Unfortunately I don't know how this is best avoided.
I have not tested, but maybe a explicit deletion
of the mMonitorRemoteAction object would disconnect the signal?

Or "some SensorAgent" has to be disconnected in some other way?


The following search show some more newer reports that look
similar and are not yet marked as duplicate:
https://bugs.kde.org/buglist.cgi?quicksearch=KSGRD%3A%3ASensorAgent%3A%3AprocessAnswer

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to