Skip to content

_NativeSocket causes a crash by completing a Future twice #78826

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

Closed
fzyzcjy opened this issue Mar 23, 2021 · 4 comments
Closed

_NativeSocket causes a crash by completing a Future twice #78826

fzyzcjy opened this issue Mar 23, 2021 · 4 comments
Labels
a: production Issues experienced in live production apps c: crash Stack traces logged to the console dependency: dart Dart team may need to help us r: fixed Issue is closed as already fixed in a newer version

Comments

@fzyzcjy
Copy link
Contributor

fzyzcjy commented Mar 23, 2021

Steps to Reproduce

  1. Run flutter create bug.
  2. Thank you for the framework! Cannot provide a simple reproducible sample, but the problem exists and affects many users.

Expected results:

No error

Actual results:

Error:

String: Bad state: Future already completed
  File "future_impl.dart", line 45, in _AsyncCompleter.complete
  File "socket_patch.dart", line 847, in _NativeSocket.tryConnectToResolvedAddresses.connectNext.<fn>
  File "socket_patch.dart", line 1214, in _NativeSocket.issueWriteEvent.issue
  File "socket_patch.dart", line 1221, in _NativeSocket.issueWriteEvent
  File "socket_patch.dart", line 1242, in _NativeSocket.multiplex
  File "isolate_patch.dart", line 184, in _RawReceivePortImpl._handleMessage
Logs
N/A
no analysis errors.
[✓] Flutter (Channel stable, 2.0.1, on Mac OS X 10.15.7 19H524 darwin-x64, locale
    zh-Hans-CN)
    • Flutter version 2.0.1 at /Users/tom/opt/flutter
    • Framework revision c5a4b4029c (3 周前), 2021-03-04 09:47:48 -0800
    • Engine revision 40441def69
    • Dart version 2.12.0
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/tom/Library/Android/sdk
    • Platform android-30, build-tools 29.0.3
    • ANDROID_SDK_ROOT = /Users/tom/Library/Android/sdk
    • Java binary at: /Users/tom/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7042882/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.4, Build version 12D4e
    • CocoaPods version 1.10.0

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

[✓] Android Studio (version 4.1)
    • Android Studio at /Users/tom/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7042882/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)

[✓] IntelliJ IDEA Ultimate Edition (version 2020.3)
    • IntelliJ at /Users/tom/Applications/JetBrains Toolbox/IntelliJ IDEA
      Ultimate.app
    • 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

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

[✓] Connected device (2 available)
    • iPhone 8 (mobile) • 2B6C1189-40D3-4E60-898F-2A5E58ACAA3D • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
    • Chrome (web)      • chrome                               • web-javascript •
      Google Chrome 89.0.4389.90

• No issues found!

@TahaTesser TahaTesser added the in triage Presently being triaged by the triage team label Mar 23, 2021
@TahaTesser
Copy link
Member

Similar crash issue seems to be related to dart in Flutter, labelling

@TahaTesser TahaTesser changed the title _NativeSocket causes a crash by completing a Future twice (the whole stack trace only contains Flutter's socket_patch.dart and future_impl.dart so I can do nothing :( ) _NativeSocket causes a crash by completing a Future twice Mar 23, 2021
@TahaTesser TahaTesser added a: production Issues experienced in live production apps dependency: dart Dart team may need to help us passed first triage c: crash Stack traces logged to the console and removed in triage Presently being triaged by the triage team labels Mar 23, 2021
@mraleph
Copy link
Member

mraleph commented Mar 23, 2021

This was fixed and cherry picked into 2.0.3 (dart-lang/sdk#45214)

@mraleph mraleph closed this as completed Mar 23, 2021
@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Mar 23, 2021

Sounds great!

@TahaTesser TahaTesser added the r: fixed Issue is closed as already fixed in a newer version label Mar 23, 2021
@github-actions
Copy link

github-actions bot commented Aug 4, 2021

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 Aug 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: production Issues experienced in live production apps c: crash Stack traces logged to the console dependency: dart Dart team may need to help us r: fixed Issue is closed as already fixed in a newer version
Projects
None yet
Development

No branches or pull requests

3 participants