flutter / devtools

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

Logger spins forever when clicking on a long entry #7575

Closed bleonard252 closed 3 weeks ago

bleonard252 commented 6 months ago

When trying to view a long log message or a log with an attached object or stack trace, the following sometimes occurs. Sometimes it works as intended but I haven't been able to figure out what the common thread is, but it only occurs with messages that don't fit in the summary view (approximately 128 characters). image

The behavior happens in both Firefox and Chrome, on Linux, and both show the following messages in the browser console each time such an entry is clicked (this one copied from Chrome). image

Full log message as text
main.dart.js:7673 [zoneGuarded]: [Sentinel kind: Collected, valueAsString: ] from getObject()
bb @ main.dart.js:7673
ctb @ main.dart.js:49003
$1 @ main.dart.js:93997
bGl @ main.dart.js:5178
(anonymous) @ main.dart.js:171649
rM @ main.dart.js:60334
rN @ main.dart.js:60311
ph @ main.dart.js:59969
l7 @ main.dart.js:59945
ph @ main.dart.js:59337
E @ main.dart.js:59280
af_ @ main.dart.js:163405
bp @ main.dart.js:163400
aFd @ main.dart.js:9064
$2 @ main.dart.js:67749
BO @ main.dart.js:60440
$5 @ main.dart.js:60469
w2 @ main.dart.js:60294
lw @ main.dart.js:60328
Nz @ main.dart.js:5034
i4 @ main.dart.js:59584
i7 @ main.dart.js:59130
k @ main.dart.js:4881
(anonymous) @ main.dart.js:76502
(anonymous) @ main.dart.js:4890
$2 @ main.dart.js:59142
$2 @ main.dart.js:59139
bGk @ main.dart.js:5181
(anonymous) @ main.dart.js:171651
BO @ main.dart.js:60336
a1d @ main.dart.js:59509
$0 @ main.dart.js:59669
Nz @ main.dart.js:5056
i4 @ main.dart.js:59584
i7 @ main.dart.js:59130
k @ main.dart.js:4881
(anonymous) @ main.dart.js:76925
(anonymous) @ main.dart.js:4890
$2 @ main.dart.js:59142
$2 @ main.dart.js:59139
bGk @ main.dart.js:5181
(anonymous) @ main.dart.js:171651
BO @ main.dart.js:60336
a1d @ main.dart.js:59509
$0 @ main.dart.js:59669
Nz @ main.dart.js:5056
i4 @ main.dart.js:59584
i7 @ main.dart.js:59130
k @ main.dart.js:4881
(anonymous) @ main.dart.js:76812
(anonymous) @ main.dart.js:4890
$2 @ main.dart.js:59142
$2 @ main.dart.js:59139
bGk @ main.dart.js:5181
(anonymous) @ main.dart.js:171651
BO @ main.dart.js:60336
a1d @ main.dart.js:59509
$0 @ main.dart.js:59669
Nz @ main.dart.js:5056
i4 @ main.dart.js:59584
i7 @ main.dart.js:59130
k @ main.dart.js:4881
(anonymous) @ main.dart.js:49067
(anonymous) @ main.dart.js:4890
$2 @ main.dart.js:59142
$2 @ main.dart.js:59139
bGk @ main.dart.js:5181
(anonymous) @ main.dart.js:171651
BO @ main.dart.js:60336
a1d @ main.dart.js:59509
$0 @ main.dart.js:59669
Nz @ main.dart.js:5056
i4 @ main.dart.js:59584
$0 @ main.dart.js:59632
bGj @ main.dart.js:5172
(anonymous) @ main.dart.js:171647
uQ @ main.dart.js:60332
xY @ main.dart.js:60307
$0 @ main.dart.js:60384
cp5 @ main.dart.js:5088
cpy @ main.dart.js:5090
$1 @ main.dart.js:59081
childList (async)
$1 @ main.dart.js:59088
c17 @ main.dart.js:5095
bGm @ main.dart.js:5193
v7 @ main.dart.js:60350
vF @ main.dart.js:59592
i4 @ main.dart.js:59498
i7 @ main.dart.js:59488
aXb @ main.dart.js:168110
aXa @ main.dart.js:168072
(anonymous) @ main.dart.js:3602
bGl @ main.dart.js:5175
(anonymous) @ main.dart.js:171649
rM @ main.dart.js:60334
rN @ main.dart.js:60311
ph @ main.dart.js:59969
l7 @ main.dart.js:59945
l7 @ main.dart.js:60170
Xi @ main.dart.js:60196
Xh @ main.dart.js:60180
(anonymous) @ main.dart.js:3602
bGl @ main.dart.js:5175
(anonymous) @ main.dart.js:171649
rM @ main.dart.js:60334
rN @ main.dart.js:60311
ph @ main.dart.js:59969
l7 @ main.dart.js:59945
ph @ main.dart.js:59861
l7 @ main.dart.js:59812
E @ main.dart.js:59794
(anonymous) @ main.dart.js:3613
bGl @ main.dart.js:5175
(anonymous) @ main.dart.js:171649
rM @ main.dart.js:60334
rN @ main.dart.js:60311
ph @ main.dart.js:59969
l7 @ main.dart.js:59945
ph @ main.dart.js:59861
l7 @ main.dart.js:59812
E @ main.dart.js:59794
E @ main.dart.js:167030
aR2 @ main.dart.js:170697
(anonymous) @ main.dart.js:3602
$1 @ main.dart.js:170655
bGl @ main.dart.js:5178
(anonymous) @ main.dart.js:171649
rM @ main.dart.js:60334
rN @ main.dart.js:60311
$1 @ main.dart.js:60387
ch5 @ main.dart.js:3428
cnE @ main.dart.js:7665
(anonymous) @ main.dart.js:7661
main.dart.js:3466 Uncaught Error
    at Object.qy (main.dart.js:6296:18)
    at bjt.$0 (main.dart.js:168201:5)
    at iA.cE (main.dart.js:168069:53)
    at iA.yf (main.dart.js:168026:13)
    at iA.yf (main.dart.js:91769:13)
    at main.dart.js:49073:14
    at bGI.a (main.dart.js:4890:63)
    at bGI.$2 (main.dart.js:59142:14)
    at Object.m (main.dart.js:4876:10)
    at Object.bjk (main.dart.js:49081:10)

If it helps, the source code I've been seeing this with is at https://source.blakes.dev/me/spades-flutter.


DevTools version: 2.33.1 Connected Device: CPU / OS: x64 (64 bit) linux Connected app type: Flutter native (debug build) Dart Version: 3.4.0-190.1.beta Flutter Version: 3.21.0-1.0.pre.2 / beta Framework / Engine: c398442c35 / 0d4f78c952

bleonard252 commented 6 months ago

Running DevTools native (which is a source debug build from the 2.34.2 branch) gives me this output:

flutter: [ERROR]: [zoneGuarded]: [Sentinel kind: Collected, valueAsString: <collected>] from getObject()
flutter: [ERROR]: [PlatformDispatcher]: [Sentinel kind: Collected, valueAsString: <collected>] from getObject()
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: [Sentinel kind: Collected, valueAsString: <collected>] from getObject()
#0      new _OutstandingRequest (package:vm_service/src/vm_service.dart:265:34)
#1      VmService._call.<anonymous closure> (package:vm_service/src/vm_service.dart:1772:25)
#2      VmService._call (package:vm_service/src/vm_service.dart:1784:8)
#3      VmService.getObject (package:vm_service/src/vm_service.dart:1003:7)
#4      VmServiceWrapper.getObject (package:devtools_app/src/service/vm_service_wrapper.dart:164:18)
#5      VmServiceExtension.retrieveFullStringValue (package:devtools_app_shared/src/service/service_utils.dart:25:26)
#6      _retrieveFullStringValue (package:devtools_app/src/screens/logging/logging_controller.dart:58:13)
#7      LoggingController._handleDeveloperLogEvent.<anonymous closure> (package:devtools_app/src/screens/logging/logging_controller.dart:398:19)
#8      LogData.compute (package:devtools_app/src/screens/logging/logging_controller.dart:765:38)
#9      _LogDetailsState._computeLogDetails (package:devtools_app/src/screens/logging/_log_details.dart:48:25)
#10     _LogDetailsState.didUpdateWidget (package:devtools_app/src/screens/logging/_log_details.dart:42:17)
#11     StatefulElement.update (package:flutter/src/widgets/framework.dart:5659:55)
#12     Element.updateChild (package:flutter/src/widgets/framework.dart:3827:15)
#13     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5512:16)
#14     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5650:11)
#15     Element.rebuild (package:flutter/src/widgets/framework.dart:5203:7)
#16     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2905:19)
#17     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1136:21)
#18     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:443:5)
#19     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1392:15)
#20     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1313:9)
#21     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1171:5)
#22     _rootRun (dart:async/zone.dart:1399:13)
#23     _CustomZone.run (dart:async/zone.dart:1301:19)
#24     _CustomZone.runGuarded (dart:async/zone.dart:1209:7)
#25     _invoke (dart:ui/hooks.dart:314:10)
#26     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:419:5)
#27     _drawFrame (dart:ui/hooks.dart:283:31)

I think it means whatever it's trying to get (the message?) has been garbage-collected. This feels like something a logging tool for a garbage-collected language would account for, yes?

kenzieschmoll commented 3 months ago

This should be fixed as part of the work for V2 of the logging page. Once that work lands, we should verify this behavior does not reproduce.

bleonard252 commented 3 weeks ago

I've tested the latest master devtools and the issue is solved! There is a lot of useless-to-me logging metadata JSON though, maybe that shouldn't show up in the list (by default)...

Thank you so much. The logging view is so much more useful now!