Commit Graph
642 Commits
Author SHA1 Message Date
Ian Hays e3311742d9 Bump ExpectedPrerelease version to latest (rc2-23712)
Commit migrated from https://github.com/dotnet/corefx/commit/01c61f62988e8abf39aecc64b0a97ea4e384de3f
2016-01-14 10:36:27 -08:00
dagood e401efd6af Add portable-net45+win8 import to tests.
Specifically, add the import to dnxcore50 frameworks entries where "xunit" is mentioned in the project.json.
This fixes `xunit.abstractions 2.0.0 is not compatible with DNXCore,Version=v5.0.`


Commit migrated from https://github.com/dotnet/corefx/commit/da2e8eb34efcaf70069223bc431d80909a2fc91d
2016-01-12 14:04:32 -06:00
Wes Haggard a3e67fdf73 Update .builds files to include OSGroups
This these .builds files were updated and generated from a script
based on the configurations defined in the matching csproj files.

This updates the builds files to specify OSGroup and TargetGroup
as metadata instead of using AdditionalProperties and also sorts them by
TargetGroup followed by OSGroup.


Commit migrated from https://github.com/dotnet/corefx/commit/95efe37475916016a5fc6ee6f0ba584d990c4196
2016-01-02 23:50:23 -08:00
Wes Haggard f27c7dc024 Update project files adding default configurations
This add a default configuration before the Import of dirs.props
for any projects that don't have Debug as the default configuration.

Removed Configuration and Platform properties set after dirs.props
as they would have no affect and just cause confusion.

Removed OutputType=Library property as it isn't necessary.


Commit migrated from https://github.com/dotnet/corefx/commit/9e1da13cf6d5ff4b37b1867beb3411a2fe61da6a
2016-01-02 23:50:21 -08:00
Pallavi Taneja 95a3b67166 Expose Assembly.GetEntryAssembly and TypeInfo.IsEquivalentTo()
Expose Assembly.GetEntryAssembly and TypeInfo.IsEquivalentTo() in System.Reflection.
Fixes issues dotnet/corefx#4146 , dotnet/corefx#2101


Commit migrated from https://github.com/dotnet/corefx/commit/e28fdbd9dd98810a81207c665fdc4e6b40b24e64
2015-12-21 14:56:26 -08:00
Pallavi Taneja 90c2d27bf1 Update Corefx Repo to depend on newer package versions
Disable failing tests with the tracking active issue


Commit migrated from https://github.com/dotnet/corefx/commit/98fdc29624cd791bba42ec1e0cd5c256f331adfe
2015-12-21 11:48:15 -08:00
stephentoub 77c4183d17 Update package validation to rc2-23610
Commit migrated from https://github.com/dotnet/corefx/commit/6f6303f0356be4d2dd4ac117373f1e37f8752248
2015-12-11 10:53:47 -05:00
Eric Mellino b8670dea2f Add facade projects for all supported platforms
These facade project files were generated using a porting tool I wrote,
which examined some information from our internal build and created
appropriate project files. I have also re-generated all of the .builds
files so that they import the facade projects in the correct manner.


Commit migrated from https://github.com/dotnet/corefx/commit/58e2f6e862060039e1ebad727d75c87703fdb2f2
2015-12-10 10:29:09 -08:00
dagood fbfb82cc8c Change all project.json files to validate. Remove lockfiles from source control and add to gitignore.
A few new references to pick up changes that happened over time.


Commit migrated from https://github.com/dotnet/corefx/commit/0d881222d8c3269157639e2e67056e5a83aad834
2015-12-09 16:25:26 -06:00
Eric Erhardt e1abc6cf8b Move the IO check for EINTR down into the native shims.
This allows for the managed code to be cleaner, and it can easily return SafeHandle objects from P/Invoke methods.
Also, it fixes the problem where some code wasn't looping on Interop.CheckIo, which is a problem when EINTR is returned.

Fix dotnet/corefx#3168


Commit migrated from https://github.com/dotnet/corefx/commit/c0ded7d939c7c8ae702586f57011265686879537
2015-12-08 21:24:30 -06:00
Eric Erhardt 5979598973 Merge pull request dotnet/corefx#4791 from eerhardt/ShimIntPtr
Shims should use intptr_t for file descriptors.

Commit migrated from https://github.com/dotnet/corefx/commit/37fb0e5887d3f9ed1356790b71b78610c0dd3ecb
2015-12-04 18:00:40 -06:00
Jonathan Miller 467c3b09c8 Merge pull request dotnet/corefx#4781 from sokket/fsw
Fixing issues in OS X FSW regarding a Dispose Deadlock and failing UTs

Commit migrated from https://github.com/dotnet/corefx/commit/989e561cdf6cf1879b48f6f21a969a4c3f6e366a
2015-12-04 13:16:04 -08:00
Jonathan Miller 4306181d9b Refactoring the OS X FileSystemWatcher to more match the Linux implementation
by using an internal Instance class in order to allow each instance to clean
itself up without causing side effects to other instances during rapid
start-stop-start scenarios. This refactor fixes issue dotnet/corefx#4738

Fixing a couple broken UTs by preventing notifications from being sent out for
the watched folder. This fixes dotnet/corefx#4830, dotnet/corefx#4831, and parts of dotnet/corefx#2279


Commit migrated from https://github.com/dotnet/corefx/commit/be314721b0f787a18366d8e01ca677db9219e716
2015-12-04 11:03:18 -08:00
Eric Erhardt eb363c4e65 Workaround the way CI runs tests.
The current changes in FileSystem.Watcher and MemoryMappedFiles require the latest
System.IO.FileSystem in order for their tests to be passing.


Commit migrated from https://github.com/dotnet/corefx/commit/1921420a3fb6187ebdc7bf7fa64ddb76ed1537ed
2015-12-04 11:01:48 -06:00
Eric Erhardt 2c3e768b15 Shims should use intptr_t for file descriptors.
Changing all file descriptors used in System.Native to use intptr_t instead of int32_t.  This way we can marshal SafeHandles without having to add DangerousAddRef/Release code.

Fix dotnet/corefx#2904.


Commit migrated from https://github.com/dotnet/corefx/commit/8a5cbc165a696b39b8d9bb48554c09473d4ca6bc
2015-12-02 22:30:06 -06:00
Wes Haggard 11d572df6c Merge pull request dotnet/corefx#4780 from dsgouda/libporting
Created .builds files for building libraries 

Commit migrated from https://github.com/dotnet/corefx/commit/8564df2594e2bcca684103584fd42fc9b44bf46e
2015-12-02 16:01:47 -08:00
Deepak Shankargouda f5284f6fcc Created initial set of .builds files
Commit migrated from https://github.com/dotnet/corefx/commit/a20fd22b1e44d13e437c235a957a47a2af52838d
2015-12-02 14:38:03 -08:00
Pat Gavlin 9c51408169 Minor changes to the Poll() shim.
- Minor cosmetic changes to the Poll() datatypes
- Change the Poll() shim to return an Error instead of an errno.
  The number of triggered file descriptors is now an output
  parameter.
- Fix the implementation of Poll() to handle > 2 poll events.

This change is preparing for a future change that will move
Socket.{Select,Poll} to use `poll` instead of `select`.


Commit migrated from https://github.com/dotnet/corefx/commit/4b789b544cd66315a12ee81a214c5299f295c54c
2015-11-30 16:22:16 -08:00
Eric St. John 65210efd31 Update project.lock.json to latest and lock
Commit migrated from https://github.com/dotnet/corefx/commit/6aeea5eabf2aff3baf15f501cabd156dfc5b3f8f
2015-11-09 22:38:10 -08:00
Eric St. John cddddd29f5 Remove unused dependencies
Commit migrated from https://github.com/dotnet/corefx/commit/78fd45ec74afc507a40df519b4df650ac9bd4c42
2015-11-09 22:37:37 -08:00
Pat Gavlin d83224ad45 Change file casing to fix the build on *nix.
Commit migrated from https://github.com/dotnet/corefx/commit/94bf9ba19922a06640a3d1b1e412fb6cbbc676b5
2015-11-09 14:50:43 -08:00
stephentoub 202815712c Enable building all of corefx with an "unknown" Unix
After all of the shim work that's been done, the vast majority of corefx assemblies now are either platform-agnostic or have a Windows build and a Unix build, without further specialization based on OS in managed code.  We do still have a few such assemblies, though (and this is unlikely to change any time soon):
- System.Diagnostics.Process
- System.IO.FileSystem.Watcher
- System.Net.NetworkInformation
- System.Runtime.InteropServices.RuntimeInformation

As a result, attempting to do a full build for Unix targets other than Linux or OS X currently results in compilation failures. This commit adds a new TargetsUnknownUnix property to the build as well as stub implementations that throw PlatformNotSupportedException for all of the missing functionality that causes such compilation errors.

With this change, doing ```build.cmd /p:SkipTests=true /p:OSGroup=FreeBSD" now completes successfully, as does ```build.cmd /p:SkipTests=true /p:OSGroup=Stephenix```.


Commit migrated from https://github.com/dotnet/corefx/commit/3e9f21b5f32e88925d97b928b9456f4cf8f5a1f5
2015-11-07 10:39:52 -08:00
Jon Miller d5b8abd1cf Moving some less-reliable FSW tests out to OuterLoop
Commit migrated from https://github.com/dotnet/corefx/commit/0da52d55f2ddd61daf95c5378f95a5003066e7b4
2015-10-30 14:21:32 -07:00
Eric St. John 88bb5f032c Raise generation of refs to match min generation of all impl.
Previously generations were strictly calculated.  We had a set
of seed assemblies which defined generation boundaries based
on where they were supported. Eg: System.Runtime 4.0.0.0 was
supported inbox in Net45, 4.0.10.0 was supported inbox in
Net451, we could not OOB 4.0.0.0 to Net451 due to unification
so that defined a generation boundary.

All non-seed assemblies got the maximum generation
of all their transitive dependencies.

This worked fine, but created a confusing picture when
looking at the packages.  New contracts that were only
implemented in DNXCore50 and Net46 had a reference assembly
that claimed to be dotnet5.1 even though they weren't
supported by any framework that was exclusive to 5.1-5.3.
It also meant that targeting a generation required that
someone use guardrails to ensure that they'd actually have
an implementation on any framework targeting that generation.
Without guardrails they might produce an assembly that would
not run on any framework of the generation it claimed.

This change raises the generation of all the reference assemblies
to a minimum that supports any implementation.  This makes it
clear which generation of frameworks support the package,
it also lets someone target that generation without using guardrails
and guarantees that they'll at least run somewhere.

[tfs-changeset: 1543192]


Commit migrated from https://github.com/dotnet/corefx/commit/1c8144920c62e89f77567a16ebfa8c1324e52f07
2015-10-29 11:42:25 -07:00
Eric Erhardt 27bc21d469 Add shims for the rest of the libc native calls.
This removes all direct dependencies from managed code
to native libc functions.

Fix dotnet/corefx#4106


Commit migrated from https://github.com/dotnet/corefx/commit/7077b4d74707b9e07787b5fbc1fbe6a0db202ea9
2015-10-28 09:30:41 -05:00
Eric St. John 8cc3c24b51 Update lock files that were missed in previous restore.
A change was made to DNX to no longer restore project.jsons
that are in nested folders.  This caused my batch update to miss
a number of tests and reference assembly projects.

This fixes the stale lock files, but restore is still broken.

[tfs-changeset: 1540448]


Commit migrated from https://github.com/dotnet/corefx/commit/3622cccc1b22fa1947a72d5126b59864e9d2fd0d
2015-10-21 18:59:09 -07:00
Eric St. John 543808303a Update dnx to v1.0.0-rc1-15838, update dotnet projects to generations
We need a new DNX to understand the latest packages.

We also need to move all "dotnet" projects to use dotnetX.X (generations)
now that the packages no longer have "dotnet" assets.

The new version of DNX dropped support for the aspnetcore
so I needed to update a few projects/packages that depended
on old package versions that had this moniker.

[tfs-changeset: 1540388]


Commit migrated from https://github.com/dotnet/corefx/commit/38f8d7a3ca1ee819c2b8eabb1c07ee4e99683c97
2015-10-21 17:03:48 -07:00
bartonjs a768025131 Update all project.lock.json files
Built Windows_NT, Linux, OSX with /p:LockDependencies=true.

CoreFX beta-* => 23419
xunit.netcore.extensions => 00107


Commit migrated from https://github.com/dotnet/corefx/commit/a14b22705df253508bd5f2dab0407bd2c7e4d639
2015-10-19 16:00:44 -07:00
Eric St. John 8cd3109d56 Switch from using "dotnet" to using "dotnet<generation>"
All projects that previously used dotnet have been updated to specify the appropriate generation of the surface area they depend on or in the case of desktop inbox contracts, the generation that includes the set of platforms they can support.

Now all packages contain all generations of API that they have ever shipped.

In doing this I needed to change how we determine package version.  Before we ensured all assemblies would have the same version and used that.  Now we choose the max.

Additionally I needed to change how we chose which asset to use for netcore50 when the dotnet asset was obscured by a placeholder for a previous netcore release (eg System.Runtime will have placeholders for Win8 since it was inbox there).  To do this I wrote a task that uses nuget to evaluate the package assets with and without the placeholders.  In this way it chooses the "best" dotnet implementation and reference assembly to use for netcore50.

This new model made my old MSBuild-based validation impossible to carry forward, so I wrote better validation in a task that actually uses Nuget's asset resolution algorithm.  This uncovered many existing issues in packages that I have cleaned up.  The validation algorithm could use some polish but its working now.  Perf is not great, package build went from 15s to ~2 minutes.  I'll work on this some more by making it incremental (input: nuspec, output: marker created on success).  Profiling shows that most of the time is spent in calling the nuget APIs.  I'll see if I can reduce some of this with caching for things that don't change (eg: RID graph).  Ultimately I think its a reasonable tradeoff for the types of bugs I can find this way.

[tfs-changeset: 1539216]


Commit migrated from https://github.com/dotnet/corefx/commit/0931c347eb836c9da94d0d5ff9ad7a14403b9738
2015-10-18 21:12:23 -07:00
stephentoub db5ceb3a81 Remove NotImplemented.cs from several projects
A handful of projects are still including NotImplemented.cs even though they no longer need it.


Commit migrated from https://github.com/dotnet/corefx/commit/8b6e00ac6c376e7ec041e84270d518ca523a32a3
2015-10-08 08:50:35 -04:00
Peter Jas a29604278c code: Fixes occurred spelling.
Fixes dotnet/corefx#3661.


Commit migrated from https://github.com/dotnet/corefx/commit/544a3885ff51e04db89b70e3f155be1a5c64f166
2015-10-06 15:27:09 +00:00
stephentoub 613a87d035 Add explicit 0 index args to Array.Copy usage
Array.Copy is implemented to work with any System.Array, not just T[].  When Array.Copy(sourceArr, destArray, length) is used, it delegates to Copy(sourceArr, sourceIndex, destArray, destIndex, length), and as such needs to query for the lower-bound of the supplied arrays, since although a T[] in C# always has a lower-bound of 0, an arbitrary Array may not.  Given this, when calling Array.Copy, instead of calling Array.Copy(src, dest, length), it's slightly more efficient to just call Array.Copy(src, 0, dest, 0, length), avoiding the need for the GetLowerBound calls made while delegating to the 5-arg version.

I noticed one occurrence of this in some code I was looking at, and while fixing that, I fixed all of them across corefx\src.


Commit migrated from https://github.com/dotnet/corefx/commit/979026e435672e611e3f6e0647c873aa96ccc684
2015-10-02 13:56:48 -04:00
Ian Hays 0f8197a86c Update CoreFX to xunit 2.1.0
Commit migrated from https://github.com/dotnet/corefx/commit/87b48c58936d66fcb201b3a8ad0961fa055f23b9
2015-10-01 19:56:49 -07:00
bartonjs a52f41057c Update all CoreFx package references to 23328 build.
`build.cmd /p:LockDependencies=true` was the start of this change, but some errors with xunit build numbers led to all xunit upgrades being reset back to what they had in master.

project.json changes:
* System.Net.Security\src Switch off of explicit beta versioning, use the same baseline as everyone else.  The S.S.C.Algorithms explicit upgrade is no longer required.
* System.Net.Requests\tests didn't build.  Looking at the project.lock.json change, it appeared that a System.Net.Http reference was lost, restored it.
* System.Net.Http\tests didn't build. Looking at the project.lock.json change, it appeared that a System.IO.FileSystem reference was lost, restored it.
* System.Net.WebSockets.Client\src didn't build. Looking at the project.lock.json change, it appeared that a System.Collections (4.0.10) reference was lost, restored it.
* System.Diagnostics.TextWriterTraceListener\tests needed the runtime reference to load the correct System.Diagnostics.TraceSource binary.


Commit migrated from https://github.com/dotnet/corefx/commit/cec3a0f2db542bfa9d9c56bf988d966eacc35ad9
2015-09-29 11:40:37 -07:00
stephentoub df23122fde Fix case sensitivity in FSW Path and Filter tests
Changing to use PathInternal.IsCaseSensitive actually fixed a bug in
FSW.Path/Filter.  The tests were testing for the wrong thing on Linux.
This just fixes the tests.


Commit migrated from https://github.com/dotnet/corefx/commit/b24780dd017f9a6a86fd55531fd9410cab6eef8e
2015-09-22 20:16:17 -04:00
stephentoub 02007d2533 Add platform-agnostic case sensitivity detection
After the recent refactoring based on introducing native shims, the only reason there are special builds of System.IO.FileSystem and System.IO.FileSystem.DriveInfo for each of Linux and OS X is because of PathInternal.CaseSensitive/CaseInsensitive.cs, which just provides a hard-coded value as to whether the target platform is case-sensitive or case-insensitive-but-preserving.  Similarly, these files are the only things forcing System.IO.Compression.ZipFile to not be completely platform-agnostic and to have separate Windows/Unix builds.

This commit recombines those assemblies by adding a platform-agnostic helper that simply creates a temporary file with upper-case letters and then checks whether that file can be found via the lower-cased version.  This isn't perfect, in that it's possible to mount multiple file systems each with different case sensitivities, but a) it's better than the hardcoded version we currently have, and b) I don't know of any better portable solution.

(Issue dotnet/corefx#3156 tracks adding an API to provide information on case sensitivity.  This change can be replaced by using such an API if/when it's available.)


Commit migrated from https://github.com/dotnet/corefx/commit/62ba788d4730be24cff0ff0432f43bcc7b9e4561
2015-09-22 12:35:47 -04:00
Christopher Costa cdfa624a04 XPlat packaging
Converts libraries to use platform specific implementations in packages.

[tfs-changeset: 1526941]


Commit migrated from https://github.com/dotnet/corefx/commit/b27061014ebd18d83031039f31721afa35d4612c
2015-09-20 11:57:30 -07:00
Jonathan Miller fb3803dfe9 Finishing up PAL'ing Unix\libc (non-networking and crypto)
PInvoke calls


Commit migrated from https://github.com/dotnet/corefx/commit/f8fd4b7ff731cd8951e6da0bb70ca206533866bb
2015-09-17 13:05:29 -07:00
Wes Haggard a0d524ea1c Merge pull request dotnet/corefx#3177 from akoeplinger/update-dnx
Update build to use DNX beta7 instead of beta5

Commit migrated from https://github.com/dotnet/corefx/commit/34e8271eae1e8cbda5389f6b152c1f27994ca6c2
2015-09-16 10:34:50 -07:00
Nick Guerrera 23277810e6 Increase native compilation warnings and fix the fallout
We were using -Wall but now use -Weverything and opt out of only
a handful of issues such as C++-98 compat, which we don't need.

The most notable impact is that the compiler now catches
narrowing implicit conversions, which was also the primary
motivation for doing this now as there was known debt in our
unsupervised usage of 64-bit types for sizes.

We now assert on bad buffer sizes *and* retain full checks in
release builds to be completely defensive against overflow.

We now use int32_t for scratch buffer sizes. int64_t remains for
file offsets and uint64_t remains for memory mapped files, but
int32_t for scratch eliminates a bunch of managed casts and
therefore makes it easier to reason about overflow prevention.

INT32_MAX is also the most portable limit on these buffer sizes
because the behavior of functions like read is only implementation
defined when the input size is greater than SSIZE_MAX and ssize_t
is int32_t on the lowest common denominator of modern platforms.

Enums corresponding to platform values are now enum X : T instead
of enum class X : T. The PAL_* names are descriptive enough without
scoping and the implicit conversion to raw integer is actually helpful
to avoid a bunch of casts, which are otherwise needed to interop with
the corresponding native API.


Commit migrated from https://github.com/dotnet/corefx/commit/648c01d69fba8d23750122d9823f53257785c8ca
2015-09-16 09:15:33 -07:00
Alexander Köplinger 3e20a867b2 Update build to use DNX beta7 instead of beta5
The corefx build used an older beta5 version of DNX which hardcoded the path to bash in dnu, breaking the build on FreeBSD.
Updating DNX to the latest "stable" beta7 release fixes this.

After updating I noticed a few test projects didn't build anymore as they were missing some dependencies in project.json, added those.

Fixes dotnet/corefx#3173


Commit migrated from https://github.com/dotnet/corefx/commit/6df77fdbb6cf8e0d35a3074bb325f7810085daa3
2015-09-16 02:12:26 +02:00
stephentoub ecb42af61c Disable two FileSystemWatcher tests failing on OS X
Commit migrated from https://github.com/dotnet/corefx/commit/09c31449e82f89bcbe85bd21662692ba43ed6900
2015-09-12 21:41:30 -04:00
Jonathan Miller 9e25edd8d1 Moving more Unix\libc function calls over to the PAL layer
along with fixing up the Interop calls for the switched
functions.


Commit migrated from https://github.com/dotnet/corefx/commit/aed4a23f36ace07e7f5f33bf5a28808fd215fea6
2015-09-11 14:09:37 -07:00
stephentoub 2dd748811e Address various issues in FileSystemWatcher
- On Linux, FileSystemWatcher is built on top of inotify, which has various limits configured in the system for how many instances and watches can be created.  When these limits are hit, exceptions are generated, but the Linux-provided error messages are cryptic about what the problem is.  This change adds better error messages for those cases.  It also ensures that errors regarding watch limits always come out of OnError rather than sometimes being thrown synchronously from EnableRaisingEvents and other times coming out asynchronously.
- As part of fixing that, I noticed that we had some reliability issues around marking the instance as enabled.  I fixed this up to ensure that we only mark the instance as enabled when we've created everything we need to successfully launch it.
- While doing that, I noticed that on OS X, if we restart an FSW, we were unnecessarily re-creating a delegate.  I changed it to avoid the unnecessary allocation.
- And while doing that, I also noticed that we we had a bad exception message when constructing an FSW with something other than a directory.  I fixed the error message.
- I added tests for all these things.


Commit migrated from https://github.com/dotnet/corefx/commit/57cf111281a22feafb83854789680680da3cab50
2015-09-02 16:51:12 -04:00
Jeremy Kuhne 14c82df521 Change file system APIs. to implicitly add extended syntax when needed for long path support.
Commit migrated from https://github.com/dotnet/corefx/commit/fabe699d38702d401fbb237a2608f3054942a8b5
2015-08-27 14:05:05 -07:00
Nick Guerrera 453f5e9697 Remove unused gnu_get_libc_version P/Invoke declaration
This was previously needed for the logic to switch between GNU
strerror_r and POSIX strerror_r, but that is now addressed by the shims.


Commit migrated from https://github.com/dotnet/corefx/commit/ff96ce829df16f8a0b58f568e9b696fa19e698a8
2015-08-27 08:07:54 -07:00
Eric St. John d7a0ae297b Update corefx packages to latest
Commit migrated from https://github.com/dotnet/corefx/commit/23f0b695bd162e0f665427c95180dc21931e5c70
2015-08-14 15:43:23 -07:00
Eric St. John 77309d4821 Update the version of all assemblies
This change updates the assembly versions of all of the corefx assemblies
as needed after we shipped stable versions.  Assemblies with API differences
get a minor version bump.  Assemblies with only bugfixes get a build version
bump.

In order to facilitate this I had to update the reference assemblies, so I took
the opportunity to port them all to the open.

[tfs-changeset: 1514419]


Commit migrated from https://github.com/dotnet/corefx/commit/40723b795917f2e98b64d45c17effb2546dd0cae
2015-08-13 17:07:57 -07:00
stephentoub d0b4035923 Fix regression in FileSystemWatcher
As part of the bug fix in https://github.com/dotnet/corefx/commit/dotnet/corefx@f2720abb758b50a9debb5ec146939ef6f5cef82d , a regression was introduced, one that we didn't catch until recently due to not having a test that stressed stopping and quickly restarting an FSW doing monitoring.

At the time of that fix, the active asynchronous monitoring operation didn't have its own copy of the directory handle; instead, it just used the single field on the FSW instance.  As such, in a race condition between the asynchronous monitoring operation trying to use that instance and the main thread stopping the FSW and nulling out the field, the asynchronous monitoring operation could experience a NullReferenceException.  The fix was to stop nulling out the field and just rely on closing the handle being enough to signal that monitoring should stop.

However, this causes a problem in a particular race condition.  While a SafeHandle is in use by a P/Invoke operation, its reference count is temporarily incremented so as to prevent it from being closed while in use.  This means that if the directory handle is disposed of while it's being used by ReadDirectoryChangesW, the handle's IsClosed won't return true until after ReadDirectoryChangesW returns.  When the FSW is stopped, Dispose is called on the handle, and then when it's restarted, the handle's IsClosed is checked to see if there's currently an active monitoring operation, and if there is, the FSW assumes it doesn't need to restart anything.  But if the stop and the start both occur during the call to ReadDirectoryChangesW, then the start won't actually start anything.

My reliability/performance fixes in https://github.com/dotnet/corefx/commit/dotnet/corefx@b6c478ccc9729e22ac7b9bf2248b644b51883db2 eliminated the reliance on the shared directory handle field: the asynchronous monitoring operation has its own copy.  Thus, there's no longer a problem in nulling out the directory handle field.  The fix for the regression is simply to do so.

(Long explanation for a fix that's simply to null out a field :-)


Commit migrated from https://github.com/dotnet/corefx/commit/6568da5ad7b4e5d516613f6a80865d5e88d72b31
2015-08-13 10:09:40 -04:00
stephentoub a57990e935 Disable sporadically failing FSW test
Issue dotnet/corefx#2740


Commit migrated from https://github.com/dotnet/corefx/commit/1b2143576e06662f65bc5d870bd5a2845afce198
2015-08-12 13:53:55 -04:00