Bug 458353

Summary: NeoChat SIGSEGV, Segmentation fault when closing
Product: [Applications] NeoChat Reporter: Enrico <enricobe>
Component: GeneralAssignee: Tobias Fella <fella>
Status: RESOLVED FIXED    
Severity: crash CC: carl, enricobe
Priority: NOR Keywords: drkonqi
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: GDB log of the error

Description Enrico 2022-08-26 19:52:01 UTC
Application: neochat (22.06)

Qt Version: 5.15.5
Frameworks Version: 5.97.0
Operating System: Linux 5.15.0-46-generic x86_64
Windowing System: X11
Distribution: KDE neon User - 5.25
DrKonqi: 5.25.4 [KCrashBackend]

-- Information about the crash:
Hello,
I start NeoChat as minimized in the tray bar. I open Neochat from the tray icon, open few group chats, then I right-click on the NeoChat icon in the tray bar and press "Exit".
It crashes

The crash can be reproduced sometimes.

-- Backtrace:
Application: NeoChat (neochat), signal: Segmentation fault

[New LWP 37718]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007fc21466299f in __GI___poll (fds=0x7ffd7e66d878, nfds=1, timeout=1000) at ../sysdeps/unix/sysv/linux/poll.c:29
__preamble__
[Current thread is 1 (Thread 0x7fc2104b59c0 (LWP 37715))]

Thread 2 (Thread 0x7fc20ec21700 (LWP 37718)):
#0  0x00007fc21466299f in __GI___poll (fds=0x7fc200009700, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fc2142d136e in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fc2142d14a3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fc214d825bb in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fc214d2676b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fc214b40372 in QThread::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fc215d6cf4b in ?? () from /lib/x86_64-linux-gnu/libQt5DBus.so.5
#7  0x00007fc214b41553 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fc213a35609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#9  0x00007fc21466f133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7fc2104b59c0 (LWP 37715)):
[KCrash Handler]
#4  Quotient::Connection::saveState (this=0xa00000060) at ./lib/connection.cpp:1604
#5  0x000055aae49f9c1c in Controller::~Controller (this=0x55aae4aac660 <Controller::instance()::_instance>, __in_chrg=<optimized out>) at ./src/controller.cpp:129
#6  0x00007fc2145968a7 in __run_exit_handlers (status=0, listp=0x7fc21473c718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108
#7  0x00007fc214596a60 in __GI_exit (status=<optimized out>) at exit.c:139
#8  0x00007fc21457408a in __libc_start_main (main=0x55aae49de160 <main(int, char**)>, argc=1, argv=0x7ffd7e66e8e8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd7e66e8d8) at ../csu/libc-start.c:342
#9  0x000055aae49e462e in _start () at ./src/main.cpp:302
[Inferior 1 (process 37715) detached]

Reported using DrKonqi
Comment 1 Enrico 2022-08-26 19:53:34 UTC
Created attachment 151621 [details]
GDB log of the error

This is the log generated from the "gdb" command when reproducing the crash
Comment 2 Tobias Fella 2022-08-26 20:00:55 UTC
Git commit 25226aa61f8e801cf62ecb6a15f4220d7d1bf921 by Tobias Fella.
Committed on 26/08/2022 at 20:00.
Pushed by tfella into branch 'master'.

Don't save connection state when destructing the controller

This causes neochat to crash and is done automatically by the connections

M  +0    -7    src/controller.cpp
M  +0    -1    src/controller.h

https://invent.kde.org/network/neochat/commit/25226aa61f8e801cf62ecb6a15f4220d7d1bf921