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

Stop failing on double finalization #224

Merged
merged 6 commits into from
Mar 28, 2024
Merged

Stop failing on double finalization #224

merged 6 commits into from
Mar 28, 2024

Conversation

polina-c
Copy link
Contributor

@polina-c polina-c commented Mar 28, 2024

  1. Stop failing on double finalization
  2. Internal cleanups/improvements

Exception in flutter tests:

00:05 +3: SemanticsDebugger will schedule a frame                                                                                                                      
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following _Exception was thrown running a test (but after the test had completed):
Exception: The object 616336549 GCed twice

When the exception was thrown, this was the stack:
#0      ObjectRecord.setGCed (package:leak_tracker/src/leak_tracking/_object_record.dart:66:31)
#1      ObjectTracker._onObjectGarbageCollected (package:leak_tracker/src/leak_tracking/_object_tracker.dart:84:12)
#9      _FinalizerImpl._runFinalizers (dart:core-patch/finalizer_patch.dart:66:18)
#10     _FinalizerImpl._handleFinalizerMessage (dart:core-patch/finalizer_patch.dart:79:15)
(elided 7 frames from dart:async and package:stack_trace)
════════════════════════════════════════════════════════════════════════════════════════════════════

@github-actions github-actions bot added type-infra A repository infrastructure change or enhancement package:leak_tracker_testing package:memory_usage labels Mar 28, 2024
@polina-c polina-c changed the title Next Stop failing on double finalization Mar 28, 2024
// Normally it should not happen, but sometimes finalizer is called twice.
// To repro, update next line to throw exception and run flutter tests with
// the updated leak_tracker.
if (_gcedGcCount != null) return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a TODO with a bug tracking this. The Dart VM really should not be calling finalizers twice.
Do we have a standalone repro so that @rmacnak-google and others on the Dart team can reproduce?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@polina-c polina-c merged commit 74d26bc into dart-lang:main Mar 28, 2024
3 checks passed
@polina-c
Copy link
Contributor Author

@ksokolovskyi

@polina-c polina-c deleted the next branch March 28, 2024 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants