Skip to content

Connect dialog led to crash on macOS (not reproducible) #3775

Description

@ann0see

Describe the bug

Jamulus crashed in the combo box once and produced a crash report. This is AI generated:

Clicking any combo box dropdown arrow in the Connect dialog (Directory or Server Address) crashes the app with SIGSEGV at 0x8. It's a null QPlatformWindow* dereference inside Qt's QComboBox::showPopup()QWindow::geometry().

To Reproduce

  1. Build Jamulus with Qt 6.11.1 on macOS (Apple Silicon)
  2. Launch the app, open the Connect dialog
  3. Click the dropdown arrow on either combo box

Expected behavior

The dropdown opens without crashing.

Crash report

Exception: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000008

Thread 0 Crashed:
0  QtWidgets  QWindow::geometry() const
1  QtWidgets  QPlatformWindow::windowGeometry() const
2  QtGui      QWindowPrivate::setVisible(bool)
3  QtWidgets  QWidgetPrivate::show_sys()
4  QtWidgets  QWidgetPrivate::show_helper()
5  QtWidgets  QWidgetPrivate::setVisible(bool)
6  QtWidgets  QWidget::setVisible(bool)
7  QtWidgets  QComboBox::showPopup()
8  QtWidgets  QComboBox::event(QEvent*)

Operating system

macOS 26.5.2, Apple Silicon (arm64), Xcode 26.6

Additional context

This is - according to the llm - a known class of bugs in Qt's Cocoa platform integration on macOS (https://forum.qt.io/topic/151310/pyqt-program-crashes-on-mac-not-on-windows-when-clicking-on-qcombobox) — the popup container's QWindow doesn't have a valid native window handle when showPopup() tries to get its geometry. Similar reports exist on the Qt Forum for Qt 6 on macOS.

A workaround would be to subclass QComboBox and force native window creation before showing the popup:

class CComboBoxPopupGuard : public QComboBox
{
    Q_OBJECT
public:
    using QComboBox::QComboBox;
protected:
    void showPopup() override
    {
        winId();
        if ( window() )
            window()->winId();
        QComboBox::showPopup();
    }
};

Then promote cbxDirectory and cbxServerAddr in the .ui file to this class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions