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

[iOS] crash on open url click #107

Closed
extrawurst opened this issue Mar 3, 2024 · 4 comments · Fixed by #110
Closed

[iOS] crash on open url click #107

extrawurst opened this issue Mar 3, 2024 · 4 comments · Fixed by #110

Comments

@extrawurst
Copy link
Contributor

extrawurst commented Mar 3, 2024

i noticed that the app sometimes crashes when clicking the buttons to open a URL (twice). running in the simulator reveals that this is because the webbrowser::open should be called from the main thread.

here is the callstack:

Main Thread Checker: UI API called on a background thread: -[UIApplication openURL:options:completionHandler:]
PID: 15268, TID: 2913564, Thread name: Compute Task Pool (2), Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   mobile                          0x00000001028b3264 _ZN10webbrowser2os21open_browser_internal17hb2a8817b3035f33bE + 276
5   mobile                          0x00000001028b3c54 _ZN10webbrowser25open_browser_with_options17hbb11ab7890e7699eE + 316
6   mobile                          0x00000001028b3abc _ZN10webbrowser12open_browser17ha7a37639961bfb2aE + 120
7   mobile                          0x000000010281a104 _ZN10 mobile 4menu17click_play_button17h6d942eb70d80c3f1E + 1452
8   mobile                          0x0000000102864ddc _ZN120_$LT$bevy_ecs..system..function_system..FunctionSystem$LT$Marker$C$F$GT$$u20$as$u20$bevy_ecs..system..system..System$GT$10run_unsafe17hebfc3b3728c14d1aE.llvm.4102418084858017275 + 228
9   mobile                          0x00000001042f4bdc _ZN91_$LT$futures_lite..future..CatchUnwind$LT$F$GT$$u20$as$u20$core..future..future..Future$GT$4poll17hed7ae4b87d5ebccaE + 68
10  mobile                          0x00000001042f2b74 _ZN3std9panicking3try17h026468a883549e6eE + 108
11  mobile                          0x00000001042fca44 _ZN10async_task3raw28RawTask$LT$F$C$T$C$S$C$M$GT$3run17h8c6e9ffc152f0c0fE.llvm.8900356627072360647 + 172
12  mobile                          0x00000001043312d0 _ZN12futures_lite6future8block_on17h16a86458e063e77aE + 2648
13  mobile                          0x00000001043394e0 _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h7cc592fe5ea1097eE.llvm.16434831150002698626 + 320
14  mobile                          0x0000000104334f00 _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17hfca70cd91ab5e418E + 200
15  mobile                          0x00000001044a1e60 _ZN3std3sys4unix6thread6Thread3new12thread_start17hcdba6f4cb854f822E + 36
16  libsystem_pthread.dylib             0x00000001075074c0 _pthread_start + 104
17  libsystem_pthread.dylib             0x00000001075026f0 thread_start + 8
@NiklasEi
Copy link
Owner

NiklasEi commented Apr 3, 2024

I have not been able to reproduce this on any of the platforms I have access to (no iOS).
You wrote on Discord that you tried to add a non-send resource to the system and it did not fix the issue. Have you learned anything about it since?

@extrawurst
Copy link
Contributor Author

extrawurst commented Apr 10, 2024

NonSend fixes the warning in the log.
the crash happens due to a non initialized NSDictionary expected in the openURL call.

diagnosed and fixed over in webbrowser crate: amodm/webbrowser-rs#83

@NiklasEi
Copy link
Owner

Awesome, thank you for following up on the issue. I will close the issue as soon as the patch is released from webbrowser.

@extrawurst
Copy link
Contributor Author

its merged and released

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 a pull request may close this issue.

2 participants