Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOFTWARE_NX_FAULT when changing off of the OpenGL renderer to OpenGL 1.x or Software on Legacy nvidia drivers in nightly x64 builds. #3374

Closed
Squall-Leonhart opened this issue Dec 15, 2024 · 5 comments
Labels
blocked:needs retest Needs a retest to confirm if it's fixed

Comments

@Squall-Leonhart
Copy link

Squall-Leonhart commented Dec 15, 2024

Affected
Geforce GT 530 r396/Windows 10 (Fermi)
Geforce GTX 680 r472/Windows 10 (Kepler)
Geforce GTX 1060 r472/Windows 7 (Pascal)

Unaffected
GTX 1060 on current dch drivers tests fine.
All of them if the 32bit nightly is used instead.

Regression pinpointed to November 23 changes, possibly 122128e, it looks like the zip loader isn't shut down properly leading to it executing from uninitialized memory when the Renderer is shut down and switched, it might just be a miracle that newer drivers aren't affected.

@Squall-Leonhart Squall-Leonhart changed the title SOFTWARE_NX_FAULT when changing off of the OpenGL renderer to OpenGL 1.x or Software on Legacy nvidia drivers in nightly builds. SOFTWARE_NX_FAULT when changing off of the OpenGL renderer to OpenGL 1.x or Software on Legacy nvidia drivers in nightly x64 builds. Dec 15, 2024
@endrift
Copy link
Member

endrift commented Dec 16, 2024

Please bisect fully. I have a full complement of builds instead of just nightlies for this reason.

@Squall-Leonhart
Copy link
Author

Squall-Leonhart commented Dec 16, 2024

Narrowed it down to f930184#diff-6da8e392f1f81cb69c9bdd0e1ea6422e62329c0debc5b28fb7b3309821bb24b8R427 specifically.

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00000001413b21a6 in QObject::disconnect(QObject const*, char const*, QObject const*, char const*) ()

#0  0x0000000140bc30c6 in QObject::disconnect(QObject const*, char const*, QObject const*, char const*) ()
#1  0x000000013f41574c in QGBA::SettingsView::setShaderSelector (    this=0x12a83730, shaderSelector=0x0)    at /home/mgba/src/src/platform/qt/SettingsView.cpp:437
#2  0x0000000140c6233f in QtPrivate::QSlotObjectBase::call(QObject*, void**) ()
#3  0x0000000140604868 in void doActivate<false>(QObject*, int, void**) ()
#4  0x000000013f3533d3 in QGBA::Window::shaderSelectorAdded (this=0x8d058a0,    this@entry=0x22c86c0, )    at /home/mgba/src/build/qt/mgba-qt_autogen/EWIEGA46WW/moc_Window.cpp:392
#5  0x000000013f43805a in QGBA::Window::reloadDisplayDriver (this=0x22c86c0)    at /home/mgba/src/src/platform/qt/Window.cpp:1058
#6  0x0000000140c6233f in QtPrivate::QSlotObjectBase::call(QObject*, void**) ()
#7  0x0000000140604868 in void doActivate<false>(QObject*, int, void**) ()
#8  0x000000013f4116a6 in QGBA::SettingsView::updateConfig (this=0x12a83730)    at /home/mgba/src/src/platform/qt/SettingsView.cpp:605
#9  0x000000013f413185 in operator() (button=<optimized out>,    __closure=0x1272b8f0)    at /home/mgba/src/src/platform/qt/SettingsView.cpp:351
#10 QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QAbstractButton*>, void, QGBA::SettingsView::SettingsView(QGBA::ConfigController*, QGBA::InputController*, QGBA::ShortcutController*, QGBA::LogController*, QWidget*)::<lambda(QAbstractButton*)> >::call (arg=<optimized out>, f=...)    at /opt/win64/include/QtCore/qobjectdefs_impl.h:146
#11 QtPrivate::Functor<QGBA::SettingsView::SettingsView(QGBA::ConfigController*, QGBA::InputController*, QGBA::ShortcutController*, QGBA::LogController*, QWidget*)::<lambda(QAbstractButton*)>, 1>::call<QtPrivate::List<QAbstractButton*>, void> (arg=<optimized out>, f=...)    at /opt/win64/include/QtCore/qobjectdefs_impl.h:256
#12 QtPrivate::QFunctorSlotObject<QGBA::SettingsView::SettingsView(QGBA::ConfigController*, QGBA::InputController*, QGBA::ShortcutController*, QGBA::LogController*, QWidget*)::<lambda(QAbstractButton*)>, 1, QtPrivate::List<QAbstractButton*>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (    which=<optimized out>, this_=0x1272b8e0, r=<optimized out>,    a=<optimized out>, ret=0x0)    at /opt/win64/include/QtCore/qobjectdefs_impl.h:443
#13 0x0000000140c6233f in QtPrivate::QSlotObjectBase::call(QObject*, void**) ()
#14 0x0000000140604868 in void doActivate<false>(QObject*, int, void**) ()
#15 0x000000014082e10e in QDialogButtonBox::clicked(QAbstractButton*) ()
#16 0x00000001409b8f41 in QDialogButtonBoxPrivate::_q_handleButtonClicked() ()
#17 0x00000001406048bc in void doActivate<false>(QObject*, int, void**) ()
#18 0x00000001407e8500 in QAbstractButton::clicked(bool) ()
#19 0x000000014098bc42 in QAbstractButtonPrivate::emitClicked() ()
#20 0x000000014098c1ff in QAbstractButtonPrivate::click() ()
#21 0x00000001407e7fb7 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) ()
#22 0x0000000140bff99d in QWidget::event(QEvent*) ()
#23 0x00000001408e2306 in QApplicationPrivate::notify_helper(QObject*, QEvent*)    ()
#24 0x000000014073dc72 in QApplication::notify(QObject*, QEvent*) ()
#25 0x0000000140829a2a in QCoreApplication::notifyInternal2(QObject*, QEvent*)    ()
#26 0x00000001408e2644 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) ()
#27 0x00000001407a8fde in QWidgetWindow::handleMouseEvent(QMouseEvent*) ()
#28 0x00000001407aa6b8 in QWidgetWindow::event(QEvent*) ()
#29 0x00000001408e2306 in QApplicationPrivate::notify_helper(QObject*, QEvent*)    ()
#30 0x0000000140829a2a in QCoreApplication::notifyInternal2(QObject*, QEvent*)    ()
#31 0x0000000140996408 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) ()
#32 0x00000001409a7fd5 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
#33 0x00000001409594c2 in QEventDispatcherWin32::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
#34 0x0000000140a122d4 in QWindowsGuiEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
#35 0x00000001406dd43f in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
#36 0x000000014082afea in QCoreApplication::exec() ()
#37 0x0000000140ed273a in main (argc=<optimized out>, argv=<optimized out>)    at /home/mgba/src/src/platform/qt/main.cpp:139

@Squall-Leonhart
Copy link
Author

this issue occurs because m_shader can already be deleted or nullptr prior to the Disconnect, the code below should prevent it but i don't have an mgba friendly build environment to be sure

void SettingsView::setShaderSelector(ShaderSelector* shaderSelector) {
#if  defined(BUILD_GLES2) || defined(USE_EPOXY)
    auto items = m_ui.tabs->findItems(tr("Shaders"), Qt::MatchFixedString);
    for (QListWidgetItem* item : items) {
        delete item;
    }
    if (!m_shader) {
        m_ui.stackedWidget->removeWidget(m_dummyShader);
    } else if (m_shader) {  
        QObject::disconnect(m_shader, nullptr, this, nullptr);
    }
    m_shader = shaderSelector;
    QObject::connect(this, &SettingsView::saveSettingsRequested, m_shader, &ShaderSelector::saveSettings);
    if (shaderSelector) {
        addPage(tr("Shaders"), m_shader, Page::SHADERS);
    } else {
        addPage(tr("Shaders"), m_dummyShader, Page::SHADERS);
    }
#endif
}

@endrift
Copy link
Member

endrift commented Feb 17, 2025

Please confirm if this is fixed after #3417

@endrift endrift added the blocked:needs retest Needs a retest to confirm if it's fixed label Feb 17, 2025
@Squall-Leonhart
Copy link
Author

I'm stuck on a machine that doesn't readily replicate the issue for the time being, but i'm confident the 2 issues are the same.

I'll close this out unless I manage to reproduce it again on my new pc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked:needs retest Needs a retest to confirm if it's fixed
Projects
None yet
Development

No branches or pull requests

2 participants