Skip to content

macOS: crash (panic) when choosing File > Open, native file dialog re-enters the winit event handler #1192

Closed

Description

@truerender

Title: macOS: crash (panic) when choosing File > Open, native file dialog re-enters the winit event handler

Version: SolidCraft 0.10.1 (commit c29b0d2, built 2026-10-14), macOS 27.0.1 (26A434), arm64, universal DMG from the release page.

What happens: In the desktop app, using the File menu to open a file (the native open dialog) makes the app panic and exit. Two crash reports are written at the same moment:

  1. panic in a function that cannot unwind (core/src/panicking.rs:225)
  2. tried to handle event while another event is currently being handled (winit EventHandler::handle_event)

Backtrace (from solidcraft-cli crashes show):

winit::platform_impl::macos::event_handler::EventHandler::handle_event
winit::platform_impl::macos::observer::RunLoop::queue_closure ... maybe_queue_event
rfd::backend::macos::file_dialog::panel_ffi::Panel::run_modal
rfd::backend::macos::utils::run_on_main::<Option<PathBuf>, FilePickerDialogImpl::pick_file>
rfd::file_dialog::FileDialog::pick_file
solidcraft::services::{closure#0}
solidcraft_ui_egui::toolbar::file_menu::{closure#1}::{closure#0}

Expected: The open dialog appears and the chosen .solidcraft / .step file opens.

Workaround: Start the app with the file on the command line (SolidCraft file.solidcraft) or drag the file onto the window.

Note: The modal NSOpenPanel run loop appears to deliver an event to winit while it is still inside the handler (run_modal called from the egui frame callback). Possibly the dialog should be shown asynchronously (rfd AsyncFileDialog) or deferred out of the event handler.

Crash IDs: 20261014-192305-e0aaf13abde19147, 20261014-192305-93b1d2f7ab9faf5a (replayable).

Activity

  1. Karl-VonRichter commented on Oct 14, 2026

    @Karl-VonRichter
    Contributor

    This backtrace matches the macOS native-dialog re-entry crash tracked in #1088 and addressed by merged PR #1127 (commit 37547f8e).

    In 0.10.1, Open and Save used synchronous rfd::FileDialog calls inside the UI event handler. The fix switches both to parented rfd::AsyncFileDialog sheets and handles their answers in a later frame, avoiding the nested modal event loop. The PR includes delayed-answer regression tests and documented native macOS Open/Save validation while resizing.

    I verified that the fix is included in both published releases 0.11.0 and 0.11.1, as well as current main. Please retry with 0.11.1; the reported 0.10.1 build predates the fix.

  2. jyviko commented on Oct 17, 2026

    @jyviko
    Collaborator

    Thanks for the backtrace, @truerender! File › Open and Save now use asynchronous sheets on macOS, so the native dialog no longer re-enters the event loop (#1127). It's in the released 0.14.0 and later, so please update; if you still see it there, just comment and we'll reopen.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions