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

Assertion failure in timer_impl during slow hot reload #36612

Open
jonahwilliams opened this Issue Apr 12, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@jonahwilliams
Copy link
Contributor

jonahwilliams commented Apr 12, 2019

When hot reload syncs a large number of assets, we are reliably seeing a failed assertion in timer_impl. To reproduce:

  1. Comment out all assets in the flutter_gallery pubspec.
  2. flutter run flutter_gallery.
  3. Uncomment all assets and perform hot reload.

Also see google3 issue b/130403939

{details: 'dart:isolate-patch/timer_impl.dart': Failed assertion: line 442: '<optimized out>': is not true.
           #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:40:39)
           #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
           #2      _Timer._createTimerHandler (dart:isolate-patch/timer_impl.dart:442:12)
           #3      _Timer._notifyZeroHandler (dart:isolate-patch/timer_impl.dart:255:7)
           #4      _Timer._enqueue (dart:isolate-patch/timer_impl.dart:242:7)
           #5      _Timer._createTimer (dart:isolate-patch/timer_impl.dart:180:11)
           #6      new _Timer (dart:isolate-patch/timer_impl.dart:185:12)
           #7      _Timer._factory (dart:isolate-patch/timer_impl.dart:462:16)
           #8      Timer._createTimer (dart:async-patch/timer_patch.dart:20:34)
           #9      _RootZone.createTimer (dart:async/zone.dart:1403:18)
           #10     new Timer (dart:async/timer.dart:49:27)
           #11     new Future.delayed (dart:async/future.dart:311:9)
           #12     BindingBase.registerServiceExtension.<anonymous closure>.<anonymous closure> (package:flutter/src/foundation/binding.dart:505:9)
           #13     debugInstrumentAction (package:flutter/src/foundation/debug.dart:62:18)
           #14     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:504:13)
           #15     _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6)
           #16     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:486:45)
           #17     _runExtension (dart:developer-patch/developer.dart:84:23)
           #18     _Timer._enqueue (dart:isolate-patch/timer_impl.dart:232:3)
           #19     _Timer._createTimer (dart:isolate-patch/timer_impl.dart:180:11)
           #20     new _Timer (dart:isolate-patch/timer_impl.dart:185:12)
           #21     _Timer._factory (dart:isolate-patch/timer_impl.dart:462:16)
           #22     Timer._createTimer (dart:async-patch/timer_patch.dart:20:34)
           #23     _RootZone.createTimer (dart:async/zone.dart:1403:18)
           #24     new Timer (dart:async/timer.dart:49:27)
           #25     new Future.delayed (dart:async/future.dart:311:9)
           #26     BindingBase.registerServiceExtension.<anonymous closure>.<anonymous closure> (package:flutter/src/foundation/binding.dart:505:9)
           #27     debugInstrumentAction (package:flutter/src/foundation/debug.dart:62:18)
           #28     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:504:13)
           #29     _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6)
           #30     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:486:45)
           #31     _runExtension (dart:developer-patch/developer.dart:84:23)
           #32     _Timer._createTimer (dart:isolate-patch/timer_impl.dart:173:51)
           #33     new _Timer (dart:isolate-patch/timer_impl.dart:185:12)
           #34     _Timer._factory (dart:isolate-patch/timer_impl.dart:462:16)
           #35     Timer._createTimer (dart:async-patch/timer_patch.dart:20:34)
           #36     _RootZone.createTimer (dart:async/zone.dart:1403:18)
           #37     new Timer (dart:async/timer.dart:49:27)
           #38     new Future.delayed (dart:async/future.dart:311:9)
           #39     BindingBase.registerServiceExtension.<anonymous closure>.<anonymous closure> (package:flutter/src/foundation/binding.dart:505:9)
           #40     debugInstrumentAction (package:flutter/src/foundation/debug.dart:62:18)
           #41     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:504:13)
           #42     _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6)
           #43     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:486:45)
           #44     _runExtension (dart:developer-patch/developer.dart:84:23)
           #45     Timer._createTimer (dart:async-patch/timer_patch.dart:9:3)
           #46     _RootZone.createTimer (dart:async/zone.dart:1403:18)
           #47     new Timer (dart:async/timer.dart:49:27)
           #48     new Future.delayed (dart:async/future.dart:311:9)
           #49     BindingBase.registerServiceExtension.<anonymous closure>.<anonymous closure> (package:flutter/src/foundation/binding.dart:505:9)
           #50     debugInstrumentAction (package:flutter/src/foundation/debug.dart:62:18)
           #51     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:504:13)
           #52     _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6)
           #53     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:486:45)
           #54     _runExtension (dart:developer-patch/developer.dart:84:23)
           #55     new Future.delayed (dart:async/future.dart:309:3)
           #56     BindingBase.registerServiceExtension.<anonymous closure>.<anonymous closure> (package:flutter/src/foundation/binding.dart:505:9)
           #57     debugInstrumentAction (package:flutter/src/foundation/debug.dart:62:18)
           #58     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:504:13)
           #59     _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6)
           #60     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:486:45)
           #61     _runExtension (dart:developer-patch/developer.dart:84:23)
           #62     BindingBase.registerServiceExtension.<anonymous closure>.<anonymous closure> (package:flutter/src/foundation/binding.dart:488:14)
           #63     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:492:8)
           #64     _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6)
           #65     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:486:45)
           #66     _runExtension (dart:developer-patch/developer.dart:84:23)
           #67     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:486:45)
           #68     _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6)
           #69     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:486:45)
           #70     _runExtension (dart:developer-patch/developer.dart:84:23)
           #71     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:486:45)
           #72     _runExtension (dart:developer-patch/developer.dart:84:23)
           #73     _runExtension (dart:developer-patch/developer.dart:69:1)
@jonahwilliams

This comment has been minimized.

Copy link
Contributor Author

jonahwilliams commented Apr 12, 2019

cc @a-siva

@rmacnak-google

This comment has been minimized.

Copy link
Member

rmacnak-google commented Apr 12, 2019

Hm, it looks like the timer implementation is being re-entered because a service extension creates some timers. I thought we had arranged the service extensions have their execution delayed until the next turn of the event loop.

@a-siva a-siva added the area-vm label Apr 15, 2019

dart-bot pushed a commit that referenced this issue Apr 17, 2019

[vm, service] Fix deferral of service extension invocation to not be …
…mislead by other OOB messages.

This was the behavior intended in 7052bd6.

Bug: #24137
Bug: #36612
Change-Id: I2d0712d89ff45cd480580e73c4fd55ac4cf2ca59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99360
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.