Repository navigation
Crashing during hot reload when --track-widget-creation is enabled #1133
Copy link
Copy link
Closed
Labels
Description
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?
Reactions are currently unavailable
Activity
DanTup commentedon Aug 3, 2018
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 runbehaves.Can you try setting
"dart.flutterTrackWidgetCreation": falsein your VS Code settings and see if that fixes things?c4talyst commentedon Aug 3, 2018
The
"dart.flutterTrackWidgetCreation": falsesetting fixed it. Thanks @DanTupc4talyst commentedon Aug 3, 2018
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.
DanTup commentedon Aug 3, 2018
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.
DanTup commentedon Aug 4, 2018
I'm going to disable this by default (#1138) while this is investigated. It's possible a
flutter cleanwill fix it if you want to try that.DanTup commentedon Aug 4, 2018
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.
[-]vscode hot reload in Dart extension 2.17.0 causes error[/-][+]Crashing during hot reload when --track-widget-creation is enabled[/+]Narumikun commentedon Aug 5, 2018
@DanTup The same problem occurs in Android studio 3 (macOS). I wonder how I set
"dart.flutterTrackWidgetCreation": falsein Android Studio 3.DanTup commentedon Aug 5, 2018
@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.
devoncarew commentedon Aug 6, 2018
Yup, there is a way - from the preferences, Languages and frameworks, Flutter, you can disable the flag to track widget creation.
LJame commentedon Jan 9, 2019
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.
DanTup commentedon Jan 9, 2019
@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:
Hope this helps!