Skip to content

macOS: qtmesh CLI segfaults (exit 139) under QT_QPA_PLATFORM=offscreen — every subcommand #1043

Description

@fernandotonon

Repro (macOS arm64, local build):

QT_QPA_PLATFORM=offscreen ./build_local/bin/qtmesh info rumba120/test.fbx ; echo $?   # 139, empty stderr
./build_local/bin/qtmesh info rumba120/test.fbx ; echo $?                            # 0

Same for anim --list, anim --generate, material --inpaint, and for QtMeshEditor --cli info …. Not a regression from any recent PR — it reproduces on master too; it surfaced because a test-runner script exported QT_QPA_PLATFORM=offscreen (the recipe the pure-data UnitTests need on macOS) and that leaked into CLI invocations in the same shell, which then looked like a CLI regression.

Crash site (lldb): EXC_BAD_ACCESS (code=1, address=0x1) in libobjc.A.dylib\objc_opt_isKindOfClass + 12on the main thread — an Objective-CisKindOfClass:on a non-object pointer. That points at Cocoa-level window code being reached even though the platform plugin isoffscreen: the likely path is the CLI's Ogre init handing winId()of an offscreenQWindow(not anNSView`) to Ogre's macOS render-window code, which treats it as one.

Impact: low. CI (Linux) runs the CLI under Xvfb/xcb and is unaffected; the Docker image likewise. Anyone scripting the macOS CLI headlessly with the offscreen QPA hits a silent crash with no diagnostic, which is the part worth fixing — at minimum CLIPipeline should detect the offscreen platform on macOS and print a clear message (or force the cocoa QPA for the hidden window) instead of dying in libobjc.

Workaround: don't set QT_QPA_PLATFORM=offscreen for qtmesh on macOS (only export it for UnitTests).

🤖 Generated with Claude Code

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions