Bug 406437

Summary: ksirk crashes
Product: [Applications] ksirk Reporter: LonelyWoolf <lonelywoolf>
Component: generalAssignee: Nemanja Hirsl <nemhirsl>
Status: RESOLVED FIXED    
Severity: crash CC: aacid, kde-games-bugs-null
Priority: NOR Keywords: drkonqi
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: valgrind output

Description LonelyWoolf 2019-04-11 13:35:52 UTC
Application: ksirk (5.0.0)

Qt Version: 5.12.1
Frameworks Version: 5.55.0
Operating System: Linux 5.1.0-0.rc4.git0.1.fc31.x86_64 x86_64
Distribution (Platform): Fedora RPMs

-- Information about the crash:
- What I was doing when the application crashed:
Just gaming in it. After some playing this happens. It's crashing always after 15-30 minutes.

The crash can be reproduced every time.

-- Backtrace:
Application: KsirK (ksirk), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f98a90c1cc0 (LWP 13417))]

Thread 12 (Thread 0x7f9874a07700 (LWP 19753)):
#0  0x00007f98a776281d in nanosleep () at /lib64/libc.so.6
#1  0x00007f98a7d33d35 in  () at /lib64/libQt5Core.so.5
#2  0x00005575f3467755 in Ksirk::GameLogic::AIPlayer::MyThread::run() (this=0x5575f531a5f0) at /usr/src/debug/ksirk-18.12.2-1.fc30.x86_64/ksirk/GameLogic/aiplayer.cpp:361
#3  0x00007f98a7b388a6 in  () at /lib64/libQt5Core.so.5
#4  0x00007f98a5f6b5a2 in start_thread () at /lib64/libpthread.so.0
#5  0x00007f98a7796023 in clone () at /lib64/libc.so.6

Thread 11 (Thread 0x7f9875a09700 (LWP 13477)):
#0  0x00007f98a77a36c3 in __libc_enable_asynccancel () at /lib64/libc.so.6
#1  0x00007f98a7786da7 in read () at /lib64/libc.so.6
#2  0x00007f98a51f6205 in pa_read () at /usr/lib64/pulseaudio/libpulsecommon-12.2.so
#3  0x00007f98a7571dc6 in pa_mainloop_prepare () at /lib64/libpulse.so.0
#4  0x00007f98a7572854 in pa_mainloop_iterate () at /lib64/libpulse.so.0
#5  0x00007f98a7572910 in pa_mainloop_run () at /lib64/libpulse.so.0
#6  0x00007f98a7580c0d in  () at /lib64/libpulse.so.0
#7  0x00007f98a5225d0c in  () at /usr/lib64/pulseaudio/libpulsecommon-12.2.so
#8  0x00007f98a5f6b5a2 in start_thread () at /lib64/libpthread.so.0
#9  0x00007f98a7796023 in clone () at /lib64/libc.so.6

Thread 10 (Thread 0x7f98771e1700 (LWP 13435)):
#0  0x00007f98a5f714e5 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f988329b1f3 in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007f988329ae2b in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007f98a5f6b5a2 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f98a7796023 in clone () at /lib64/libc.so.6

Thread 9 (Thread 0x7f98779e2700 (LWP 13434)):
#0  0x00007f98a5f714e5 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f988329b1f3 in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007f988329ae2b in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007f98a5f6b5a2 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f98a7796023 in clone () at /lib64/libc.so.6

Thread 8 (Thread 0x7f9880907700 (LWP 13433)):
#0  0x00007f98a5f714e5 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f988329b1f3 in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007f988329ae2b in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007f98a5f6b5a2 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f98a7796023 in clone () at /lib64/libc.so.6

Thread 7 (Thread 0x7f9881108700 (LWP 13432)):
#0  0x00007f98a5f714e5 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f988329b1f3 in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007f988329ae2b in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007f98a5f6b5a2 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f98a7796023 in clone () at /lib64/libc.so.6

Thread 6 (Thread 0x7f9881909700 (LWP 13431)):
#0  0x00007f98a5f714e5 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f988329b1f3 in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007f988329ae2b in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007f98a5f6b5a2 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f98a7796023 in clone () at /lib64/libc.so.6

Thread 5 (Thread 0x7f988210a700 (LWP 13430)):
#0  0x00007f98a5f714e5 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f988329b1f3 in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007f988329ae2b in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007f98a5f6b5a2 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f98a7796023 in clone () at /lib64/libc.so.6

Thread 4 (Thread 0x7f988f502700 (LWP 13429)):
#0  0x00007f98a5f714e5 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f988329b1f3 in  () at /usr/lib64/dri/radeonsi_dri.so
#2  0x00007f988329ae2b in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007f98a5f6b5a2 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f98a7796023 in clone () at /lib64/libc.so.6

Thread 3 (Thread 0x7f9894e6a700 (LWP 13419)):
#0  0x00007f98a778b2b7 in poll () at /lib64/libc.so.6
#1  0x00007f98a533b2ae in  () at /lib64/libglib-2.0.so.0
#2  0x00007f98a533b3e3 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#3  0x00007f98a7d34543 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#4  0x00007f98a7cde41b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#5  0x00007f98a7b37745 in QThread::exec() () at /lib64/libQt5Core.so.5
#6  0x00007f98a75baf3b in  () at /lib64/libQt5DBus.so.5
#7  0x00007f98a7b388a6 in  () at /lib64/libQt5Core.so.5
#8  0x00007f98a5f6b5a2 in start_thread () at /lib64/libpthread.so.0
#9  0x00007f98a7796023 in clone () at /lib64/libc.so.6

Thread 2 (Thread 0x7f9895d72700 (LWP 13418)):
#0  0x00007f98a778b2b7 in poll () at /lib64/libc.so.6
#1  0x00007f98a52c838a in  () at /lib64/libxcb.so.1
#2  0x00007f98a52c9ffa in xcb_wait_for_event () at /lib64/libxcb.so.1
#3  0x00007f9895f6f918 in  () at /lib64/libQt5XcbQpa.so.5
#4  0x00007f98a7b388a6 in  () at /lib64/libQt5Core.so.5
#5  0x00007f98a5f6b5a2 in start_thread () at /lib64/libpthread.so.0
#6  0x00007f98a7796023 in clone () at /lib64/libc.so.6

Thread 1 (Thread 0x7f98a90c1cc0 (LWP 13417)):
[KCrash Handler]
#6  0x00007f98a5f72b64 in pthread_cancel () at /lib64/libpthread.so.0
#7  0x00007f98a7b3851b in QThread::terminate() () at /lib64/libQt5Core.so.5
#8  0x00005575f3467a0d in Ksirk::GameLogic::AIPlayer::~AIPlayer() (this=0x5575f59a3600, __in_chrg=<optimized out>) at /usr/src/debug/ksirk-18.12.2-1.fc30.x86_64/ksirk/GameLogic/aiplayer.cpp:84
#9  0x00005575f34593ad in Ksirk::GameLogic::AIColsonPlayer::~AIColsonPlayer() (this=0x5575f59a3600, __in_chrg=<optimized out>) at /usr/src/debug/ksirk-18.12.2-1.fc30.x86_64/ksirk/GameLogic/aiColsonPlayer.cpp:66
#10 0x00005575f34206db in Ksirk::KGameWindow::attackEnd() () at /usr/include/qt5/QtCore/qlist.h:115
#11 0x00005575f3408a1d in Ksirk::GameLogic::GameAutomaton::slotNetworkData(int, QByteArray const&, unsigned int, unsigned int) () at /usr/src/debug/ksirk-18.12.2-1.fc30.x86_64/ksirk/GameLogic/gameautomaton.cpp:2145
#12 0x00005575f34cfea8 in Ksirk::GameLogic::GameAutomaton::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /usr/src/debug/ksirk-18.12.2-1.fc30.x86_64/x86_64-redhat-linux-gnu/ksirk/ksirk_autogen/EDAMEEOPZ5/moc_gameautomaton.cpp:130
#13 0x00007f98a7d096ab in QMetaObject::activate(QObject*, int, int, void**) () at /lib64/libQt5Core.so.5
#14 0x00007f98a9579da7 in KGame::signalNetworkData(int, QByteArray const&, unsigned int, unsigned int) () at /lib64/libKF5KDEGamesPrivate.so.1
#15 0x00007f98a953a651 in KGame::networkTransmission(QDataStream&, int, unsigned int, unsigned int, unsigned int) () at /lib64/libKF5KDEGamesPrivate.so.1
#16 0x00007f98a9540e3c in KGameNetwork::receiveNetworkTransmission(QByteArray const&, unsigned int) () at /lib64/libKF5KDEGamesPrivate.so.1
#17 0x00007f98a7d097f0 in QMetaObject::activate(QObject*, int, int, void**) () at /lib64/libQt5Core.so.5
#18 0x00007f98a957a737 in KMessageClient::broadcastReceived(QByteArray const&, unsigned int) () at /lib64/libKF5KDEGamesPrivate.so.1
#19 0x00007f98a954d10e in KMessageClient::processMessage(QByteArray const&) () at /lib64/libKF5KDEGamesPrivate.so.1
#20 0x00007f98a954c7d7 in KMessageClient::processIncomingMessage(QByteArray const&) () at /lib64/libKF5KDEGamesPrivate.so.1
#21 0x00007f98a7d097f0 in QMetaObject::activate(QObject*, int, int, void**) () at /lib64/libQt5Core.so.5
#22 0x00007f98a957aa16 in KMessageIO::received(QByteArray const&) () at /lib64/libKF5KDEGamesPrivate.so.1
#23 0x00007f98a954f81b in  () at /lib64/libKF5KDEGamesPrivate.so.1
#24 0x00007f98a9552024 in KMessageServer::broadcastMessage(QByteArray const&) () at /lib64/libKF5KDEGamesPrivate.so.1
#25 0x00007f98a9553536 in KMessageServer::processOneMessage() () at /lib64/libKF5KDEGamesPrivate.so.1
#26 0x00007f98a7d096ab in QMetaObject::activate(QObject*, int, int, void**) () at /lib64/libQt5Core.so.5
#27 0x00007f98a7d15e3b in QTimer::timeout(QTimer::QPrivateSignal) () at /lib64/libQt5Core.so.5
#28 0x00007f98a7d0a495 in QObject::event(QEvent*) () at /lib64/libQt5Core.so.5
#29 0x00007f98a8721c56 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#30 0x00007f98a872b0a0 in QApplication::notify(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#31 0x00007f98a7cdf428 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#32 0x00007f98a7d33786 in QTimerInfoList::activateTimers() () at /lib64/libQt5Core.so.5
#33 0x00007f98a7d34084 in  () at /lib64/libQt5Core.so.5
#34 0x00007f98a533afa0 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#35 0x00007f98a533b338 in  () at /lib64/libglib-2.0.so.0
#36 0x00007f98a533b3e3 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#37 0x00007f98a7d344b2 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#38 0x00007f98a7cde41b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#39 0x00007f98a7ce6106 in QCoreApplication::exec() () at /lib64/libQt5Core.so.5
#40 0x00005575f33fb5bd in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/ksirk-18.12.2-1.fc30.x86_64/ksirk/main.cpp:81
[Inferior 1 (process 13417) detached]

Reported using DrKonqi
Comment 1 Albert Astals Cid 2019-04-12 22:12:02 UTC
How easy is for you to reproduce this crash?
Comment 2 LonelyWoolf 2019-04-12 22:15:07 UTC
Reproducible always. Some somple way - play with 6 gamers, 5 of them is computer. after 15-20 minutes of gaming (not simple runned, I must play) ksirk crashes always.
Comment 3 Albert Astals Cid 2019-04-12 23:29:59 UTC
Can you please try running 
valgrind ksirk
from the command line (may need to install valgrind), try to make it crash and attach all the valgrind output?

Note it'll be much slower when running under valgrind
Comment 4 LonelyWoolf 2019-04-13 08:16:57 UTC
Created attachment 119392 [details]
valgrind output

This is console output:

valgrind --log-file=valgrind.txt ksirk 
org.kde.games.private.kgame: :id= 0  Cannot emitSignal because there is no handler set
QObject::connect: No such signal KGameChat::signalReturnPressed(QString)
QObject::connect: Cannot queue arguments of type 'QDataStream&'
(Make sure 'QDataStream&' is registered using qRegisterMetaType().)
QLayout: Attempting to add QLayout "" to Ksirk::KRightDialog "", which already has a layout
...
QLayout: Attempting to add QLayout "" to Ksirk::KRightDialog "", which already has a layout
QObject::connect: Cannot queue arguments of type 'QDataStream&'
(Make sure 'QDataStream&' is registered using qRegisterMetaType().)
QLayout: Attempting to add QLayout "" to Ksirk::KRightDialog "", which already has a layout
...
QLayout: Attempting to add QLayout "" to Ksirk::KRightDialog "", which already has a layout
QObject::connect: Cannot queue arguments of type 'QDataStream&'
(Make sure 'QDataStream&' is registered using qRegisterMetaType().)
QLayout: Attempting to add QLayout "" to Ksirk::KRightDialog "", which already has a layout
...
QLayout: Attempting to add QLayout "" to Ksirk::KRightDialog "", which already has a layout
"Plural argument to message {<font color=\"red\">%2...} not supplied before conversion."
QLayout: Attempting to add QLayout "" to Ksirk::KRightDialog "", which already has a layout
...
QLayout: Attempting to add QLayout "" to Ksirk::KRightDialog "", which already has a layout
org.kde.games.private.kgame: : game not running
QThread::start: Thread termination error: No such process
KCrash: Application 'ksirk' crashing...
KCrash: Attempting to start /usr/libexec/drkonqi from kdeinit
sock_file=/run/user/1000/kdeinit5__0

where ... - is much of repeated messages "QLayout: Attempting to add QLayout "" to Ksirk::KRightDialog "", which already has a layout"
Comment 5 Albert Astals Cid 2019-04-15 21:49:22 UTC
thanks there's quite some bad stuff in there.

I'll try to have a look at some point if noone beats me to it (i'm not really a ksirk developer, more of a "kde code janitor")
Comment 6 Albert Astals Cid 2019-04-21 18:40:03 UTC
I made a few fixes that i think should fix this. The fix should be available for KDE Applications 19.0.4.1

I'm going to close it ad if you can, can you please try it once the next version is released and if it's still happening for you reopen this issue?