[crash] segfault in QOpenGLFunctions_2_1::initializeOpenGLFunctions on skin change on macOS

Bug #1877487 reported by Evan
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Critical
Be

Bug Description

Mixxx crashing on macOS with a fresh build of master (7360) and fresh mixxxdb when attempting to change to any skin. Appears to be OpenGL waveform related, as if waveforms are set to non-GL RGB, and change skins successfully.

Revision history for this message
Evan (ehendrikd) wrote :
Revision history for this message
Be (be.ing) wrote :

Looking at the backtraces, this seems to be different from Bug #1873367 on Linux.

Changed in mixxx:
status: New → Confirmed
importance: Undecided → Critical
milestone: none → 2.3.0
Revision history for this message
Be (be.ing) wrote :

What GPU do you use?

Revision history for this message
Evan (ehendrikd) wrote :

Running a MacBook Pro (2010) with an Nvidia GeForce GT 330M 512MB and macOS 10.13.4. If other macOS users have not encountered this with later machines, could just ignore the issue due to it's age.

Revision history for this message
Be (be.ing) wrote :

Another macOS user has encountered this bug, so we should fix it:
https://www.reddit.com/r/DJs/comments/h8hrtp/djs_that_have_been_using_mixxx_for_a_long_time/fusdwxj/

Daniel, do you have any hints what might be going wrong?

Revision history for this message
Daniel Schürmann (daschuer) wrote :

No idea yet. Hofully we fix this along with the QOpenGlWidget updates.
I have work in progress, but currently at prio 2

Revision history for this message
Be (be.ing) wrote :

This bug affects 2.3, so we can't rely on QOpenGLWidget to fix it.

Revision history for this message
Be (be.ing) wrote :
Revision history for this message
Owen Williams (ywwg) wrote :

Our macOS developer is unable to help us with this issue. We really need help from the community to work on this! If you know C++/QT and work on macOS, please contact us and we can start debugging this properly.

Revision history for this message
Jean-Michaël Celerier (jcelerier) wrote :

Hello,
I've tried changing skin on current master (mac mini 2018, 10.14, Qt 5.15 from homebrew) but I don't seem to hit the issue.
I however seem to hit the same backtracewhen quitting Mixxx so that may be related ?

It seems to be due to

GLSLWaveformWidget::~GLSLWaveformWidget() {
    makeCurrent();
}

^ I don't really know Mixxx's architecture, but that seems quite dangerous if the SharedGLContext::getWidget()'s context gets destroyed before the waveform widget - maybe some place in the code should introduce an explicit ordering of child widget deletion in a destructor that guarantees that the waveforms are deleted first, before the main window is closed, instead of relying on Qt's parent-child automatic destruction for this case.

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

The invocation of makeCurrent() also triggers a crash on Linux when closing Mixxx with Alt+F4:

https://mixxx.zulipchat.com/#narrow/stream/109171-development/topic/shutdown.20crash

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :
Revision history for this message
Foss-4 (foss-4) wrote :
Revision history for this message
Foss-4 (foss-4) wrote :

Duplicate state does not seem to exist in launchpad thus setting to invalid due to lack of correct status.

Changed in mixxx:
status: Confirmed → Invalid
Revision history for this message
Be (be.ing) wrote :

Thanks for looking into this Jean-Michaël!

Revision history for this message
Be (be.ing) wrote :

Looking again at the backtrace at the top of this bug, this is actually different from Bug #1856888.

Changed in mixxx:
status: Invalid → Confirmed
Revision history for this message
Be (be.ing) wrote :

The call to QOpenGLFunctions_2_1::initializeOpenGLFunctions was added in https://github.com/mixxxdj/mixxx/pull/2094

Be (be.ing)
summary: - Change skin crash on macOS
+ segfault in QOpenGLFunctions_2_1::initializeOpenGLFunctions on skin
+ change on macOS
Foss-4 (foss-4)
summary: - segfault in QOpenGLFunctions_2_1::initializeOpenGLFunctions on skin
- change on macOS
+ [crash] segfault in QOpenGLFunctions_2_1::initializeOpenGLFunctions on
+ skin change on macOS
Revision history for this message
Owen Williams (ywwg) wrote :

From a QT discord: "segfault in QOpenGLFunctions::.... generally means that there's no valid GL context I believe"

Revision history for this message
Evan (ehendrikd) wrote :

Have been looking into this, crash is caused by QGLContext::currentContext() being NULL before initializeOpenGLFunctions is called when a skin is reloaded (same crash happens when using the Debug menu to reload the skin as changing skins).

Have narrowed it down to https://github.com/mixxxdj/mixxx/blob/d867049728953e49bce0b1d4f8040600e0569134/src/mixxx.cpp#L1431 where before the QGLContext::currentContext() is a valid pointer, then after it is NULL. To test with this line commented out skin reloading progresses further, however understandably causes further issues later and crashes for a different reason.

Revision history for this message
Evan (ehendrikd) wrote :
Revision history for this message
Be (be.ing) wrote :
Changed in mixxx:
status: Confirmed → Fix Committed
assignee: nobody → ronso0 (ronso0)
Revision history for this message
Be (be.ing) wrote :
Changed in mixxx:
status: Fix Committed → In Progress
assignee: ronso0 (ronso0) → Be (be.ing)
Revision history for this message
Be (be.ing) wrote :

The bug is reproducible by reloading OpenGL waveforms by switching skins or switching from one OpenGL waveform type to another OpenGL waveform type. However, the bug is only reproducible when spinnies are disabled.

Be (be.ing)
Changed in mixxx:
status: In Progress → Fix Committed
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/9967

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.