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

VM crash: DirectoryWatchHandle::Stop() is invoked after handle is released #43941

Closed
aam opened this issue Oct 27, 2020 · 5 comments
Closed

VM crash: DirectoryWatchHandle::Stop() is invoked after handle is released #43941

aam opened this issue Oct 27, 2020 · 5 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. library-io os-windows P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@aam
Copy link
Contributor

aam commented Oct 27, 2020

From Dart-Code/Dart-Code#2814 Dart vm runtime crashes when FileSystemWatcher broadcastController onCancel is invoked, that calls unwatchPath, that calls DirectoryWatchHandler::Stop for the DirectoryWatchHandle that seems to be already released(its ref_count is 0, monitor_ is 0):

 	[Inline Frame] dart.exe!dart::bin::MonitorLocker::MonitorLocker(dart::bin::Monitor * monitor) Line 33
 	dart.exe!dart::bin::DirectoryWatchHandle::Stop() Line 427
>	dart.exe!dart::NativeEntry::AutoScopeNativeCallWrapperNoStackCheck(_Dart_NativeArguments * args, void(*)(_Dart_NativeArguments *) func) Line 218
@aam aam added area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. library-io os-windows labels Oct 27, 2020
@aam aam self-assigned this Oct 27, 2020
@aam aam added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Oct 27, 2020
@vytautas-pranskunas-
Copy link

watching

@aam
Copy link
Contributor Author

aam commented Oct 29, 2020

https://dart-review.googlesource.com/c/sdk/+/169601 with potential fix

@szerner
Copy link

szerner commented Oct 30, 2020

https://dart-review.googlesource.com/c/sdk/+/169601 with potential fix

Based on some Windows crash dumps that I was able to share with @aam he sent me an experimental dart SDK with this fix for testing purposes.

And I didn't note a single crash and "Dart Analyzer has terminated" messages during some hours of flutter development today. So this issue seems to be on a good way to be solved.

@tudor07
Copy link

tudor07 commented Nov 3, 2020

I still have this issue

Flutter 1.22.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 8874f21e79 (5 days ago) • 2020-10-29 14:14:35 -0700
Engine • revision a1440ca392
Tools • Dart 2.10.3

@szerner
Copy link

szerner commented Nov 3, 2020

I still have this issue

Flutter 1.22.3 • channel stable • https://github.com/flutter/flutter.git
...

The fix mentioned here

https://dart-review.googlesource.com/c/sdk/+/169601 with potential fix

is not yet part of any current flutter channel, not even dev. So we'll have to wait until one of the flutter releases is bundled with at least dart sdk 2.12.0-8.0.dev, which seems to be the first to contain it (follow the link to the fix and then click on 'INCLUDED IN').

@mit-mit mit-mit changed the title DirectoryWatchHandle::Stop() is invoked after handle is released, crashing vm VM crash: DirectoryWatchHandle::Stop() is invoked after handle is released Nov 11, 2020
dart-bot pushed a commit that referenced this issue Nov 11, 2020
…andle.

Fixes #43941

TEST=Running four dart scripts in parallel that delete/watch thousands of file reproduces the failure after several minutes. After the fix it no longer reproduces.

Change-Id: I6a0a928838c676f44e747a822611b56f0ffc4841
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169601
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. library-io os-windows P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

4 participants