flutter / devtools

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

MP chart - Unsupported operation: NaN #1768

Closed kenzieschmoll closed 4 years ago

kenzieschmoll commented 4 years ago

Wasn't doing anything specific. Just switching between tabs in DevTools.

══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
The following UnsupportedError was thrown during paint():
Unsupported operation: NaN

The relevant error-causing widget was:
CustomPaint
file:///Users/kenzieschmoll/.pub-cache/hosted/pub.dartlang.org/mp_chart-0.1.8/lib/mp/chart/chart.dart:123:31

When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 195:49  throw_
dart-sdk/lib/_internal/js_dev_runtime/private/js_number.dart 82:5             toInt]
dart-sdk/lib/_internal/js_dev_runtime/private/js_number.dart 92:34            floor]
packages/mp_chart/mp/core/render/axis_renderer.dart 197:42                    computeAxisValues
packages/mp_chart/mp/core/render/axis_renderer.dart 127:5                     computeAxis
packages/mp_chart/mp/painter/bar_line_chart_painter.dart 488:25               compute
packages/mp_chart/mp/painter/bar_line_chart_painter.dart 259:5                onPaint
packages/mp_chart/mp/painter/painter.dart 249:5                               paint
packages/flutter/src/rendering/custom_paint.dart 531:12                       [_paintWithPainter]
packages/flutter/src/rendering/custom_paint.dart 572:7                        paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/proxy_box.dart 129:14                          paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/proxy_box.dart 129:14                          paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/proxy_box.dart 129:14                          paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/box.dart 2515:14                               defaultPaint
packages/flutter/src/rendering/stack.dart 602:5                               paintStack
packages/flutter/src/rendering/stack.dart 610:7                               paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/proxy_box.dart 129:14                          paint
packages/flutter/src/rendering/proxy_box.dart 2040:11                         paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/proxy_box.dart 129:14                          paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 135:10                             _repaintCompositedChild
packages/flutter/src/rendering/object.dart 95:5                               repaintCompositedChild
packages/flutter/src/rendering/object.dart 201:7                              [_compositeChild]
packages/flutter/src/rendering/object.dart 182:7                              paintChild
packages/flutter/src/rendering/box.dart 2515:14                               defaultPaint
packages/flutter/src/rendering/flex.dart 950:7                                paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/proxy_box.dart 129:14                          paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/box.dart 2515:14                               defaultPaint
packages/flutter/src/rendering/flex.dart 950:7                                paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/widgets/layout_builder.dart 261:14                       paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/box.dart 2515:14                               defaultPaint
packages/flutter/src/rendering/flex.dart 950:7                                paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/box.dart 2515:14                               defaultPaint
packages/flutter/src/rendering/flex.dart 950:7                                paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/shifted_box.dart 70:14                         paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/shifted_box.dart 70:14                         paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/proxy_box.dart 129:14                          paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 135:10                             _repaintCompositedChild
packages/flutter/src/rendering/object.dart 95:5                               repaintCompositedChild
packages/flutter/src/rendering/object.dart 201:7                              [_compositeChild]
packages/flutter/src/rendering/object.dart 182:7                              paintChild
packages/flutter/src/rendering/proxy_box.dart 129:14                          paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/sliver_multi_box_adaptor.dart 640:16           paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/sliver_padding.dart 277:14                     paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 184:12                             paintChild
packages/flutter/src/rendering/viewport.dart 587:16                           [_paintContents]
packages/flutter/src/rendering/object.dart 391:12                             pushLayer
packages/flutter/src/rendering/object.dart 447:7                              pushClipRect
packages/flutter/src/rendering/viewport.dart 578:14                           paint
packages/flutter/src/rendering/object.dart 2264:7                             [_paintWithContext]
packages/flutter/src/rendering/object.dart 135:10                             _repaintCompositedChild
packages/flutter/src/rendering/object.dart 95:5                               repaintCompositedChild
packages/flutter/src/rendering/object.dart 980:29                             flushPaint
packages/flutter/src/rendering/binding.dart 404:19                            drawFrame
packages/flutter/src/widgets/binding.dart 884:13                              drawFrame
packages/flutter/src/rendering/binding.dart 284:5                             [_handlePersistentFrameCallback]
packages/flutter/src/scheduler/binding.dart 1108:15                           [_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart 1047:9                            handleDrawFrame
packages/flutter/src/scheduler/binding.dart 963:5                             [_handleDrawFrame]
lib/_engine/engine.dart 191:21                                                <fn>

The following RenderObject was being processed when the exception was fired: RenderCustomPaint#a48d7:
creator: CustomPaint ← _PointerListener ← Listener ← _GestureSemantics ← RawGestureDetector ←
CoreGestureDetector ← OptimizedGestureDetector ← ConstrainedBox ← Stack ← DecoratedBox ← Container
← RepaintBoundary-[GlobalKey#44229] ← ⋯
parentData: <none> (can use size)
constraints: BoxConstraints(w=1400.0, h=173.2)
size: Size(1400.0, 173.2)
This RenderObject has no descendants.
════════════════════════════════════════════════════════════════════════════════════════════════════

@terrylucas

jacob314 commented 4 years ago

Fyi @terrylucas

kenzieschmoll commented 4 years ago

another NaN error: https://github.com/flutter/devtools/issues/1918

kenzieschmoll commented 4 years ago

Terry, does this look like it was coming from the old timeline frames chart? bar_line_chart_painter seems like it may have, but I'm not sure if that is used in the memory chart as well. If this was from the old timeline chart, we can close this issue

terrylucas commented 4 years ago

Closed Timeline doesn't use MPChart but also fixed in a previous PR for other MPChart usage.