shorebirdtech / shorebird

Code Push for Flutter and other tools for Flutter businesses.
https://shorebird.dev
Other
2.18k stars 130 forks source link

fix: IOS Patch caused EXC_BAD_ACCESS+ UI Lock #2319

Closed Dario-Maselli closed 1 month ago

Dario-Maselli commented 1 month ago

App ID: 325fd807-06f6-45c8-b431-2a5d09d381c6

Description After doing a patch with minor code differences, the patch successfully downloaded and installed, the app was "operating" but all of the UI components were locked (gesture detectors, buttons, animations, etc) causing it to be unusable and considered broken as tapping anything caused the EXEC_BAD_ACCESS error to be reported on Sentry with an ANR.

This is the sentry link: https://sinov8net.sentry.io/share/issue/3f2d0e0031514744bc9427fd453ca901/

Luckily, this was on our staging environment which did not affect our clients so we just did another release for our QA team to continue with their work.

Steps To Reproduce

  1. Create a release on Shorebird 1.1.13
  2. After a few hours, we created a patch on Shorebird 1.1.13
  3. After a 2 days, we created a patch on Shorebird 1.1.15
  4. Once 2nd patch installed, we were locked out of the core of our app. (Again, the app was running but our UI elements were completely broken.)

Expected Behavior We expected our app to run the same as it has with other patches. We have not encountered severe issues like this before.

Screenshots Sadly no screenshots as we were on a time crunch and needed to get the release tested. It's basically our normal UI but we cannot tap anything.

Additional Context

eseidel commented 1 month ago

Crashes are definitely not expected.

https://docs.shorebird.dev/guides/crash-reporting/ should make it possible for you to see full symbols in that trace.

eseidel commented 1 month ago

Would love to work with you to get more information here. Unfortunately I don't know how to get the library load addresses out of that stack trace. When I click on "raw stack trace" it doesn't show anything.

The "Binary Images" section is the one we'd need to be able to symbolicate the crashes. Presumably Sentry has that (which is part of why I suggested above uploading the .dsym files to sentry as then they might just do it for you):

https://developer.apple.com/documentation/xcode/adding-identifiable-symbol-names-to-a-crash-report

felangel commented 1 month ago

Also worth noting, we shipped a new Flutter and Dart as part of 1.1.14 so might be worth re-releasing and patching using the latest Shorebird CLI version to see if the issue persists.

eseidel commented 1 month ago

I'm guessing this is 3.5.0+178? Which used Flutter https://github.com/shorebirdtech/flutter/commit/7cab65034f8575e81d58774a91b99405ce2a2f7a.

Dario-Maselli commented 1 month ago

This is the details from the CICD.

Shorebird 1.1.13 • git@github.com:shorebirdtech/shorebird.git
Flutter 3.22.2 • revision 7cab65034f8575e81d58774a91b99405ce2a2f7a
Engine • revision 28ed3b6c5fc12806e757067fdccb3614b4bd2ac1

I have uploaded the DSYM's to sentry but it is still showing that the debug symbols are missing. (Even after reprocessing and uploading the XArchive)

Dario-Maselli commented 1 month ago

This is the patch runs:

Shorebird 1.1.15 • git@github.com:shorebirdtech/shorebird.git
Flutter 3.22.2 • revision 72996fba5d330551d694c6e09189e215c09b1c5b
Engine • revision ef99b23fc158eca48dd9ecb76a819329985ad628
Dario-Maselli commented 1 month ago

Do you think it was the flutter/dart changes that caused this?

Uneducated Opinion: Would it not be best to use the flutter version from the release within the patch? That way it does not have a minor/major difference from release to patch.

eseidel commented 1 month ago

Do you think it was the flutter/dart changes that caused this?

shorebird doctor shows the default version of Flutter used for new releases. shorebird patch always downloads the exact version of Flutter that that shorebird release as made with. So even if you've changed shorebird versions, or installed flutter versions, shorebird patch will always use exactly the correct flutter when making a patch.

Uneducated Opinion: Would it not be best to use the flutter version from the release within the patch? That way it does not have a minor/major difference from release to patch.

Correct, it does exactly that for you under the covers. :)

eseidel commented 1 month ago

This is the details from the CICD.

Shorebird 1.1.13 • git@github.com:shorebirdtech/shorebird.git
Flutter 3.22.2 • revision 7cab65034f8575e81d58774a91b99405ce2a2f7a
Engine • revision 28ed3b6c5fc12806e757067fdccb3614b4bd2ac1

I have uploaded the DSYM's to sentry but it is still showing that the debug symbols are missing. (Even after reprocessing and uploading the XArchive)

When you say you uploaded the dSYMs, were those ones from console.shorebird.dev corresponding to the release in question?

Dario-Maselli commented 1 month ago

When you say you uploaded the dSYMs, were those ones from console.shorebird.dev corresponding to the release in question?

Yes, I have uploaded the dSYMs from the console, as well as the dSYMs extracted from the IOS XArchive (all 49 of them) as well as our CICD pipeline's dSYMs 🙈 Any dSYM I could find for this release and shorebird I uploaded, but sadly, no change.

eseidel commented 1 month ago

My guess is also that this crash will not reappear in releases made with Shorebird 1.1.16 and Flutter 3.22.2. Regardless, we're happy to assist you in tracking it down. We just need a bit more information (like an .ips file).

bryanoltman commented 1 month ago

Closing due to inactivity. Please reopen if you're still experiencing this issue with the latest version of Shorebird.

Dario-Maselli commented 3 weeks ago

@bryanoltman - We have ran into the error again, discord thread (message): https://discord.com/channels/1030243211995791380/1084985149072080977/1269942779409203312

Sentry Link 1 - https://sinov8net.sentry.io/share/issue/3e6ece362287404ca9e6beee746e36db/ Sentry Link 2 - https://sinov8net.sentry.io/share/issue/e687cc8601b14dd3b5b5687f82759531/

Dario-Maselli commented 3 weeks ago

Shorebird 1.1.26 • git@github.com:shorebirdtech/shorebird.git Flutter 3.22.3 • revision d299d8d026d9b6cc158bb0a3dd9e96073d38c90b Engine • revision 21ec31e6ed178745244f9f065dcc1b452f8bbcc3

eseidel commented 3 weeks ago

I suspect this will be easy to solve if we can get an ips file from the device (unfortunately the sentry crash reports don't seem to include all the information they should). Without an ips file I'm not sure there is much we can do.

https://developer.apple.com/documentation/xcode/acquiring-crash-reports-and-diagnostic-logs discusses how to get an ips file from a device.

Sometimes I've had to make sure the device allows crash reporting: https://support.apple.com/en-us/108971

If they don't show up using Apple's instructions, it's also possible to get an ips file from the device: https://9meters.com/technology/phones/how-to-decode-iphone-analytics-data lists how to get the .ips files from the device.