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

fix: duplicate index crash when creating patch for iOS #2171

Closed
hayatshin opened this issue May 30, 2024 · 5 comments
Closed

fix: duplicate index crash when creating patch for iOS #2171

hayatshin opened this issue May 30, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@hayatshin
Copy link

I upgraded shorebird to new version: 1.1.8

And I patch android successfully.

But I get duplicate index crash error only for ios.

✓ Fetching apps (0.5s)
✓ Fetching releases (0.3s)
Which release would you like to patch? 3.6.18+321
✓ Fetching xcarchive artifact (0.4s)
✓ Downloading xcarchive (11.6s)
✓ Building patch with Flutter 3.19.6 (aee5222c0d) (486.2s)
✓ Verifying patch can be applied to release (1.6s)
✓ Extracting release artifact (2.2s)
✗ Failed to link AOT files: Exception: Failed to link: /Users/hayat/.shorebird/bin/cache/flutter/aee5222c0d52012f089564a8395826d56e7c2fe8/bin/cache/artifacts/engine/ios-release/gen_snapshot_arm64 --snapshot_kind=app-aot-elf --base_link_data=/var/folders/zp/4ycr79n50gj9n2_0dhq5q0480000gn/T/ZlF6Hk/Products/Applications/Runner.app/Frameworks/App.framework/App.link --patch_link_data=/Users/hayat/FlutterProjects/ProjectsFiles/onldocc_flutter/build/out.link --elf=/Users/hayat/FlutterProjects/ProjectsFiles/onldocc_flutter/build/out.optimized.aot /Users/hayat/FlutterProjects/ProjectsFiles/onldocc_flutter/.dart_tool/flutter_build/0c7470425db17e95e967616b8d73d3c2/app.dill
../../third_party/dart/runtime/vm/shorebird/object_pool_mapper.cc: 222: error: Duplicate index: 31223


===== CRASH =====
si_signo=Segmentation fault: 11(11), si_code=SEGV_MAPERR(1), si_addr=0x12f08df
Aborting reentrant request for stack trace.

Unhandled exception:
Exception: gen_snapshot failed
#0      SnapshotGenerator.generateAotElfSnapshot (package:aot_tools/src/snapshot_generator.dart:54:7)
#1      LinkCommand._generateOptimizedPatchSnapshot (package:aot_tools/src/commands/link_command.dart:281:24)
#2      LinkCommand.run (package:aot_tools/src/commands/link_command.dart:141:40)
#3      CommandRunner.runCommand (package:args/command_runner.dart:212:27)
#4      CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:122:25)
#5      new Future.sync (dart:async/future.dart:305:31)
#6      CommandRunner.run (package:args/command_runner.dart:122:14)
#7      main.<anonymous closure> (file:///home/gha/.engine_checkout/engine/src/third_party/dart/pkg/aot_tools/bin/aot_tools.dart:9:57)
#8      _rootRun (dart:async/zone.dart:1399:13)
#9      _CustomZone.run (dart:async/zone.dart:1301:19)
#10     _runZoned (dart:async/zone.dart:1804:10)
#11     runZoned (dart:async/zone.dart:1747:10)
#12     LoggerOverrides.runZoned (package:aot_tools/src/logger.dart:28:18)
#13     runWithLogger (package:aot_tools/src/logger.dart:18:26)
#14     main (file:///home/gha/.engine_checkout/engine/src/third_party/dart/pkg/aot_tools/bin/aot_tools.dart:9:26)
#15     _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:33)
#16     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

How to resolve this issue?

@hayatshin hayatshin added the bug Something isn't working label May 30, 2024
@eseidel
Copy link
Contributor

eseidel commented May 30, 2024

Flutter 3.19.6 is pretty recent. But it's possible we still had a duplicate index bug in that release. 3.22.1 is our most recent release. Regardless, this is unexpected and would be our bug.

@felangel do you recall if we had a duplicate index error in 3.19.6?

@eseidel eseidel added this to 1.1 May 30, 2024
@eseidel eseidel moved this to Pending Customer Reply in 1.1 May 30, 2024
@hayatshin
Copy link
Author

I check that this same error happened before from here.
https://github.com/shorebirdtech/shorebird/issues/2029

I need to patch ios asap, please help me :) thanks.

@eseidel
Copy link
Contributor

eseidel commented Jun 3, 2024

@felangel also just re-wrote this code this week, which will go out later this week (probably 3.22.2, assuming Flutter releases .2 on Weds as I expect they might).

@eseidel eseidel moved this from Pending Customer Reply to In Progress in 1.1 Jun 3, 2024
@zilanfeng
Copy link

✓ Fetching apps (0.7s)
✓ Fetching releases (0.6s)
✓ Fetching xcarchive artifact (0.7s)
✓ Downloading xcarchive (5.9s)
✓ Building patch with Flutter 3.19.5 (47571af6a3) (225.7s)
✓ Verifying patch can be applied to release (1.9s)
[WARN] Your app contains asset changes, which will not be included in the patch.
Changed files:
Products/Applications/Runner.app/Frameworks/App.framework/flutter_assets/fonts/MaterialIcons-Regular.otf
Continue anyways? (y/N) Yes
✓ Extracting release artifact (0.8s)
✗ Failed to link AOT files: Exception: Failed to link: /Users/kangyong/.shorebird/bin/cache/flutter/47571af6a3acdebedf88255099ff1de1c3324049/bin/cache/artifacts/engine/ios-release/gen_snapshot_arm64 --snapshot_kind=app-aot-elf --base_link_data=/var/folders/tr/qgtbvq112dx7n_3wz64rzf980000gq/T/Q6o4OX/Products/Applications/Runner.app/Frameworks/App.framework/App.link --patch_link_data=/Users/kangyong/wsyy/code/wsyy_app/build/out.link --elf=/Users/kangyong/wsyy/code/wsyy_app/build/out.optimized.aot /Users/kangyong/wsyy/code/wsyy_app/.dart_tool/flutter_build/201e220ac0c1eb27553516d087175542/app.dill
../../third_party/dart/runtime/vm/shorebird/shorebird_linker.cc: 357: error: Duplicate index: 11459

===== CRASH =====
si_signo=Segmentation fault: 11(11), si_code=SEGV_MAPERR(1), si_addr=0x31bb74
Aborting reentrant request for stack trace.

Unhandled exception:
Exception: gen_snapshot failed
#0 SnapshotGenerator.generateAotElfSnapshot (package:aot_tools/src/snapshot_generator.dart:37:7)
#1 LinkCommand._generateOptimizedPatchSnapshot (package:aot_tools/src/commands/link_command.dart:262:24)
#2 LinkCommand.run (package:aot_tools/src/commands/link_command.dart:134:40)
#3 CommandRunner.runCommand (package:args/command_runner.dart:212:27)
#4 CommandRunner.run. (package:args/command_runner.dart:122:25)
#5 new Future.sync (dart:async/future.dart:305:31)
#6 CommandRunner.run (package:args/command_runner.dart:122:14)
#7 main. (file:///home/gha/.engine_checkout/engine/src/third_party/dart/pkg/aot_tools/bin/aot_tools.dart:9:57)
#8 _rootRun (dart:async/zone.dart:1399:13)
#9 _CustomZone.run (dart:async/zone.dart:1301:19)
#10 _runZoned (dart:async/zone.dart:1804:10)
#11 runZoned (dart:async/zone.dart:1747:10)
#12 LoggerOverrides.runZoned (package:aot_tools/src/logger.dart:28:18)
#13 runWithLogger (package:aot_tools/src/logger.dart:18:26)
#14 main (file:///home/gha/.engine_checkout/engine/src/third_party/dart/pkg/aot_tools/bin/aot_tools.dart:9:26)
#15 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:295:33)
#16 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
(8.9s)
Help me ~😭
my shorebird version: 1.1.8 and flutter version:3.19.5

@eseidel
Copy link
Contributor

eseidel commented Jun 4, 2024

This was fixed in Flutter 3.22.1 updated last night as part of Shorebird 1.1.9. Sorry for the trouble. We don't currently back-port fixes to Flutter older than the current stable unfortunately.

@eseidel eseidel closed this as completed Jun 4, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in 1.1 Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants