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

Network requests make the app crash on real iOS devices in beta/dev channel #73865

Closed
rbellens opened this issue Jan 13, 2021 · 13 comments
Closed
Labels
a: images Loading, displaying, rendering images c: crash Stack traces logged to the console e: OS-version specific Affects only some versions of the relevant operating system platform-ios iOS applications specifically waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@rbellens
Copy link

Steps to Reproduce

  1. Run flutter create bug.
  2. Update the main.dart file, by adding a Image.network widget (or do another network request somewhere). E.g.
          children: <Widget>[
            Image.network(
                'https://flutter.dev/assets/flutter-lockup-1caf6476beed76adec3c477586da54de6b552b2f42108ec5bc68dc63bae2df75.png'),
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
  1. Run the app on an iPhone real device.

Expected results:

Network requests should not make the app crash.

Actual results:

On my iPhone 5 with iOS 10.3.4, the app crashes without any crash report.

On the stable channel, it does work as expected.

I haven't been able to run on any other real device myself, but I distributed it to some test users (with more recent devices) and they report the same behavior. On the simulator with latest ios version it does not crash.

Logs
[        ] Running with unsound null safety
[        ] For more information see https://dart.dev/null-safety/unsound-null-safety
[+5373 ms] Service protocol connection closed.
[   +6 ms] Lost connection to device.
[   +3 ms] DevFS: Deleting filesystem on the device (file:///private/var/mobile/Containers/Data/Application/6E390E43-9B36-4451-91CB-242416BDBE93/tmp/test_app0S58ul/test_app/)
[ +261 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed
[   +6 ms] "flutter run" took 39.455ms.
[ +143 ms] ensureAnalyticsSent: 131ms
[        ] Running shutdown hooks
[        ] Shutdown hook priority 4
[   +1 ms] Shutdown hooks complete
[        ] exiting with code 0
Analyzing test_app...                                                   
No issues found! (ran in 12.4s)
[✓] Flutter (Channel master, 1.26.0-2.0.pre.313, on macOS 11.0.1 20B29 darwin-arm, locale nl-BE)
    • Flutter version 1.26.0-2.0.pre.313 at /Users/rikbellens/tools/flutter
    • Framework revision 1cb0a24a46 (11 hours ago), 2021-01-12 21:39:27 -0800
    • Engine revision 10cee6abcb
    • Dart version 2.12.0 (build 2.12.0-214.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/rikbellens/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.52.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.18.1

[✓] Connected device (2 available)
    • iPhone van Rik (mobile) • 628d9965eac484b6a65667d0072a796c3b1a520f • ios            • iOS 10.3.4
    • Chrome (web)            • chrome                                   • web-javascript • Google Chrome 87.0.4280.141

• No issues found!

@darshankawar
Copy link
Member

@rbellens
Although we don't have that older iPhone to verify this issue, but I tried the same on iOS 12.4.9 (the most minimum I've) on which the image worked properly using latest dev version.

Screenshot 2021-01-14 at 12 08 53 PM

flutter doctor -v
[✓] Flutter (Channel dev, 1.26.0-8.0.pre, on Mac OS X 10.15.4 19E2269
    darwin-x64, locale en-IN)
    • Flutter version 1.26.0-8.0.pre at /Users/dhs/documents/Fluttersdk/flutter
    • Framework revision b9d06fffb2 (6 days ago), 2021-01-07 18:36:48 -0800
    • Engine revision 42a8d4c681
    • Dart version 2.12.0 (build 2.12.0-179.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    • Android SDK at /Users/dhs/Library/Android/sdk
    • Platform android-30, build-tools 30.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    ! CocoaPods 1.9.3 out of date (1.10.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin
        code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see
      https://guides.cocoapods.org/using/getting-started.html#installation for
      instructions.

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.52.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.16.0

[✓] Connected device (3 available)
    • Deepti 's iPhone (mobile) • 0554e90e563e81fd41bfd2ff9a2c6960595b9825 • ios
      • iOS 12.4.9
    • macOS (desktop)           • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)              • chrome                                   •
      web-javascript • Google Chrome 87.0.4280.141
    ! Error: Deepti 's iPhone is busy: Copying cache files from device. Xcode
      will continue when Deepti 's iPhone is finished. (code -10)

! Doctor found issues in 1 category.


Without the specific iOS at disposal, it would be tough to identify the root-cause as why it crashes. Can you provide flutter run --verbose logs to see if it shows anything unusual ?
Also, the chances to fixing Flutter issue on older iOS versions isn't feasible, so the recommended way is to upgrade to latest iOS version.

@darshankawar darshankawar added in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Jan 14, 2021
@sullenel
Copy link

@rbellens
Does it happen only on iOS 10.3.x?

@rbellens
Copy link
Author

[ +710 ms] [100%] Installed package build/ios/iphoneos/Runner.app
[ +765 ms] ------ Debug phase ------
[        ] Starting debug of 628d9965eac484b6a65667d0072a796c3b1a520f (N42AP, iPhone 5 (Global/CDMA), iphoneos, armv7s) a.k.a. 'iPhone van Rik' connected through USB...
[ +965 ms] [  0%] Looking up developer disk image
[  +38 ms] [ 95%] Developer disk image mounted successfully
[+1868 ms] [100%] Connecting to remote debug server
[        ] -------------------------
[ +209 ms] (lldb) command source -s 0 '/tmp/F4EBC7F0-BECC-45EC-9CB1-81B9C54E7E0C/fruitstrap-lldb-prep-cmds-628d9965eac484b6a65667d0072a796c3b1a520f'
[        ] Executing commands in '/tmp/F4EBC7F0-BECC-45EC-9CB1-81B9C54E7E0C/fruitstrap-lldb-prep-cmds-628d9965eac484b6a65667d0072a796c3b1a520f'.
[        ] (lldb)     platform select remote-ios --sysroot '/Users/rikbellens/Library/Developer/Xcode/iOS DeviceSupport/10.3.4 (14G61)/Symbols'
[        ]   Platform: remote-ios
[        ]  Connected: no
[        ]   SDK Path: "/Users/rikbellens/Library/Developer/Xcode/iOS DeviceSupport/10.3.4 (14G61)/Symbols"
[        ] (lldb)     target create "/Users/rikbellens/Downloads/test/test_app/build/ios/iphoneos/Runner.app"
[ +389 ms] Current executable set to '/Users/rikbellens/Downloads/test/test_app/build/ios/iphoneos/Runner.app' (armv7).
[        ] (lldb)     script fruitstrap_device_app="/private/var/containers/Bundle/Application/44881ED4-A09C-4E0C-BAAA-F683B3419F5F/Runner.app"
[ +266 ms] (lldb)     script fruitstrap_connect_url="connect://127.0.0.1:52151"
[        ] (lldb)     script fruitstrap_output_path=""
[        ] (lldb)     script fruitstrap_error_path=""
[        ] (lldb)     target modules search-paths add /usr "/Users/rikbellens/Library/Developer/Xcode/iOS DeviceSupport/10.3.4 (14G61)/Symbols/usr" /System "/Users/rikbellens/Library/Developer/Xcode/iOS
DeviceSupport/10.3.4 (14G61)/Symbols/System" "/private/var/containers/Bundle/Application/44881ED4-A09C-4E0C-BAAA-F683B3419F5F" "/Users/rikbellens/Downloads/test/test_app/build/ios/iphoneos"
"/var/containers/Bundle/Application/44881ED4-A09C-4E0C-BAAA-F683B3419F5F" "/Users/rikbellens/Downloads/test/test_app/build/ios/iphoneos" /Developer "/Users/rikbellens/Library/Developer/Xcode/iOS
DeviceSupport/10.3.4 (14G61)/Symbols/Developer"
[  +18 ms] (lldb)     command script import "/tmp/F4EBC7F0-BECC-45EC-9CB1-81B9C54E7E0C/fruitstrap_628d9965eac484b6a65667d0072a796c3b1a520f.py"
[   +2 ms] (lldb)     command script add -f fruitstrap_628d9965eac484b6a65667d0072a796c3b1a520f.connect_command connect
[        ] (lldb)     command script add -s asynchronous -f fruitstrap_628d9965eac484b6a65667d0072a796c3b1a520f.run_command run
[        ] (lldb)     command script add -s asynchronous -f fruitstrap_628d9965eac484b6a65667d0072a796c3b1a520f.autoexit_command autoexit
[        ] (lldb)     command script add -s asynchronous -f fruitstrap_628d9965eac484b6a65667d0072a796c3b1a520f.safequit_command safequit
[        ] (lldb)     connect
[  +28 ms] (lldb)     run
[ +390 ms] success
[        ] (lldb)     safequit
[ +128 ms] Process 701 detached
[  +15 ms] Application launched on the device. Waiting for observatory port.
[+1890 ms] Observatory URL on device: http://127.0.0.1:64100/
[  +16 ms] Attempting to forward device port 64100 to host port 52153
[        ] executing: /Users/rikbellens/tools/flutter/bin/cache/artifacts/usbmuxd/iproxy 52153:64100 --udid 628d9965eac484b6a65667d0072a796c3b1a520f
[+1036 ms] Forwarded port ForwardedPort HOST:52153 to DEVICE:64100
[   +2 ms] Forwarded host port 52153 to device port 64100 for Observatory
[   +9 ms] Installing and launching... (completed in 15,8s)
[   +5 ms] Caching compiled dill
[  +50 ms] Connecting to service protocol: http://127.0.0.1:52153/
[   +3 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at http://127.0.0.1:52153/.
[+1018 ms] DDS is listening at http://127.0.0.1:52155/LtmeQ8ulJ-s=/.
[ +107 ms] Successfully connected to service protocol: http://127.0.0.1:52153/
[  +26 ms] DevFS: Creating new filesystem on the device (null)
[  +79 ms] DevFS: Created new filesystem on the device (file:///private/var/mobile/Containers/Data/Application/6AB056BC-D7CF-413E-BB2E-F7BDC9463334/tmp/test_app6CU8Vl/test_app/)
[   +4 ms] Updating assets
[  +83 ms] Syncing files to device iPhone van Rik...
[   +1 ms] <- reset
[        ] Compiling dart to kernel with 0 updated files
[   +4 ms] <- recompile package:test_app/main.dart d625f3b3-83f7-4a3d-adb8-850982f4ea8a
[        ] <- d625f3b3-83f7-4a3d-adb8-850982f4ea8a
[  +32 ms] Updating files.
[        ] DevFS: Sync finished
[   +5 ms] Syncing files to device iPhone van Rik... (completed in 40ms)
[        ] Synced 0.0MB.
[   +1 ms] <- accept
[  +37 ms] Connected to _flutterView/0x171d5c10.
[   +1 ms] Flutter run key commands.
[   +2 ms] r Hot reload. 🔥🔥🔥
[   +2 ms] R Hot restart.
[        ] h Repeat this help message.
[        ] d Detach (terminate "flutter run" but leave application running).
[        ] c Clear the screen
[        ] q Quit (terminate the application on the device).
[        ] An Observatory debugger and profiler on iPhone van Rik is available at: http://127.0.0.1:52155/LtmeQ8ulJ-s=/
[        ] Running with unsound null safety
[        ] For more information see https://dart.dev/null-safety/unsound-null-safety
[+3143 ms] Service protocol connection closed.
[        ] Lost connection to device.
[   +7 ms] DevFS: Deleting filesystem on the device (file:///private/var/mobile/Containers/Data/Application/6AB056BC-D7CF-413E-BB2E-F7BDC9463334/tmp/test_app6CU8Vl/test_app/)
[ +263 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed
[  +11 ms] "flutter run" took 33.189ms.
[ +150 ms] ensureAnalyticsSent: 136ms
[   +3 ms] Running shutdown hooks
[        ] Shutdown hook priority 4
[   +2 ms] Shutdown hooks complete
[        ] exiting with code 0

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 14, 2021
@rbellens
Copy link
Author

@sullenel
I only have an iPhone 5 with iOS 10.3 to test on. I have distributed my original app to some testers with other devices and on a device with ios 14 it also crashed, while on a device with ios 12, it did not. However, I can't be 100% sure that the reason it crashes on ios 14 is the same, as the app that they tested had more content than this minimal test app.

@darshankawar
Copy link
Member

darshankawar commented Jan 14, 2021

@rbellens
Just curious, any reason you decided to use dev / beta version to build your app and distribute it ? Usually stable version is recommended and dev could be dynamic with everyday changes going into it.
Does the crash occur on master too ?
Is there any way to get crash log coming from distributed app ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 14, 2021
@rbellens
Copy link
Author

@darshankawar
Mainly because I wanted to use the macos desktop version for development as it is very convenient and fast. And switching between stable and dev is a bit cumbersome. I guess, I'd best setup two separate environments, one for developing and one for building releases.
Nevertheless, as the issue happened on both dev and beta channels, and also master, I suspected that this issue was not something that would disappear by itself, so I thought it would be helpful to report.
I don't think I can get a crash log from a distributed app. I will try to test on other devices when I can find one.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 14, 2021
@darshankawar
Copy link
Member

Keeping this issue open for further analysis.

@darshankawar darshankawar added a: images Loading, displaying, rendering images e: OS-version specific Affects only some versions of the relevant operating system platform-ios iOS applications specifically c: crash Stack traces logged to the console passed first triage and removed in triage Presently being triaged by the triage team labels Jan 15, 2021
@rbellens
Copy link
Author

rbellens commented Mar 4, 2021

the issue on ios 14 was something unrelated, but the issue for ios 10 still exists also with latest stable flutter 2.0.

When running from Xcode, it breaks here:

libobjc.A.dylib`<redacted>:
    0x1ad1ef3c <+0>:    push   {r4, r5, r6, r7, lr}
    0x1ad1ef3e <+2>:    add    r7, sp, #0xc
    0x1ad1ef40 <+4>:    push.w {r8, r10, r11}
    0x1ad1ef44 <+8>:    sub    sp, #0x2c
    0x1ad1ef46 <+10>:   mov    r10, r0
    0x1ad1ef48 <+12>:   cmp.w  r10, #0x0
    0x1ad1ef4c <+16>:   beq    0x1ad1ef8a                ; <+78>
    0x1ad1ef4e <+18>:   ldr.w  r6, [r10, #0x10]
    0x1ad1ef52 <+22>:   bic    r4, r6, #0x3
    0x1ad1ef56 <+26>:   ldr    r1, [r4]
    0x1ad1ef58 <+28>:   cmp    r1, #0x0
    0x1ad1ef5a <+30>:   blt.w  0x1ad1f3a6                ; <+1130>
    0x1ad1ef5e <+34>:   movs   r5, #0x0
    0x1ad1ef60 <+36>:   movt   r5, #0x8008
    0x1ad1ef64 <+40>:   tst.w  r1, #0x40000000
    0x1ad1ef68 <+44>:   bne    0x1ad1ef90                ; <+84>
    0x1ad1ef6a <+46>:   movs   r0, #0x24
    0x1ad1ef6c <+48>:   movs   r1, #0x1
    0x1ad1ef6e <+50>:   blx    0x1ad37430                ; symbol stub for: calloc
    0x1ad1ef72 <+54>:   str    r4, [r0, #0x8]
    0x1ad1ef74 <+56>:   str    r5, [r0]
    0x1ad1ef76 <+58>:   and    r1, r6, #0x3
    0x1ad1ef7a <+62>:   orrs   r1, r0
    0x1ad1ef7c <+64>:   dmb    ishst
->  0x1ad1ef80 <+68>:   str.w  r1, [r10, #0x10]
    0x1ad1ef84 <+72>:   mov    r6, r4
    0x1ad1ef86 <+74>:   mov    r4, r0


libsystem_pthread.dylib`thread_start:
    0x1b316460 <+0>: push   {r4, r5}
    0x1b316464 <+4>: blx    0x1b318772                ; _pthread_start
->  0x1b316468 <+8>: nop    

@qiushuitian
Copy link

the issue on ios 14 was something unrelated, but the issue for ios 10 still exists also with latest stable flutter 2.0.

When running from Xcode, it breaks here:

libobjc.A.dylib`<redacted>:
    0x1ad1ef3c <+0>:    push   {r4, r5, r6, r7, lr}
    0x1ad1ef3e <+2>:    add    r7, sp, #0xc
    0x1ad1ef40 <+4>:    push.w {r8, r10, r11}
    0x1ad1ef44 <+8>:    sub    sp, #0x2c
    0x1ad1ef46 <+10>:   mov    r10, r0
    0x1ad1ef48 <+12>:   cmp.w  r10, #0x0
    0x1ad1ef4c <+16>:   beq    0x1ad1ef8a                ; <+78>
    0x1ad1ef4e <+18>:   ldr.w  r6, [r10, #0x10]
    0x1ad1ef52 <+22>:   bic    r4, r6, #0x3
    0x1ad1ef56 <+26>:   ldr    r1, [r4]
    0x1ad1ef58 <+28>:   cmp    r1, #0x0
    0x1ad1ef5a <+30>:   blt.w  0x1ad1f3a6                ; <+1130>
    0x1ad1ef5e <+34>:   movs   r5, #0x0
    0x1ad1ef60 <+36>:   movt   r5, #0x8008
    0x1ad1ef64 <+40>:   tst.w  r1, #0x40000000
    0x1ad1ef68 <+44>:   bne    0x1ad1ef90                ; <+84>
    0x1ad1ef6a <+46>:   movs   r0, #0x24
    0x1ad1ef6c <+48>:   movs   r1, #0x1
    0x1ad1ef6e <+50>:   blx    0x1ad37430                ; symbol stub for: calloc
    0x1ad1ef72 <+54>:   str    r4, [r0, #0x8]
    0x1ad1ef74 <+56>:   str    r5, [r0]
    0x1ad1ef76 <+58>:   and    r1, r6, #0x3
    0x1ad1ef7a <+62>:   orrs   r1, r0
    0x1ad1ef7c <+64>:   dmb    ishst
->  0x1ad1ef80 <+68>:   str.w  r1, [r10, #0x10]
    0x1ad1ef84 <+72>:   mov    r6, r4
    0x1ad1ef86 <+74>:   mov    r4, r0


libsystem_pthread.dylib`thread_start:
    0x1b316460 <+0>: push   {r4, r5}
    0x1b316464 <+4>: blx    0x1b318772                ; _pthread_start
->  0x1b316468 <+8>: nop    

I have the similular question. I try Flutter SDK 2.0.3 and it resloved.

@mikezander
Copy link

Have you found a fix for this? I'm getting this same crash around 50% of the time I make network calls. I'm getting this on the simulator though, haven't been able to try on a real device yet.

I'm on iOS 14 + the latest stable channel version:

Flutter 2.2.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d79295a (3 weeks ago) • 2021-06-11 08:56:01 -0700
Engine • revision 91c9fc8fe0
Tools • Dart 2.13.3

@darshankawar
Copy link
Member

@rbellens @mikezander
Please check this similar issue #62107 and workaround / solution of using cacheWidth or cacheHeight as mentioned here: #62107 (comment) and see if it works in your case.

Also, please verify this on latest stable / master versions.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 29, 2022
@github-actions
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.

@github-actions
Copy link

github-actions bot commented Oct 3, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: images Loading, displaying, rendering images c: crash Stack traces logged to the console e: OS-version specific Affects only some versions of the relevant operating system platform-ios iOS applications specifically waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

No branches or pull requests

5 participants