flutter / devtools

Performance tools for Flutter
https://flutter.dev/docs/development/tools/devtools/
BSD 3-Clause "New" or "Revised" License
1.6k stars 329 forks source link

Exception capturing CPU profile of Dart analysis server #8567

Open DanTup opened 1 day ago

DanTup commented 1 day ago

I hit this error while trying to do some CPU profiling of the analysis server. I don't know if I'll be able to repro, but I thought I should record it here before I lose it.

The steps I followed:

Chrome dev tools console has this:

js_util_patch.dart:81 getDartDevelopmentServiceVersion: (-32601) Method not found
cAU @ js_util_patch.dart:81Understand this warningAI
:9100/api/serveAvailableExtensions?packageRootUri=org-dartlang-sdk%3A%2F%2F%2Fsdk%2Flib%2F_internal%2Fvm:1 

       Failed to load resource: the server responded with a status of 500 (Internal Server Error)Understand this errorAI
js_util_patch.dart:81 HttpRequest api/serveAvailableExtensions failed status = 500, responseText = {"error":"Invalid argument (must be a file:// URI String): \"org-dartlang-sdk:///sdk/lib/_internal/vm\"","logs":["ExtensionsManager.serveAvailableExtensions for rootPathFileUri: org-dartlang-sdk:///sdk/lib/_internal/vm","ExtensionsManager.serveAvailableExtensions adding extensions for app root."]}
cAU @ js_util_patch.dart:81Understand this warningAI
js_util_patch.dart:81 Could not time async operation "cpuProfileProcessingTime" because an exception was thrown:
TypeError: Instance of 'minified:yY': type 'minified:yY' is not a subtype of type 'minified:fC?'

    at Object.p (http://127.0.0.1:9100/main.dart.js:3623:19)
    at Object.c52 (http://127.0.0.1:9100/main.dart.js:4445:18)
    at p2.cvF [as a] (http://127.0.0.1:9100/main.dart.js:4444:3)
    at am5.cgh (http://127.0.0.1:9100/main.dart.js:47598:10)
    at Object.ah (http://127.0.0.1:9100/main.dart.js:47455:15)
    at aM8.$1 (http://127.0.0.1:9100/main.dart.js:91925:14)
    at F.d9 (http://127.0.0.1:9100/main.dart.js:59451:23)
    at aT.u (http://127.0.0.1:9100/main.dart.js:59431:16)
    at Object.c_M (http://127.0.0.1:9100/main.dart.js:6377:17)
    at Object.H (http://127.0.0.1:9100/main.dart.js:6370:15)
cAU @ js_util_patch.dart:81Understand this warningAI
core_patch.dart:279 Uncaught Error: TypeError: Instance of 'minified:yY': type 'minified:yY' is not a subtype of type 'minified:fC?'
    at Object.p (js_helper.dart:1209:19)
    at Object.c52 (rti.dart:1405:3)
    at p2.cvF [as a] (rti.dart:1395:3)
    at am5.cgh (vm_service.dart:3219:5)
    at Object.ah (vm_service.dart:69:14)
    at aM8.$1 (vm_service_private_extensions.dart:899:12)
    at F.d9 (iterable.dart:435:29)
    at aT.u (iterable.dart:364:5)
    at Object.c_M (core_patch.dart:367:5)
    at Object.H (core_patch.dart:348:39)Understand this errorAI
js_util_patch.dart:81 [zoneGuarded]: TypeError: Instance of 'minified:yY': type 'minified:yY' is not a subtype of type 'minified:fC?'
org-dartlang-sdk:///dart-sdk/lib/_internal/js_runtime/lib/js_helper.dart 1209:19                  wrapException
org-dartlang-sdk:///dart-sdk/lib/_internal/js_shared/lib/rti.dart 1405:3                          _failedAsCheck
org-dartlang-sdk:///dart-sdk/lib/_internal/js_shared/lib/rti.dart 1395:3                          _generalNullableAsCheckImplementation
../../../../../../rc/tmp65uzhjoh/hosted/pub.dev/vm_service-14.3.0/lib/src/vm_service.dart 3219:5  CodeRef._fromJson
../../../../../../rc/tmp65uzhjoh/hosted/pub.dev/vm_service-14.3.0/lib/src/vm_service.dart 69:14   createServiceObject
../../../lib/src/screens/vm_developer/vm_service_private_extensions.dart 899:12                   ProfileCode._fromJson
org-dartlang-sdk:///dart-sdk/lib/internal/iterable.dart 435:29                                    MappedListIterable.elementAt
org-dartlang-sdk:///dart-sdk/lib/internal/iterable.dart 364:5                                     ListIterator.moveNext
org-dartlang-sdk:///dart-sdk/lib/_internal/js_runtime/lib/core_patch.dart 367:5                   List._of
org-dartlang-sdk:///dart-sdk/lib/_internal/js_runtime/lib/core_patch.dart 348:39                  List.of

image

Flutter SDK: 3.27.0-0.1.pre Dart version: 3.6.0-334.3.beta

DanTup commented 1 day ago

I tried again and reproduced the same issue. Switching to Flutter stable the issue went away, so this could be a regression (FYI @kenzieschmoll).

kenzieschmoll commented 1 day ago

Are you able to get a stack trace that is not minified? What version of DevTools is this using?