Bug 409375

Summary: SIGSEGV in QAction::setEnabled()
Product: [Applications] KSystemLog Reporter: Nathaniel Beaver <nathanielmbeaver>
Component: generalAssignee: Nicolas Ternisien <nicolas.ternisien>
Status: RESOLVED FIXED    
Severity: normal CC: wbauer1
Priority: NOR    
Version: 18.04   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 20.04.2
Sentry Crash Report:
Attachments: stack trace
stack trace with inline source code (via apport)

Description Nathaniel Beaver 2019-07-01 15:49:49 UTC
Created attachment 121262 [details]
stack trace

SUMMARY

KSystemLog segfaults reproducibly on exit.

Downstream bug report:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=889919

STEPS TO REPRODUCE

1. Run `ksystemlog` command from a terminal as regular user (not root).

2. Click "Kernel log"

3. Ctrl-T to open a new tab.

4. Click X button to close window.

5. Get a SIGSEGV / core dump.

OBSERVED RESULT

Exits with SIGSEGV.

Shows this output:
ksystemlog:  Log manager is not yet initialized
ksystemlog:  Log manager is not yet initialized
Segmentation fault (core dumped)

EXPECTED RESULT

Exits  cleanly.

SOFTWARE/OS VERSIONS
Linux distribution: Ubuntu 18.04.2 LTS (bionic)
KDE Plasma Version: 5.12.7
KDE Frameworks Version: 5.44.0
Qt Version:  5.9.5
Kernel Version: 4.15.0-52-generic
OS Type: 64-bit
$ ksystemlog --version
ksystemlog 17.12.3

ADDITIONAL INFORMATION

Reproduced in version 17.12.3-0ubuntu1.

Originally reported for Debian 9.3 with KSystemLog version 16.08.3,
but also reproducible in Debian sid (17.08.3).

Full stack trace with debugging symbols is attached.
Comment 1 Nathaniel Beaver 2019-07-01 15:53:45 UTC
Created attachment 121263 [details]
stack trace with inline source code (via apport)
Comment 2 Nathaniel Beaver 2019-07-01 16:05:18 UTC
Possibly related commit?

https://cgit.kde.org/ksystemlog.git/commit/?id=fedacb685dcf1355afe6943ae2106bc7900f98ae
Comment 3 Wolfgang Bauer 2020-05-20 18:45:39 UTC
Confirmed here with the latest version, but also older ones.

Possible fix:
https://invent.kde.org/system/ksystemlog/-/merge_requests/1
Comment 4 Wolfgang Bauer 2020-05-26 17:57:53 UTC
Git commit eeab31a116535efc6d4757f027897265736ed161 by Wolfgang Bauer.
Committed on 17/05/2020 at 20:22.
Pushed by vmatyushin into branch 'release/20.04'.

Disconnect `QtabWidget::currentChanged` signal on window close event

Otherwise `MainWindow::changeCurrentTab()` may still get called when things are already being destroyed, leading to crashes.
FIXED-IN: 20.04.2

M  +2    -0    src/mainWindow.cpp

https://invent.kde.org/system/ksystemlog/commit/eeab31a116535efc6d4757f027897265736ed161