Bug 2245370

Summary: vokoscreenNG: segfault on startup
Product: [Fedora] Fedora Reporter: Jerry James <loganjerry>
Component: vokoscreenNGAssignee: Artem <ego.cordatus>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 38CC: ego.cordatus, epel-packagers-sig
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: vokoscreenNG-3.8.0-6.fc38 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-10-31 01:16:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jerry James 2023-10-21 03:11:51 UTC
A user reported in https://discussion.fedoraproject.org/t/vokoscreenng-3-8-0-vs-3-7-0/93244 that vokoscreenNG segfaults on startup.  I can replicate the problem on a Fedora 38 machine running a GNOME X11 session.  Running under GDB:

Thread 1 "vokoscreenNG" received signal SIGSEGV, Segmentation fault.
QAction::setText (this=this@entry=0x0, text=...) at kernel/qaction.cpp:714
714         Q_D(QAction);                                                                                               
(gdb) bt
#0  QAction::setText(QString const&) (this=this@entry=0x0, text=...) at kernel/qaction.cpp:714
#1  0x00005555555e7bb9 in QvkSystray::setMenueText() (this=0x5555573d0940) at ../systray/QvkSystray.cpp:186
#2  0x00005555555bffee in QvkMainWindow::changeLanguageInSourcecode() (this=0x555555a59b80) at ../mainwindow.cpp:771
#3  0x0000555555631d4b in QvkMainWindow::slot_languageChanged(int) (this=0x555555a59b80) at ../mainwindow.cpp:747
#4  QvkMainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    (_o=0x555555a59b80, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at /usr/src/debug/vokoscreenNG-3.8.0-1.fc38.x86_64/src/x86_64-redhat-linux-gnu/moc_mainwindow.cpp:273
#5  0x00007ffff64e8608 in doActivate<false>(QObject*, int, void**)
    (sender=0x55555610f8c0, signal_index=12, argv=0x7fffffffd2e0) at kernel/qobject.cpp:3937
#6  0x00007ffff64e33a7 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**)
    (sender=sender@entry=0x55555610f8c0, m=m@entry=0x7ffff78d6be0 <QComboBox::staticMetaObject>, local_signal_index=local_signal_index@entry=5, argv=argv@entry=0x7fffffffd2e0) at kernel/qobject.cpp:3985
#7  0x00007ffff74bcd83 in QComboBox::currentIndexChanged(int) (this=this@entry=0x55555610f8c0, _t1=<optimized out>)
    at .moc/moc_qcombobox.cpp:538
#8  0x00007ffff74be72a in QComboBoxPrivate::_q_emitCurrentIndexChanged(QModelIndex const&)
    (this=this@entry=0x55555610eed0, index=...)
    at ../../include/QtCore/../../src/corelib/itemmodels/qabstractitemmodel.h:62
#9  0x00007ffff74c22c4 in QComboBoxPrivate::setCurrentIndex(QModelIndex const&)
    (this=this@entry=0x55555610eed0, mi=...) at widgets/qcombobox.cpp:2331
#10 0x00007ffff74c2669 in QComboBox::setCurrentIndex(int) (this=<optimized out>, index=index@entry=15)
    at widgets/qcombobox.cpp:2293
#11 0x0000555555657cbb in QvkSettings::readAll(Ui_formMainWindow*, QMainWindow*) [clone .isra.0]
    (ui_mainwindow=0x555555e23a80, parent=0x555555a59b80, this=<optimized out>) at ../settings/QvkSettings.cpp:143
#12 0x000055555564598f in QvkMainWindow::QvkMainWindow(QWidget*) [clone .constprop.0] (this=0x555555a59b80, parent=0x0)
    at ../mainwindow.cpp:603
#13 0x000055555559d4ab in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at ../main.cpp:173

So "this" is NULL in frame 0.  Moving up to frame 1, we are in this function (in src/systray/QvkSystray.cpp):

void QvkSystray::setMenueText()
{
    startAction->setText( tr( "Start" ) );
    stopAction->setText( tr( "Stop" ) );
    pauseAction->setText( tr( "Pause" ) );
    continueAction->setText( tr( "Continue" ) );
    cameraAction->setText( tr( "Camera" ) );
    magnifierAction->setText( tr( "Magnification" ) );
    exitAction->setText( tr( "Exit" ) );
}

The value of startAction is set in QvkSystray::init().  Setting a breakpoint on that method verifies that it is not called prior to the segfault.  That is, QvkSystray::setMenueText() is called *before* QvkSystray::init().

The init() method should have been called in src/mainwindow.cpp, line 511.  Setting a breakpoint on line 510 shows that QSystemTrayIcon::isSystemTrayAvailable() returns false, so the call to QvkSystray::init() is skipped.  In that case, the code should not call any more QvkSystray methods, but goes on to call setMenueText anyway.

Reproducible: Always

Steps to Reproduce:
1. Run vokoscreenNG in a GNOME X11 session on a Fedora 38 x86_64 machine

Actual Results:  
A segfault.

Expected Results:  
Normal execution.

Comment 1 Fedora Update System 2023-10-22 19:43:08 UTC
FEDORA-2023-525e7a57e2 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-525e7a57e2

Comment 2 Artem 2023-10-22 19:46:46 UTC
Please keep in mind that you need also this [1] update for new vokoscreenNG build.

[1]: https://bodhi.fedoraproject.org/updates/FEDORA-2023-56ad2782ca

Comment 3 Fedora Update System 2023-10-23 02:30:23 UTC
FEDORA-2023-525e7a57e2 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-525e7a57e2`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-525e7a57e2

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2023-10-31 01:16:48 UTC
FEDORA-2023-525e7a57e2 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.