Skip to content

Crashing during hot reload when --track-widget-creation is enabled #1133

Closed

Description

@c4talyst

vscode extension Dart was upgraded to 2.17.0. Running with "Start Debugging F5". Using iOS simulator, iPhone X, iOS 11.1. Any minor change, even adding in whitespace, and Saving (cmd-s), causing a hot reload, results in the following

../../third_party/dart/runtime/vm/object.h: 8847: error: Handle check failed: saw Instance of 'HomePage' expected Closure
Dumping native stack trace for thread 5c03
[0x00000001008ac0d4] dart::Profiler::DumpStackTrace(void*)
[0x00000001008ac0d4] dart::Profiler::DumpStackTrace(void*)
[0x0000000100b20142] dart::Assert::Fail(char const*, ...)
[0x0000000100903f3b] dart::DRT_InvokeClosureNoSuchMethod(dart::NativeArguments)
[0x000000011678085b] [Stub] CallToRuntime
[0x0000000116782dc4] [Stub] CallClosureNoSuchMethod
[0x000000011f3be9cb] new HomePage
[0x000000011f3be69a] MyApp.build
[0x000000011c179714] StatelessElement.build
[0x000000011c178a5e] ComponentElement.performRebuild
[0x000000011c177bc1] Element.rebuild
[0x000000011c16b1d0] BuildOwner.buildScope
[0x00000001169c1370] _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.drawFrame
[0x00000001169c0f68] _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding._handlePersistentFrameCallback
[0x00000001169c0d7f] _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding._handlePersistentFrameCallback
[0x00000001188e68b5] _Closure.call
[0x00000001169c0796] _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback
[0x000000011c480b28] _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame
[0x000000011ca2680b] _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.scheduleWarmUpFrame.<anonymous closure>
[0x00000001188c0512] _Closure.call
[0x000000011cf7f96d] Timer._createTimer.<anonymous closure>
[0x00000001188e68b5] _Closure.call
[0x000000011cf7ea75] _Timer._runTimers
[0x00000001169bdc32] _Timer._handleMessage
[0x00000001169bd73b] _Timer._handleMessage
[0x00000001188e68b5] _Closure.call
[0x00000001188e67bc] _RawReceivePortImpl._handleMessage
[0x0000000116780ce3] [Stub] InvokeDartCode
[0x00000001007637c9] dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&, unsigned long)
[0x0000000100766f0e] dart::DartLibraryCalls::HandleMessage(dart::Object const&, dart::Instance const&)
[0x0000000100792ed6] dart::IsolateMessageHandler::HandleMessage(dart::Message*)
[0x00000001007bdfee] dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool)
[0x00000001007be0f0] dart::MessageHandler::HandleNextMessage()
[0x0000000100aa0175] Dart_HandleMessage
[0x00000001005ef285] tonic::DartMessageHandler::OnHandleMessage(tonic::DartState*)
[0x000000010027c222] fml::MessageLoopImpl::RunExpiredTasks()
[0x000000010027ef1a] fml::MessageLoopDarwin::OnTimerFire(__CFRunLoopTimer*, fml::MessageLoopDarwin*)
[0x00000001028832a4] __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
[0x0000000102882f62] __CFRunLoopDoTimer
[0x0000000102882b1a] __CFRunLoopDoTimers
[0x000000010287a534] __CFRunLoopRun
[0x00000001028799b9] CFRunLoopRunSpecific
[0x000000010027f06b] fml::MessageLoopDarwin::Run()
[0x000000010027c359] fml::MessageLoopImpl::DoRun()
[0x000000010027ea70] std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, fml::Thread::Thread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0> >(void*, void*)
[0x0000000107ec8661] _pthread_body
[0x0000000107ec850d] _pthread_body
[0x0000000107ec7bf9] thread_start
Lost connection to device.
-- End of DumpStackTrace
Exited (sigterm)

Also logged here flutter/flutter#20191. Could this be related to the "Inspect Flutter Widget" feature added?

Activity

  1. DanTup commented on Aug 3, 2018

    @DanTup
    Member

    That's the only thing I could think could have caused this to appear in this version, since there's not really anything else that'd affect how flutter run behaves.

    Can you try setting "dart.flutterTrackWidgetCreation": false in your VS Code settings and see if that fixes things?

  2. added this to the v2.17.1 milestone on Aug 3, 2018
  3. added
    in flutterRelates to running Flutter apps
    in debuggingRelates to the debug adapter or process of running debug sessions
    on Aug 3, 2018
  4. c4talyst commented on Aug 3, 2018

    @c4talyst
    Author

    The "dart.flutterTrackWidgetCreation": false setting fixed it. Thanks @DanTup

  5. c4talyst commented on Aug 3, 2018

    @c4talyst
    Author

    Yes, this happens in a new project too.

    VSCode: 1.25.1
    Dart extension: 2.17.0

    Flutter doctor

    I haven't set this machine up for Android dev yet.

    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.5 17F77, locale en-ZA)
    [!] Android toolchain - develop for Android devices (Android SDK 28.0.1)
        ✗ Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
    [✓] iOS toolchain - develop for iOS devices (Xcode 9.1)
    [✓] Android Studio (version 3.1)
        ✗ Flutter plugin not installed; this adds Flutter specific functionality.
        ✗ Dart plugin not installed; this adds Dart specific functionality.
    [!] VS Code (version 1.25.1)
    [✓] Connected devices (2 available)
    
    ! Doctor found issues in 2 categories.
    
  6. DanTup commented on Aug 3, 2018

    @DanTup
    Member

    Thanks; I'll try and repro in the morning. If you're able to check if it happens on dev or master channels, that'd be useful to know too.

  7. DanTup commented on Aug 4, 2018

    @DanTup
    Member

    I'm going to disable this by default (#1138) while this is investigated. It's possible a flutter clean will fix it if you want to try that.

  8. modified the milestones: v2.17.1, v2.18.0 on Aug 4, 2018
  9. DanTup commented on Aug 4, 2018

    @DanTup
    Member

    I've pushed out v2.17.1 which disables this by default while it's investigated. You may wish to try turning it on and doing flutter clean. I'll re-enable by default once it works reliably.

    Leaving this issue open to track the proper fix.

  10. changed the title [-]vscode hot reload in Dart extension 2.17.0 causes error[/-] [+]Crashing during hot reload when --track-widget-creation is enabled[/+] on Aug 4, 2018
  11. Narumikun commented on Aug 5, 2018

    @Narumikun

    @DanTup The same problem occurs in Android studio 3 (macOS). I wonder how I set "dart.flutterTrackWidgetCreation": false in Android Studio 3.

  12. DanTup commented on Aug 5, 2018

    @DanTup
    Member

    @Narumikun Thanks for the info. I believe there is a way to disable track-widget-creation in IntelliJ but I'm not sure where it is but I'd guess somewhere in the Flutter settings in IntelliJ - I don't know if it's called "Track Widget Creation" or just something related to enabling the Widget Inspector. @devoncarew or @jacob314 may be able to confirm.

  13. devoncarew commented on Aug 6, 2018

    @devoncarew
    Contributor

    Yup, there is a way - from the preferences, Languages and frameworks, Flutter, you can disable the flag to track widget creation.

  14. modified the milestones: v2.18.0, On Deck on Aug 27, 2018
  15. LJame commented on Jan 9, 2019

    @LJame

    @Narumikun The same problem occurs in Android studio 3 (macOS). I wonder how I set "dart.flutterTrackWidgetCreation": false in Android Studio 3.

    The same problem occurs in Android studio 3 (macOS). I wonder how I set "dart.flutterTrackWidgetCreation": false in Android Studio 3.
    halo you solve it?The same problem occurs.

  16. DanTup commented on Jan 9, 2019

    @DanTup
    Member

    @LJame the crash that this is case referred to was actually fixed prior to Flutter 1.0 (so we re-enabled it by default in #1277) though I forgot to resolve this. If you're on Flutter >= 1.0 and seeing crashes only when track-widget-creation is enabled, would you mind opening at https://github.com/flutter/flutter?

    If you do need to disable it, the instructions Devon gave above apply to both IntelliJ and Android Studio:

    screenshot 2019-01-09 at 9 45 27 am

    Hope this helps!

  17. removed this from the On Deck milestone on Jan 16, 2019
  18. added and removed
    in debuggingRelates to the debug adapter or process of running debug sessions
    in flutterRelates to running Flutter apps
    on Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions