Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Previously working iOS example crashes on touch #3185

Open
HackerFoo opened this issue Nov 25, 2021 · 5 comments
Open

Previously working iOS example crashes on touch #3185

HackerFoo opened this issue Nov 25, 2021 · 5 comments
Labels
O-iOS Specific to the iOS mobile operating system P-Crash A sudden unexpected crash P-Regression Functionality that used to work but no longer does. Add a test for this! S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@HackerFoo
Copy link
Contributor

Bevy version

bevy/main with #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:

�[2m2021-11-25T03:05:13.709163Z�[0m �[31mERROR�[0m �[2mbevy_gilrs�[0m�[2m:�[0m Failed to start Gilrs. Gilrs does not support current platform.
�[2m2021-11-25T03:05:13.756350Z�[0m �[33m WARN�[0m �[2mwinit::platform_impl::platform::window�[0m�[2m:�[0m `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...
�[2m2021-11-25T03:05:13.916056Z�[0m �[32m INFO�[0m �[2mwinit::platform_impl::platform::app_state�[0m�[2m:�[0m processing `RedrawRequested` during the main event loop    
�[2m2021-11-25T03:05:14.033052Z�[0m �[32m INFO�[0m �[2mnaga::front::spv�[0m�[2m:�[0m Generated by 851978 version 10000    
�[2m2021-11-25T03:05:14.035360Z�[0m �[32m INFO�[0m �[2mnaga::front::spv�[0m�[2m:�[0m Patching...    
�[2m2021-11-25T03:05:14.035886Z�[0m �[32m INFO�[0m �[2mnaga::front::spv�[0m�[2m:�[0m Generated by 851978 version 10000    
�[2m2021-11-25T03:05:14.039428Z�[0m �[32m INFO�[0m �[2mnaga::front::spv�[0m�[2m:�[0m Patching...    
�[2m2021-11-25T03:05:14.041750Z�[0m �[33m WARN�[0m �[2mnaga::back::msl::writer�[0m�[2m:�[0m Ignoring CullDistance BuiltIn    
�[2m2021-11-25T03:05:14.041836Z�[0m �[33m WARN�[0m �[2mnaga::back::msl::writer�[0m�[2m:�[0m 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...
�[2m2021-11-25T03:05:14.173949Z�[0m �[33m WARN�[0m �[2mwinit::platform_impl::platform::app_state�[0m�[2m:�[0m 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: rust-windowing/winit#1120

@HackerFoo HackerFoo added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 25, 2021
@alice-i-cecile alice-i-cecile added P-Crash A sudden unexpected crash P-Regression Functionality that used to work but no longer does. Add a test for this! O-iOS Specific to the iOS mobile operating system and removed C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 25, 2021
@HackerFoo
Copy link
Contributor Author

The ios-crash branch has been updated so that the crash can be reproduced using Xcode's iOS simulator.

@mockersf
Copy link
Member

mockersf commented Nov 25, 2021

Probably a winit bug: rust-windowing/winit#2058

It could be useful to provide a pure winit reproducer to try and help fix it on their side

@mockersf mockersf added the S-Blocked This cannot move forward until something else changes label Nov 25, 2021
@mockersf
Copy link
Member

working for me on an iPhone 13 / iOS 15.1.1

@HackerFoo
Copy link
Contributor Author

I ran the simulator again and noticed it does not crash, but produces the same warning:

�[2m2021-11-25T15:28:54.674852Z�[0m �[33m WARN�[0m �[2mwinit::platform_impl::platform::app_state�[0m�[2m:�[0m processing non `RedrawRequested` event after the main event loop: WindowEvent {
    window_id: WindowId(
        WindowId {
            window: 0x0000000135f0d550,
        },
    ),
    event: Resized(
        PhysicalSize {
            width: 2048,
            height: 2732,
        },
    ),
}

So maybe that warning is unrelated.

@mockersf mockersf added S-Needs-Investigation This issue requires detective work to figure out what's going wrong and removed S-Blocked This cannot move forward until something else changes labels Nov 25, 2021
@HackerFoo
Copy link
Contributor Author

Reverting 7d932ac#diff-b1447f30819280931099e7498b2ced388a98de5cda1b631b493107bb96193cc0 (changes to crates/bevy_winit/src/lib.rs from #3039) fixes the crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-iOS Specific to the iOS mobile operating system P-Crash A sudden unexpected crash P-Regression Functionality that used to work but no longer does. Add a test for this! S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

No branches or pull requests

3 participants