Skip to content
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

scrolling after hot reloading a const change crashes app #22911

Closed
ariedov opened this issue Oct 10, 2018 · 11 comments
Closed

scrolling after hot reloading a const change crashes app #22911

ariedov opened this issue Oct 10, 2018 · 11 comments
Labels
c: crash Stack traces logged to the console f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. t: hot reload Reloading code during "flutter run"

Comments

@ariedov
Copy link

ariedov commented Oct 10, 2018

I am firing this issue because the logs told me to.

I/flutter (11287): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (11287): The following assertion was thrown building VideoCard:
I/flutter (11287): 'package:flutter/src/rendering/object.dart': Failed assertion: line 1408 pos 14:
I/flutter (11287): '_debugSubtreeRelayoutRootAlreadyMarkedNeedsLayout()': is not true.
I/flutter (11287):
I/flutter (11287): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter (11287): more information in this error message to help you determine and fix the underlying cause.
I/flutter (11287): In either case, please report this assertion by filing a bug on GitHub:
I/flutter (11287):   https://github.com/flutter/flutter/issues/new

Stacktrace

I/flutter (11287): When the exception was thrown, this was the stack:
I/flutter (11287): #2      RenderObject.markNeedsLayout (package:flutter/src/rendering/object.dart:1408:14)
I/flutter (11287): #3      RenderBox.markNeedsLayout (package:flutter/src/rendering/box.dart:1852:11)
I/flutter (11287): #4      RenderConstrainedBox.additionalConstraints= (package:flutter/src/rendering/proxy_box.dart:212:5)
I/flutter (11287): #5      SizedBox.updateRenderObject (package:flutter/src/widgets/basic.dart:1764:18)
I/flutter (11287): #6      RenderObjectElement.update (package:flutter/src/widgets/framework.dart:4430:12)
I/flutter (11287): #7      SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4801:11)
I/flutter (11287): #8      Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
I/flutter (11287): #9      SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4803:14)
I/flutter (11287): #10     Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
I/flutter (11287): #11     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
I/flutter (11287): #12     Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
I/flutter (11287): #13     StatelessElement.update (package:flutter/src/widgets/framework.dart:3738:5)
I/flutter (11287): #14     Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
I/flutter (11287): #15     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4803:14)
I/flutter (11287): #16     Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
I/flutter (11287): #17     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4803:14)
I/flutter (11287): #18     Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
I/flutter (11287): #19     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
I/flutter (11287): #20     Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
I/flutter (11287): #21     StatelessElement.update (package:flutter/src/widgets/framework.dart:3738:5)
I/flutter (11287): #22     Element.updateChild (package:flutter/src/widgets/framework.dart:2729:15)
I/flutter (11287): #23     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3689:16)
I/flutter (11287): #24     Element.rebuild (package:flutter/src/widgets/framework.dart:3531:5)
....
I/flutter (11287): #98     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:673:20)
I/flutter (11287): #99     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:208:5)
I/flutter (11287): #100    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter (11287): #101    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter (11287): #102    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
I/flutter (11287): #103    _invoke (dart:ui/hooks.dart:139:13)
I/flutter (11287): #104    _drawFrame (dart:ui/hooks.dart:128:3)
I/flutter (11287): (elided 2 frames from class _AssertionError)

All thrown exceptions:

I/flutter (11287): Another exception was thrown: 'package:flutter/src/rendering/object.dart': Failed assertion: line 1408 pos 14: '_debugSubtreeRelayoutRootAlreadyMarkedNeedsLayout()': is not true.
I/flutter (11287): Another exception was thrown: 'package:flutter/src/rendering/sliver_multi_box_adaptor.dart': Failed assertion: line 217 pos 16: 'indexOf(child) > index': is not true.
I/flutter (11287): Another exception was thrown: 'package:flutter/src/rendering/sliver_multi_box_adaptor.dart': Failed assertion: line 217 pos 16: 'indexOf(child) > index': is not true.
I/flutter (11287): Another exception was thrown: 'package:flutter/src/rendering/sliver_multi_box_adaptor.dart': Failed assertion: line 217 pos 16: 'indexOf(child) > index': is not true.
I/flutter (11287): Another exception was thrown: 'package:flutter/src/foundation/node.dart': Failed assertion: line 106 pos 12: '_owner != null': is not true.
I/flutter (11287): Another exception was thrown: 'package:flutter/src/foundation/node.dart': Failed assertion: line 106 pos 12: '_owner != null': is not true.
I/flutter (11287): Another exception was thrown: 'package:flutter/src/foundation/node.dart': Failed assertion: line 106 pos 12: '_owner != null': is not true.
I/flutter (11287): Another exception was thrown: 'package:flutter/src/rendering/object.dart': Failed assertion: line 1152 pos 12: 'child.parentData != null': is not true.
I/flutter (11287): Another exception was thrown: 'package:flutter/src/rendering/object.dart': Failed assertion: line 1152 pos 12: 'child.parentData != null': is not true.
I/flutter (11287): Another exception was thrown: 'package:flutter/src/rendering/object.dart': Failed assertion: line 1152 pos 12: 'child.parentData != null': is not true.
I/flutter (11287): Another exception was thrown: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3533 pos 14: 'owner._debugCurrentBuildTarget == this': is not true.
I/flutter (11287): Another exception was thrown: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3533 pos 14: 'owner._debugCurrentBuildTarget == this': is not true.
I/flutter (11287): Another exception was thrown: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3533 pos 14: 'owner._debugCurrentBuildTarget == this': is not true.

Flutter doctor:

Davids-MacBook-Pro:movierate mac$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.9.4, on Mac OS X 10.13.6 17G65, locale en-UA)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
[✓] Android Studio (version 3.2)
[✓] VS Code (version 1.28.0)
[✓] Connected devices (3 available)

• No issues found!
Davids-MacBook-Pro:movierate mac$ flutter doctor -v
[✓] Flutter (Channel beta, v0.9.4, on Mac OS X 10.13.6 17G65, locale en-UA)
    • Flutter version 0.9.4 at /Users/mac/Tools/flutter
    • Framework revision f37c235c32 (2 weeks ago), 2018-09-25 17:45:40 -0400
    • Engine revision 74625aed32
    • Dart version 2.1.0-dev.5.0.flutter-a2eb050044

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/mac/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.0, Build version 10A255
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 29.0.2
    • Dart plugin version 181.5616
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

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

[✓] Connected devices (3 available)
    • SM J330F                  • 4200d8f9d4799485 • android-arm • Android 7.0 (API 24) (emulator)
    • Android SDK built for x86 • emulator-5554    • android-x86 • Android 8.1.0 (API 27) (emulator)
    • sdk google atv x86        • emulator-5556    • android-x86 • Android 8.1.0 (API 27) (emulator)

Appreciate any help! Thank you!

@zoechi
Copy link
Contributor

zoechi commented Oct 10, 2018

Could you please try if you can reproduce in master channel?

flutter channel master
flutter doctor

Can you provide information about how to reproduce? (minimal reproduction)

@zoechi zoechi added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Oct 10, 2018
@ariedov
Copy link
Author

ariedov commented Oct 11, 2018

Hello! Thank you for the quick response! I'll check from master channel a bit later today.

I have a separated horizontal ListView with NeverScrollableScrollPhysics. It is wrapped with a GestureDetector and on horizontal drag events it scrolls the ListView through ScrollController. There is also some logic for animated snapping to a specific item when the gesture finishes.

The crash usually happens when the scroll is performed. It might happen any time, usually crashes when I speed up the scrolling.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Oct 11, 2018
@zoechi zoechi added c: crash Stack traces logged to the console framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. labels Oct 11, 2018
@zoechi
Copy link
Contributor

zoechi commented Oct 11, 2018

Running code of a minimal reproduction would be quite helpful (main.dart).

@ariedov
Copy link
Author

ariedov commented Oct 11, 2018

It does reproduce on master channel with the same trace. I can send my entire project with some explanations to your email or prepare a smaller reproduction code later today or tomorrow.

[✓] Flutter (Channel master, v0.10.1-pre.24, on Mac OS X 10.13.6 17G65, locale en-UA)
    • Flutter version 0.10.1-pre.24 at /Users/mac/Tools/flutter
    • Framework revision 29feac1939 (3 hours ago), 2018-10-11 01:24:23 -0400
    • Engine revision 7ea8b9968d
    • Dart version 2.1.0-dev.7.0.flutter-b99bcfd309

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/mac/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.0, Build version 10A255
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 29.0.2
    • Dart plugin version 181.5616
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

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

[✓] Connected device (3 available)
    • SM J330F                  • 4200d8f9d4799485 • android-arm • Android 8.0.0 (API 26) (emulator)
    • Android SDK built for x86 • emulator-5554    • android-x86 • Android 8.1.0 (API 27) (emulator)
    • sdk google atv x86        • emulator-5556    • android-x86 • Android 8.1.0 (API 27) (emulator)

@zoechi
Copy link
Contributor

zoechi commented Oct 11, 2018

entire project

rather not. A reduced example that fits into a single main.dart file would be much appreciated.

@ariedov
Copy link
Author

ariedov commented Oct 11, 2018

I did assemble the test app, but couldn't reproduce the crash there.. This means I was probably wrong by blaming the scroll. Still working on the issue.

@zoechi
Copy link
Contributor

zoechi commented Oct 11, 2018

Nothing tops creating a minimal reproduction in finding bugs ;-)

@ariedov
Copy link
Author

ariedov commented Oct 11, 2018

Ok, so here is the sample. https://gist.github.com/ariedov/103e6d838ec8b73eca2bea0608db29bc

If you run it and scroll through it works as expected. But if you scroll a bit, then change the ITEM_COUNT constant, hot reload, and then scroll to the first item it will crash.

It actually crashes only when you return to the first item. It is not reproducible 100%, but it does reproduce for this example.

@zoechi zoechi added the t: hot reload Reloading code during "flutter run" label Oct 11, 2018
@goderbauer goderbauer changed the title Exception while rendering widget. Flutter 0.9.4. scrolling after hot reloading a const change crashes app Oct 13, 2018
@ariedov
Copy link
Author

ariedov commented Oct 13, 2018

not sure if the title is exactly true. the crash happens when dynamically changing the list size. it can happen through hot reload or code changes.

@zoechi
Copy link
Contributor

zoechi commented Feb 18, 2019

I can not reproduce

[✓] Flutter (Channel master, v1.2.2-pre.21, on Mac OS X 10.14.3 18D42, locale en-AT)

I'm going to close.
Please add a comment if you are still seeing this to have it reopened.

@zoechi zoechi closed this as completed Feb 18, 2019
@github-actions
Copy link

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 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. t: hot reload Reloading code during "flutter run"
Projects
None yet
Development

No branches or pull requests

2 participants