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

2.5 and main crash on shutdown #13885

Closed
ronso0 opened this issue Nov 14, 2024 · 2 comments
Closed

2.5 and main crash on shutdown #13885

ronso0 opened this issue Nov 14, 2024 · 2 comments

Comments

@ronso0
Copy link
Member

ronso0 commented Nov 14, 2024

Bug Description

I'm getting this crash on 2.5 and main 359c40e

  • --developer
  • with Qt 6.2.3 and
  • the legacy skin (backtrace below)

Did git bisect for some hours and it seems that it's caused by 4ba370b (or rather that/2.5/2.4 being merged to main?).

if (m_isDeveloper && time.elapsed() > kEventNotifyExecTimeWarningThreshold) {
qDebug() << "Processing event type"
<< event->type()
<< "for object"
<< target->metaObject()->className()
<< target->objectName()
<< "running in thread:"
<< target->thread()->objectName()
<< "took"
<< time.elapsed().debugMillisWithUnit();
}

If I disable the logging everything shuts down cleanly.

The crash happens when trying to with target->metaObject() for
MixxxMainWindow(0x561df6faa0d0, ...) QChildEvent(ChildRemoved, QWidget(0x5605e0e18530) name="Mixxx")
= when the skin widget has been deleted.

With some debug logging added in this method (which expectedly slows everything down significantly) I get the crash even for
MixxxApplication::notify: LaunchImage(0x5605e1028700) QChildEvent(ChildRemoved, QObject(0x5605e0e18530))
Later on, with simple logging only in the 'long time' branch, I get it for
QWidgetWindow(0x561df6faa0d0, name = "MixxxMainWindowClassWindow") QCloseEvent(Close, 0x7ffd1966c8a0)

Conclusion?

The target has been deleted after QApplication::notify(target, event);
Hence even the additional condition for logging
target->metaObject() != nullptr
won't work.
Could it be that the logging itself causes the delay which in turn causes the crash??

Backtrace of thread #1 debug [Main] ~DlgAutoDJ() Thread 1 "mixxx" received signal SIGSEGV, Segmentation fault. 0x0000046200000000 in ?? ()

Thread 1 (Thread 0x7fffeade0100 (LWP 1002332) "mixxx"):
#0 0x0000046200000000 in ()
#1 0x00005555560c4e9b in MixxxApplication::notify(QObject*, QEvent*) (this=, target=0x5555797d84d0, event=) at /src/mixxxapplication.cpp:206
time = {m_startTime = std::chrono::_V2::steady_clock time_point = { 304985613821353ns }, static kStoppedTimerValue = {__d = std::chrono::duration = { -9223372036854775808ns }}}
ret = true
PRETTY_FUNCTION = "virtual bool MixxxApplication::notify(QObject*, QEvent*)"
#2 0x00007ffff594c830 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt6Core.so.6
#3 0x00007ffff595002c in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /lib/x86_64-linux-gnu/libQt6Core.so.6
#4 0x00005555560d9d5f in MixxxMainWindow::~MixxxMainWindow() (this=0x7fffffffdad0, __in_chrg=) at /src/mixxxmainwindow.cpp:476
t = {m_key = {d = {d = 0x555578e5c040, ptr = 0x555578e5c050 u"~MixxxMainWindow", size = 16}, static _empty = 0 u'\000'}, m_compute = {i = 111}, m_time = {m_startTime = std::chrono::_V2::steady_clock time_point = { 304985606973501ns }, static kStoppedTimerValue = {__d = std::chrono::duration = { -9223372036854775808ns }}}}
fullscreenPref =
#5 0x000055555595d57d in (anonymous namespace)::runMixxx (args=, pApp=0x7fffffffdaa0) at /src/main.cpp:110
mainWindow = { = {}, static staticMetaObject = {d = {superdata = {direct = 0x7ffff6f60200 QMainWindow::staticMetaObject}, stringdata = 0x55555589eee0 <qt_meta_stringdata_MixxxMainWindow>, data = 0x55555589ec00 <qt_meta_data_MixxxMainWindow>, static_metacall = 0x5555560df270 <MixxxMainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, metaTypes = 0x5555567d6c60 <qt_incomplete_metaTypeArray<qt_meta_stringdata_MixxxMainWindow_t, QtPrivate::TypeAndForceComplete<MixxxMainWindow, std::integral_constant<bool, true> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<int, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<int, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<bool, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<int, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<bool, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<bool, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<bool, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<std::shared_ptr, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<int, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<QString const&, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<void, std::integral_constant<bool, false> >, QtPrivate::TypeAndForceComplete<mixxx::preferences::constants::Tooltips, std::integral_constant<bool, false> > >>, extradata = 0x0}}, m_pCoreServices = std::shared_ptr (use count 2, weak count 0) = {get() = 0x555556a32410}, m_pCentralWidget = 0x0, m_pLaunchImage = 0x0, m_prevState = {i = 2}, m_pSkinLoader = std::shared_ptr (use count 2, weak count 0) = {get() = 0x555556fe44c0}, m_pGuiTick = 0x7fffb400f8a0, m_pVisualsManager = 0x5555569d1830, m_pMenuBar = {m_ptr = 0x555556dee1d0}, m_supportsGlobalMenuBar = true, m_pDeveloperToolsDlg = 0x0, m_pPrefDlg = 0x555574f3f800, m_pKeywheel = {m_ptr = 0x0}, m_toolTipsCfg = mixxx::preferences::constants::Tooltips::On, m_inhibitScreensaver = (mixxx::preferences::constants::ScreenSaver::On | unknown: 0x5554), m_skinCreatedControls = {q_hash = {d = 0x5555797e6200}}}
exitCode = 0
console = {}
args =
app = { = {}, static staticMetaObject = {d = {superdata = {direct = 0x7ffff6f54960 QApplication::staticMetaObject}, stringdata = 0x55555589eb80 <qt_meta_stringdata_MixxxApplication>, data = 0x55555589eb40 <qt_meta_data_MixxxApplication>, static_metacall = 0x5555560c3510 <MixxxApplication::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, metaTypes = 0x5555567d6858 <qt_incomplete_metaTypeArray<qt_meta_stringdata_MixxxApplication_t, QtPrivate::TypeAndForceComplete<MixxxApplication, std::integral_constant<bool, true> > >>, extradata = 0x0}}, m_rightPressedButtons = 0, m_pTouchShift = 0x0, m_isDeveloper = true}
exitCode =
PRETTY_FUNCTION = "int main(int, char**)"
#6 main(int, char**) (argc=, argv=) at /src/main.cpp:243
console = {}
args =
app = { = {}, static staticMetaObject = {d = {superdata = {direct = 0x7ffff6f54960 QApplication::staticMetaObject}, stringdata = 0x55555589eb80 <qt_meta_stringdata_MixxxApplication>, data = 0x55555589eb40 <qt_meta_data_MixxxApplication>, static_metacall = 0x5555560c3510 <MixxxApplication::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, metaTypes = 0x5555567d6858 <qt_incomplete_metaTypeArray<qt_meta_stringdata_MixxxApplication_t, QtPrivate::TypeAndForceComplete<MixxxApplication, std::integral_constant<bool, true> > >>, extradata = 0x0}}, m_rightPressedButtons = 0, m_pTouchShift = 0x0, m_isDeveloper = true}
exitCode =
PRETTY_FUNCTION = "int main(int, char**)"

Version

2.5 and main

OS

Linux, Ubuntu 20.04.5

@ronso0 ronso0 added the bug label Nov 14, 2024
@ronso0 ronso0 changed the title main crashes on shutdown 2.5 and main crashe on shutdown Nov 14, 2024
@ronso0 ronso0 changed the title 2.5 and main crashe on shutdown 2.5 and main crash on shutdown Nov 14, 2024
@ronso0 ronso0 added the blocker label Nov 14, 2024
@ronso0 ronso0 added this to the 2.5.0 milestone Nov 14, 2024
@ronso0 ronso0 added the crash label Nov 14, 2024
@Swiftb0y
Copy link
Member

Do you have time and energy to look into this @JoergAtGithub?

@daschuer
Copy link
Member

I can confirm the crash with main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants