Skip to content

Flutter tool shouldn't dump a huge stack trace when it times out on startup #10058

Closed

Description

@Hixie

If the app crashes on startup, the output is poor:

Launching lib/main.dart on Nexus 6 in debug mode...
Running 'gradle assembleDebug'...                     7.4s
Built build/app/outputs/apk/app-debug.apk (27.4MB).
Installing build/app/outputs/apk/app.apk...           6.5s
Unhandled exception:
TimeoutException: Request to Dart VM Service timed out: getIsolate({isolateId: isolates/418942943})
#0      VM.invokeRpcRaw (package:flutter_tools/src/vmservice.dart:667)
<asynchronous suspension>
#1      Isolate.invokeRpcRaw (package:flutter_tools/src/vmservice.dart:902)
#2      Isolate._fetchDirect (package:flutter_tools/src/vmservice.dart:885)
#3      ServiceObject.reload (package:flutter_tools/src/vmservice.dart:348)
<asynchronous suspension>
#4      ServiceObject.load (package:flutter_tools/src/vmservice.dart:319)
<asynchronous suspension>
#5      VM.getFromMap (package:flutter_tools/src/vmservice.dart:611)
#6      _upgradeList (package:flutter_tools/src/vmservice.dart:235)
#7      _upgradeMap.<anonymous closure> (package:flutter_tools/src/vmservice.dart:224)
#8      _HashVMBase&MapMixin&&_LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:356)
#9      _upgradeMap (package:flutter_tools/src/vmservice.dart:220)
#10     _upgradeCollection (package:flutter_tools/src/vmservice.dart:213)
#11     VM._update (package:flutter_tools/src/vmservice.dart:510)
#12     ServiceObject.update (package:flutter_tools/src/vmservice.dart:390)
#13     ServiceObject.reload (package:flutter_tools/src/vmservice.dart:353)
<asynchronous suspension>
#14     VMService.getVM (package:flutter_tools/src/vmservice.dart:176)
#15     FlutterDevice.getVMs (package:flutter_tools/src/resident_runner.dart:88)
<asynchronous suspension>
#16     ResidentRunner.connectToServiceProtocol (package:flutter_tools/src/resident_runner.dart:536)
<asynchronous suspension>
#17     HotRunner.attach (package:flutter_tools/src/run_hot.dart:93)
<asynchronous suspension>
#18     HotRunner.run (package:flutter_tools/src/run_hot.dart:193)
<asynchronous suspension>
#19     RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:321)
<asynchronous suspension>
#20     FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:210)
<asynchronous suspension>
#21     RunCommand.verifyThenRunCommand (package:flutter_tools/src/commands/run.dart:210)
<asynchronous suspension>
#22     FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:156)
<asynchronous suspension>
#23     CommandRunner.runCommand (package:args/command_runner.dart:194)
<asynchronous suspension>
#24     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:261)
<asynchronous suspension>
#25     CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:109)
#26     Future.Future.sync (dart:async/future.dart:208)
#27     CommandRunner.run (package:args/command_runner.dart:109)
#28     FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:156)
#29     run.<anonymous closure> (package:flutter_tools/executable.dart:140)
<asynchronous suspension>
#30     AppContext._run (package:flutter_tools/src/base/context.dart:76)
<asynchronous suspension>
#31     AppContext.runInZone.<anonymous closure> (package:flutter_tools/src/base/context.dart:66)
#32     _rootRun (dart:async/zone.dart:1120)
#33     _CustomZone.run (dart:async/zone.dart:1001)
#34     runZoned (dart:async/zone.dart:1465)
#35     AppContext.runInZone (package:flutter_tools/src/base/context.dart:65)
#36     run (package:flutter_tools/executable.dart:113)
<asynchronous suspension>
#37     main (package:flutter_tools/executable.dart:66)
<asynchronous suspension>
#38     main (file:///usr/local/google/home/ianh/dev/flutter/packages/flutter_tools/bin/flutter_tools.dart:16)
#39     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:263)
#40     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on May 12, 2017
  2. added this to the milestone on May 12, 2017
  3. modified the milestones: , 3: Current Milestone on Dec 6, 2017
  4. Hixie commented on Dec 20, 2017

    @Hixie
    ContributorAuthor

    Leaving in current milestone since it's a tool crash that might affect many users.

  5. mit-mit commented on Jan 4, 2018

    @mit-mit
    Member

    cc @a-siva, who is a good assignee of this?

  6. aam commented on Jan 31, 2018

    @aam
    Member

    Is this still reproducible?
    Now when application crashes on the start(I forced null pointer dereference into the engine to force the crash), it sits waiting for the response from observatory:

    ~/$FH/flutter/examples/flutter_gallery  ‹master*› 
    ╰─➤  $FH/flutter/bin/flutter run --local-engine android_debug_unopt_x86                                                       130 ↵
    ...
    [        ] Waiting for observatory port to be available...
    [+1045 ms] I/flutter (11772): [INFO:platform_view_android.cc(111)] Could not initialize Vulkan surface. Falling back to OpenGL.
    [  +10 ms] I/flutter (11772): [INFO:platform_view_android.cc(115)] GL surface initialized.
    [   +9 ms] I/FlutterActivityDelegate(11772): onResume setting current activity to this
    

    while on the device it says 'Unfortunately, Gallery has stopped'.

  7. Hixie commented on Jan 31, 2018

    @Hixie
    ContributorAuthor

    What happens once the tool times out?

  8. Hixie commented on Jan 31, 2018

    @Hixie
    ContributorAuthor

    (I think the original bug was about crashes in the framework, not the engine.)

  9. aam commented on Jan 31, 2018

    @aam
    Member

    For me it never times out.

  10. Hixie commented on Jan 31, 2018

    @Hixie
    ContributorAuthor

    Well, I guess that's not as bad as a crash... still not ideal though. :-/

  11. aam commented on Feb 6, 2018

    @aam
    Member

    Closing(as obsolete) now that it there is no long stack trace.

  12. github-actions commented on Sep 4, 2021

    @github-actions

    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.

  13. locked as resolved and limited conversation to collaborators on Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

toolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions