Summary: | Qt5.15 Crash on right click | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | Antonio Rojas <arojas> |
Component: | general | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | a.samirh78, asturm, fabian, massimiliano.torromeo, nate |
Priority: | NOR | ||
Version: | 20.03.80 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/utilities/konsole/commit/27ee6a27380c91b7e98d9fa09915a9d33ee03ea1 | Version Fixed In: | 20.04.2 |
Attachments: | konsole-20200425-001339.kcrash.txt |
Description
Antonio Rojas
2020-04-02 08:15:26 UTC
Created attachment 127842 [details]
konsole-20200425-001339.kcrash.txt
Yes, same here with 20.04.0. Attaching backtrace with debug symbols.
Operating System: Gentoo
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.69.0
Qt Version: 5.15.0
Kernel Version: 5.6.5-gentoo
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-4790K CPU @ 4.00GHz
Memory: 15.4 GiB of RAM
To be precise, it crashes exactly when hovering over "Set Encoding", before it manages to pop up the submenu. It does not do the same with "Switch Profile". Any chance you can try on < Qt5.15? It would be nice to confirm it is something new in Qt5.15. yes, this is Qt5.15 specific (In reply to Antonio Rojas from comment #4) > yes, this is Qt5.15 specific Yes indeed. The issue seems to be: connect(_codecAction->menu(), &QMenu::aboutToShow, this, &Konsole::SessionController::updateCodecAction); void SessionController::updateCodecAction() { _codecAction->setCurrentCodec(QString::fromUtf8(_session->codec())); } bool KCodecAction::setCurrentCodec(QTextCodec *codec) { ... if (codec == KCharsets::charsets()->codecForName(actions().at(i)->menu()->actions().at(j)->text())) { d->currentSubAction = actions().at(i)->menu()->actions().at(j); d->currentSubAction->trigger(); return true; } ... } So the aboutToShow signal hides the menu directly, leading to a null deref later on. It should probably use ->setChecked(true); instead. So this is a KCodecAction issue? Have you tried using other apps that have a codec menu to see if they all crash. (In reply to Kurt Hindenburg from comment #8) > So this is a KCodecAction issue? I changed KCodecAction to use setChecked(true); throughout and it did fully fix the crash. It doesn't have the same behaviour though, the parent QAction doesn't get checked automatically. > Have you tried using other apps that have a codec menu to see if they all crash. I tried it in KMail and it does not crash. Most likely it does not call setCurrentCodec in aboutToShow. Git commit e7e8e9d1a9b129d73a4c502af873fb01fb2795fb by Kurt Hindenburg, on behalf of Ahmad Samir. Committed on 29/05/2020 at 11:43. Pushed by hindenburg into branch 'master'. [SessionController] Fix crash caused by text encoding menu QMenu since 5.15 is hidden when an action is triggered, this caused a crash in Konsole when trying to access the text encoding menu. Now Session emits a signal when the text encoding is changed, the SessionController can connect to that singal to set the current codec in the KCodecAction object. Also fix the EditProfileDialog so that when the KCodecAction menu is shown the currently set codec is selected. FIXED-IN: 20.08 M +1 -0 src/EditProfileDialog.cpp M +2 -0 src/Session.cpp M +5 -0 src/Session.h M +4 -3 src/SessionController.cpp M +1 -1 src/SessionController.h https://invent.kde.org/utilities/konsole/commit/e7e8e9d1a9b129d73a4c502af873fb01fb2795fb Git commit 27ee6a27380c91b7e98d9fa09915a9d33ee03ea1 by Kurt Hindenburg, on behalf of Ahmad Samir. Committed on 29/05/2020 at 12:00. Pushed by hindenburg into branch 'release/20.04'. [SessionController] Fix crash caused by text encoding menu QMenu since 5.15 is hidden when an action is triggered, this caused a crash in Konsole when trying to access the text encoding menu. Now Session emits a signal when the text encoding is changed, the SessionController can connect to that singal to set the current codec in the KCodecAction object. Also fix the EditProfileDialog so that when the KCodecAction menu is shown the currently set codec is selected. FIXED-IN: 20.08 (cherry picked from commit e7e8e9d1a9b129d73a4c502af873fb01fb2795fb) M +1 -0 src/EditProfileDialog.cpp M +2 -0 src/Session.cpp M +5 -0 src/Session.h M +4 -3 src/SessionController.cpp M +1 -1 src/SessionController.h https://invent.kde.org/utilities/konsole/commit/27ee6a27380c91b7e98d9fa09915a9d33ee03ea1 @Fabian: I am sorry, I forgot to credit you in the commit message, you basically pin-pointed the responsible code in Konsole. (In reply to Ahmad Samir from comment #13) > @Fabian: I am sorry, I forgot to credit you in the commit message, you > basically pin-pointed the responsible code in Konsole. No worries. What counts is that the bug is fixed! |