vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Debugger holds lock on file after 'debug stop'

Open jeffschwMSFT opened this issue 10 years ago • 8 comments

This issue has hit me about a half dozen times while debugging a .net core web app on my Mac. The repro steps below are a bit convoluted but the general issues happens in less obvious ways.

Repo steps: open folder 'app' start debugging <break in 'lib'> Modify the code (to cause a rebuild of lib) In the watch window expand this.Roots (to cause the debugger to hold the file lock) Before the dictionary is expanded (not to worry it takes a very long time to do that) restart debugging Either press "debug anyway" or close and "start debugging"

Expected: When the debugger stops it should release the file lock

Actual: The debugger holds a file lock which causes VS Code to fail to build and then debug. Here is the error message: ERROR: Error while trying to enter break state. Debugging will now stop. Failed to find thread 7373 for break event The program '/Users/xyz/Documents/Projects/bug/badimage/app/bin/Debug/netcoreapp1.0/app.dll' has exited with code 42 (0x0000002a).

To make matters worse, I have had my Mac crash twice while trying to narrow this repro down. The cause of the crash is clrdbg process starts to consume memory aggressively and takes down the machine. I have also seen this repro fail with a BadImageException when trying to debug.

.NET Command Line Tools (1.0.0-preview1-002702)

Product Information: Version: 1.0.0-preview1-002702 Commit Sha: 6cde21225e

Runtime Environment: OS Name: Mac OS X OS Version: 10.11 OS Platform: Darwin RID: osx.10.11-x64

VS Code - c# extension 1.0.3-rc2 badimage.tar.gz

jeffschwMSFT avatar May 19 '16 18:05 jeffschwMSFT

This error occurring with me using asp.net core RTM

allangomes avatar Jun 28 '16 02:06 allangomes

I am changing the milestone of this from 1.4 to 1.5 because certain aspects of this issue have been fixed but there are still open issues related to this one.

chuckries avatar Aug 25 '16 18:08 chuckries

@chuckries: What's the status of this? Is there still more to do here? Are there other issues tracking the details of what's left?

DustinCampbell avatar Feb 08 '17 14:02 DustinCampbell

@gregg-miskelly do you recall if this is fixed?

chuckries avatar Feb 09 '17 18:02 chuckries

I remember there was some other aspect of this that we wanted to eventually improve, but I don't remember what it was. @rajkumar42 do you remember?

gregg-miskelly avatar Feb 09 '17 18:02 gregg-miskelly

Created an issue https://github.com/OmniSharp/omnisharp-vscode/issues/1215 to track.

rajkumar42 avatar Feb 09 '17 23:02 rajkumar42

@gregg-miskelly I see that #1215 is complete. Any work left to do here?

JoeRobich avatar Sep 13 '24 03:09 JoeRobich

@JoeRobich I am guessing not. If so, no one would remember anyway.

gregg-miskelly avatar Sep 13 '24 04:09 gregg-miskelly