Skip to content

ios: fix the launch crash on iOS 15 from the iOS 26 toolbar spacer - #8055

Open
UTMapp-bot wants to merge 1 commit into
utmapp:mainfrom
UTMapp-bot:fix/ios15-toolbar-spacer
Open

UTMapp-bot wants to merge 1 commit into
utmapp:mainfrom
UTMapp-bot:fix/ios15-toolbar-spacer

Conversation

@UTMapp-bot

@UTMapp-bot UTMapp-bot commented Nov 4, 2026 •

Copy link
Copy Markdown

UTM 5.0.6 through 5.0.8 crash on launch on iOS 15. The crash comes from 8521d24, which put if #available(iOS 26, *) { ToolbarSpacer(...) } inside the VM list's toolbar builder. iOS 15 doesn't have the iOS 26-only type that gets erased inside the builder, and a conditional inside a ToolbarContentBuilder needs iOS 16.

The fix moves the availability check out of the toolbar builder and into the view, where conditionals work on every supported OS version. The fix follows the pattern already used in VMToolbarModifier and VMSettingsView. The toolbar items are now properties shared by both versions of the toolbar, so the items, their order and the iOS 26 spacer are unchanged.

Testing

Tested by an AI agent on simulators: iOS 15.5 and 16.4 iPad in a macOS 15 VM (Xcode 26.6), and iOS 27.1 iPhone Duo on a macOS 27 host.

Before (upstream/main, iOS 15.5 iPad simulator): UTM quits right after launch. Crash report:

EXC_BAD_ACCESS (SIGSEGV) KERN_INVALID_ADDRESS at 0x000000000000000c
libswiftCore  swift::_getWitnessTable(...)
UTM.debug     lazy protocol witness table accessor for type (<<opaque return type of static ViewBuilder.buildLimitedAvailability(_:)>>.0)? and conformance <A> A?
UTM.debug     closure #1 in VMListModifier.body(content:)
SwiftUI       ToolbarModifier<>.init(content:)
SwiftUI       View.toolbar<A>(content:)
UTM.debug     VMListModifier.body(content:)

After: UTM opens to its welcome view on iOS 15.5 and iOS 16.4. On 16.4 the full toolbar shows (create, donate, settings, Edit).

iOS 15.5 iPad, after iOS 16.4 iPad, after

Left: iOS 15.5 iPad. Right: iOS 16.4 iPad.

iOS 27.1 (iPhone Duo): the toolbar, including the spacer between create and donate, is identical before and after.

iOS 27.1 iPhone Duo, before iOS 27.1 iPhone Duo, after

Left: before. Right: after.

The macOS build compiles. The UTM Remote and visionOS variants were checked by reading the code; they could not be built here.

UTMapp-bot added a commit to UTMapp-bot/UTM that referenced this pull request Nov 4, 2026
UTM crashed on launch on iOS 15 (EXC_BAD_ACCESS in VMListModifier.body,
in View.toolbar, looking up a protocol witness table for
buildLimitedAvailability): the toolbar builder held
`if #available(iOS 26, *) { ToolbarSpacer(...) }`, whose iOS 26-only type,
erased inside the builder, does not exist on iOS 15. A conditional in a
ToolbarContentBuilder also needs iOS 16 (its buildIf), so Xcode 26 does
not build this for iOS 15 at all.

The availability check now picks between two toolbars at the view level,
where conditionals work on every supported version, and the toolbar items
are properties shared by both, so the order and the iOS 26 spacer are as
before.

Tested: UTM launches to its welcome view on iOS 15.5 and 16.4 simulators
(15.5 crashed on launch before the fix), and the iOS 27.1 iPhone toolbar
looks as before.

Assisted-by: Claude:claude-opus-5-5
@osy
osy force-pushed the fix/ios15-toolbar-spacer branch from f992d73 to 467726a Compare November 12, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants