uno: [net7.0-ios] crash with SamplesApp
Current behavior
Building and running SamplesApp with net7.0-ios often crash at startup. This happens on both simulators and devices.
In case where it does not crash the screen remains black.
This works when using net6.0-ios.
Expected behavior
No crash
How to reproduce it (as minimally and precisely as possible)
- Clone uno
- Inside
src/crosstargeting_override.propsset<UnoTargetFrameworkOverride>net7.0-ios</UnoTargetFrameworkOverride> - On a Mac open
src/Uno.UI-netcoremobile-only.slnfwith VSfM - Build for iOS (simulator or device)
- Run the application
Workaround
No response
Works on UWP/WinUI
None
Environment
No response
NuGet package version(s)
main / 4.7.0-dev
Affected platforms
iOS
IDE
Visual Studio for Mac
IDE version
Version 17.4.1 (build 28)
Relevant plugins
none
Anything else we need to know?
Running on device gave an additional hint with the log
2022-12-09 19:45:29.980 SamplesApp[4235:553886] error: no object of size 103788564432404912d
This would be quite a large object and it’s likely an invalid/corrupted value.
34 SamplesApp 0x1047a8b7c SamplesApp_netcoremobile_BindableMetadataProvider_GetBindableTypeByType_System_Type + 28953468 (BindableMetadata.g.cs:85519)
This is also the location where the app can freeze (black screen) when a crash does not occur.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (19 by maintainers)
Commits related to this issue
- fix(gen): generate less local variables Workaround https://github.com/unoplatform/uno/issues/10724 — committed to spouliot/uno by spouliot 4 years ago
It’s the same method identified earlier.
However it’s not the huge method. This one simply call the huge switch version with
Now
GetBindableTypeByFullNamedoes have more than 2000 locals (mostlybool) but it did not seem to be reached (and I doubt it was inlined).OTOH it would not be hard to replace the latter with a different implementation but it might just hide the real issue. The fact that MacCatalyst worked fine hints that small differences have impact.
f42b59cf2e367a07ad5e3640670bae1875f6b5ff works (re-confirmed above)
6d26427b3dd071e20d487ee449141f24c326b350 crash (re-confirmed above)
6d26427b3dd071e20d487ee449141f24c326b350 w/o UITests.Shared.projitems changes -> works 6d26427b3dd071e20d487ee449141f24c326b350 w/o TextBox.cs changes -> crash
so we can resume (for how long?) the binary search if we remove the changes to
UITests.Shared.projitemsaf120dee6d6f3c75668345b48854db1cacefa3e4 works acd28c3ad679040b75efaf9bfcfbb65219db1f64 works 12e4c66ff5fb5f587fdd02f41ad52d7102f93e6d works f395100f8b8b3cdbea1641ea22d2036e4f103f62 build errors
Local changes to get SamplesApp working. Now we need to figure out what those changes triggers…
a860abff881e4a88888eb1bee1be5d03ca59e9b7 crash a860abff881e4a88888eb1bee1be5d03ca59e9b7 works (with
:Controlremoval)b9c5fc266fb50832a14f4e9738a61b889dcea741 works (with
:Controlremoval) b0ba0a83e212bdff74e255ad4f11d445f6524aae works (with:Controlremoval) aba453015cbe3a48b5a8fe86d9ce0093fbd5ce25 works (with:Controlremoval) f42b59cf2e367a07ad5e3640670bae1875f6b5ff works (with:Controlremoval) 4934a0c52adac36184837a389b74aa85261d0367 build failure (with:Controlremoval) <<< 6d26427b3dd071e20d487ee449141f24c326b350 crash (with:Controlremoval)44b839733820e0fdf3c05d4383d428cf3685f64e crash (with
:Controlremoval) afc81e08a7cc1b6f887f000e367f8603454c4076 crash (with:Controlremoval)So
4934a0c52adac36184837a389b74aa85261d0367with the fix from the next commit is the next crasher. Again nothing obvious from the change itself 😦This is new… I’ve never seen deployment issues fixed by just trying again. My guess is that it’s a problem with this device (or maybe cable?) in particular.
Again, doing a
git clean -xfd, avoiding VSfM and deleting the app from the phone each time3c308bb18e18cc5a1155104f1518f213d266a840 works (that’s current 4.6.19 stable release) 2d870f78f45ce0eb9b7aacac5d8d772f1db95b0b works dd9296501cef4821ad5218b8610c3872fe02b16f works e127d30a26e65ee91d06c424042a66ab778dd9c7 works eabf4ade7f691369099526060e31313dd5a6a84d works d923d64ce158777a351528e6c81ed4e07546c271 works 6aaba0e16c34fe5aa8b0aacf4e04ac6b8d2bdab1 works 81dc019d647bd12aab6de11a8e5297b0017e1a40 works 2427d280d01d85910f7b546dfd84bffacd44f5d8 works eabf4ade7f691369099526060e31313dd5a6a84d works (repetitively) a9d1394aaf3b51336ff26bce6e7f760622597130 crash (next revision, re-confirmed twice) f06c5fe51fc36b7fb0eafddb79e4cb2e3f2f5162 crash 25217eae2789d468b57f61561e387558bf10c6db crash
If I checkout HEAD and revert a9d1394aaf3b51336ff26bce6e7f760622597130 then the app works again, c.c. @jeromelaban
update: splitting a9d1394aaf3b51336ff26bce6e7f760622597130 crashed, going back to HEAD (without a9d1394aaf3b51336ff26bce6e7f760622597130) crashed ?!? which it did not earlier. It’s possible that something more is at play here (maybe just to make me lie again) and that some builds are randomly affected (so not all works above might always be working).
update 2: I suspect another, more recent(s), similar commit(s) hit the same issue and since it’s not 100% reproducible that can lead to happy (but wrong) conclusions.
Note
Since I do everything manually I noticed several failures while trying to install the
.app, trying again (without rebuilding) eventually installed the app properly. c.c. @rolfbjarneIt might be something with my phone, which is randomly saving the crash reports. I guess I should reboot it 😃
that might have been a stale build.
The app starts normally when
net7.0-maccatalystwith eithermaccatalyst-x64andmaccatalyst-arm64, which should be very similar (e.g. mono runtime and AOT) to the code executed for iOS on devices.