bevyengine / bevyengine/bevy

Previously working iOS example crashes on touch

Open
#3,185 5 comments 0 reactions 0 assignees View on GitHub
I-Crash I-Regression O-iOS S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version

`bevy/main` with https://github.com/bevyengine/bevy/pull/3109 merged in to enable an iOS build: https://github.com/HackerFoo/bevy/tree/ios-crash

## Operating system & version

MacOS 12.0.1

## What you did

I opened `examples/ios/bevy_ios_example.xcodeproj` in Xcode 13.1, and built and ran the project for an iPad Pro 5th generation device.

## What you expected to happen

The demo to run without crashing.

## What actually happened

The demo ran, but crashed as soon as I touched the screen with:

```
2021-11-25T03:05:13.709163Z ERROR bevy_gilrs: Failed to start Gilrs. Gilrs does not support current platform.
2021-11-25T03:05:13.756350Z  WARN winit::platform_impl::platform::window: `WindowAttributes::min_inner_size` is ignored on iOS
2021-11-24 19:05:13.769411-0800 bevy_ios_example[61497:6420685] Metal GPU Frame Capture Enabled
2021-11-24 19:05:13.769611-0800 bevy_ios_example[61497:6420685] Metal API Validation Enabled
2021-11-24 19:05:13.868258-0800 bevy_ios_example[61497:6420685] fopen failed for data file: errno = 2 (No such file or directory)
2021-11-24 19:05:13.868352-0800 bevy_ios_example[61497:6420685] Errors found! Invalidating cache...
2021-11-25T03:05:13.916056Z  INFO winit::platform_impl::platform::app_state: processing `RedrawRequested` during the main event loop
2021-11-25T03:05:14.033052Z  INFO naga::front::spv: Generated by 851978 version 10000
2021-11-25T03:05:14.035360Z  INFO naga::front::spv: Patching...
2021-11-25T03:05:14.035886Z  INFO naga::front::spv: Generated by 851978 version 10000
2021-11-25T03:05:14.039428Z  INFO naga::front::spv: Patching...
2021-11-25T03:05:14.041750Z  WARN naga::back::msl::writer: Ignoring CullDistance BuiltIn
2021-11-25T03:05:14.041836Z  WARN naga::back::msl::writer: Ignoring CullDistance BuiltIn
2021-11-24 19:05:14.042165-0800 bevy_ios_example[61497:6420685] fopen failed for data file: errno = 2 (No such file or directory)
2021-11-24 19:05:14.042204-0800 bevy_ios_example[61497:6420685] Errors found! Invalidating cache...
2021-11-25T03:05:14.173949Z  WARN winit::platform_impl::platform::app_state: processing non `RedrawRequested` event after the main event loop: WindowEvent {
window_id: WindowId(
WindowId {
window: 0x000000014b705690,
},
),
event: Resized(
PhysicalSize {
width: 2048,
height: 2732,
},
),
}
2021-11-24 19:05:16.163232-0800 bevy_ios_example[61497:6420685] *** Assertion failure in -[UIGestureGraphEdge initWithLabel:sourceNode:targetNode:directed:], UIGestureGraphEdge.m:24
2021-11-24 19:05:16.165755-0800 bevy_ios_example[61497:6420685] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: sourceNode'
*** First throw call stack:
(0x180b8604c 0x1991faf54 0x18243f6cc 0x1835db73c 0x18322e3bc 0x183433f98 0x1830f6618 0x18312a8c8 0x183137a68 0x1832e7318 0x18310ac30 0x1830ffa1c 0x183104ec8 0x180ba8020 0x180bb8ce0 0x180af2fe8 0x180af87f4 0x180b0c3b8 0x19c49c38c 0x1834ac6a8 0x18322b7f4 0x1008d906c 0x1008bb918 0x1008b4fe8 0x1008daf14 0x1008daa64 0x1008c85b4 0x1025e071c 0x1025f01b8 0x100623454 0x100623320 0x10061ffb8 0x107899a24)
libc++abi: terminating with uncaught exception of type NSException
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/usr/lib/libMTLCapture.dylib
terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: sourceNode'
(lldb)
```

## Additional information

I saw the same error in my app the worked on a modified version tracking bevy/main until I merged the new renderer in, without using any of the new features (not using default features, so e.g. bevy_render2 is not enabled.)

This issue is likely related: https://github.com/rust-windowing/winit/issues/1120

Contributor guide

Open the contributing guide

Research direction

Open examples/ios/bevy_ios_example.xcodeproj and reproduce the touch-triggered crash on the stated iPad and Xcode setup. Read the linked winit issue 1120 and compare behavior before and after the new renderer was merged. Done means the iOS demo remains running after screen interaction without the reported UIGestureGraphEdge exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, rust
Domain
game-dev, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.