Bug 7735 - ReaderWriterLockSlim reports "The current thread has not entered the lock in write mode"
Summary: ReaderWriterLockSlim reports "The current thread has not entered the lock in ...
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Jérémie Laval
Depends on:
Reported: 2012-10-08 15:56 UTC by Matt
Modified: 2012-11-16 07:04 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Code to reprodce the bug (1.78 KB, text/x-csharp)
2012-10-08 15:57 UTC, Matt

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Matt 2012-10-08 15:56:52 UTC
Description of Problem:

ReaderWriterLockSlim reports "The current thread has not entered the lock in write mode" when it should not.

Steps to reproduce the problem:
1. Run attached code.

Actual Results: Exception

Expected Results: No Exception

How often does this happen? Always.

Additional Information:

We started seeing these errors after building mono from this commit: e223f978bebbc0c10293dc17ff30dff26cda4358

The attached example replicates the error though not in exactly the way our code does it.
Comment 1 Matt 2012-10-08 15:57:42 UTC
Created attachment 2713 [details]
Code to reprodce the bug
Comment 2 Jérémie Laval 2012-11-16 05:25:39 UTC

I cannot reproduce the problem with your attachment on master, it runs until the end with no exception.

Could you confirm it's still not working on your side? In that case, I may need another repro.
Comment 3 Matt 2012-11-16 06:52:36 UTC

I pretty regularly rebuild from git. Up until a few weeks ago, I had to reject those rebuilds for this issue. But sometime in that period the issue was fixed. Sorry, I should have closed this.

Comment 4 Jérémie Laval 2012-11-16 07:04:29 UTC
No worries. Closing now.