platform/upstream/coreclr.git
8 years agoMerge pull request #1432 from jkotas/rollback-1421
Jan Kotas [Tue, 25 Aug 2015 00:47:23 +0000 (17:47 -0700)]
Merge pull request #1432 from jkotas/rollback-1421

Re-enable JIT test

8 years agoRe-enable JIT test
Jan Kotas [Tue, 25 Aug 2015 00:06:38 +0000 (17:06 -0700)]
Re-enable JIT test

8 years agoMerge pull request #1431 from dotnet-bot/from-tfs
Jan Kotas [Mon, 24 Aug 2015 19:49:34 +0000 (12:49 -0700)]
Merge pull request #1431 from dotnet-bot/from-tfs

Merge changes from TFS

8 years agoFix bug 1213453 (GitHub issue #1421): incorrect EH scopes for optimized loops
Bruce Forstall [Mon, 24 Aug 2015 18:07:39 +0000 (11:07 -0700)]
Fix bug 1213453 (GitHub issue #1421): incorrect EH scopes for optimized loops

(Port changeset 1518001 from CodeGen)

The bug occurs when fgOptWhileLoop() duplicates a condition from one 'try' region into another, and that condition throws an exception, such as for an array bounds check. This was the test case:

try
{
    Console.WriteLine("try");
}
catch (IndexOutOfRangeException)
{
    Console.WriteLine("bad");
    result = FAIL;
}
while (a[42] != 0) {}

Before the fix, the "a[42] != 0" condition was duplicated into the 'try' region, thus causing an IndexOutOfRange exception to be thrown, and caught in the wrong region.

The main fix is to compare the 'try' region of the region where the condition exists and the region we intend to copy it to. The other changes, in optimizer.cpp and flowgraph.cpp, are "defense in depth" -- to be more careful with EH checks in two very similar optimizations.

This bug existed in AMD64 and ARM32.

There are 2 functions with ARM32 asm diffs.

There are 70 functions with AMD64 SuperAsm diffs.

There are many cases where we prohibit the optimization that caused the bug. There are a few cases where we don't do the optimization but could have if we were more careful about checking for precise EH conditions that are allowed, namely, that branching to the first block of a 'try' region is ok.

[tfs-changeset: 1518014]

8 years agoMerge pull request #1230 from jasonwilliams200OK/master
Aditya Mandaleeka [Sat, 22 Aug 2015 19:27:29 +0000 (12:27 -0700)]
Merge pull request #1230 from jasonwilliams200OK/master

docs: Fixes link in docgen and config knobs

8 years agoMerge pull request #1423 from mikem8361/gcroot
Mike McLaughlin [Sat, 22 Aug 2015 08:00:11 +0000 (01:00 -0700)]
Merge pull request #1423 from mikem8361/gcroot

Enable gcroot and other gc related sos commands.

8 years agoEnable gcroot and other gc related sos commands.
Mike McLaughlin [Fri, 14 Aug 2015 01:36:31 +0000 (18:36 -0700)]
Enable gcroot and other gc related sos commands.

The "gcroot" command currently doesn't work with lldb 3.6 (our default package), but
works fine with lldb 3.7.0.

lldb 3.6 terminates with
(lldb) sos GCRoot 00007fffcc004ce8
*** Error in `lldb-3.6': munmap_chunk(): invalid pointer: 0x000000000184cde8 ***

PAL_STDCPP_COMPAT is the define that the VS team added to allow the xplat
headers to be used. This is neccessary for the whole SOS directory now
because gcroot and other gc commands need unorderd_map, unorderd_set, etc.
from the stdlib.

Had to change all wchar_t to WCHAR because the xplat stdlib default is UTF32.

Had to rename and provide macros that conflict with the stdlib:

wcslen -> _wcslen
wcsncmp -> _wcsncmp
wcsrchr -> _wcsrchr
wcscmp -> _wcscmp
wcschr -> _wcschr
wcscspn -> _wcscspn
wcscat -> _wcscat

__in -> ___in
__out -> ___out

max(a, b) -> _max(a, b)
min(a, b) -> _min(a, b)

Had to ifdef PAL_STDCPP_COMPAT a lot more of pal.h, palrt.h and some other header files.

Changed a bunch of  L"" to W("").

8 years agoMerge pull request #1424 from andschwa/tpa-assertion
Jan Kotas [Fri, 21 Aug 2015 23:57:18 +0000 (16:57 -0700)]
Merge pull request #1424 from andschwa/tpa-assertion

Remove Binder assertion for BindByWhereRef

8 years agoRemove Binder assertion for BindByWhereRef
Andrew Schwartzmeyer [Fri, 21 Aug 2015 22:51:23 +0000 (15:51 -0700)]
Remove Binder assertion for BindByWhereRef

Some use cases of CoreCLR require overriding the assembly load context,
triggering this assertion. However, this override does not necessarily
break support of BindByWhereRef, and so it should be attempted on a
best-effort basis, instead of bailing out prematurely.

8 years agoMerge pull request #1422 from jgalar/master
Jan Kotas [Fri, 21 Aug 2015 22:54:49 +0000 (15:54 -0700)]
Merge pull request #1422 from jgalar/master

LTTng supports hardware context

8 years agoLTTng supports hardware context
Jérémie Galarneau [Fri, 21 Aug 2015 21:17:27 +0000 (17:17 -0400)]
LTTng supports hardware context

LTTng supports the annotation of events with perf hardware counters via the use of the "add-context" command.

8 years agoMerge pull request #1416 from jkotas/vs2015-autodetect
Jan Kotas [Fri, 21 Aug 2015 04:18:57 +0000 (21:18 -0700)]
Merge pull request #1416 from jkotas/vs2015-autodetect

Auto-detect VS2015

8 years agoDisable test failing on VS2015
Jan Kotas [Fri, 21 Aug 2015 03:36:28 +0000 (20:36 -0700)]
Disable test failing on VS2015

Failure tracked by #1421 RyuJIT generates incorrect exception handling scopes for IL generated by Roslyn

8 years agoUse volatile stores for values read by DAC
Jan Kotas [Thu, 20 Aug 2015 06:50:32 +0000 (23:50 -0700)]
Use volatile stores for values read by DAC

VS2015 optimizer is smart enough to optimize out stores into globals that are only read by the DAC.

8 years agoTurn on C# optimizations on two large tests
Jan Kotas [Thu, 20 Aug 2015 06:48:50 +0000 (23:48 -0700)]
Turn on C# optimizations on two large tests

The debug IL generated by Roslyn is too complex and causes the test to fail with stack overflow.

8 years agoAuto-detect VS2015
Jan Kotas [Thu, 20 Aug 2015 04:12:40 +0000 (21:12 -0700)]
Auto-detect VS2015

Change build and tests scripts to detect VS2015 and use that if available by default

8 years agoMerge pull request #1413 from jkotas/atypical-callsite
Jan Kotas [Fri, 21 Aug 2015 02:30:11 +0000 (19:30 -0700)]
Merge pull request #1413 from jkotas/atypical-callsite

Add CORINFO_CALLINFO_ATYPICAL_CALLSITE flag to JIT-EE interface

8 years agoMerge pull request #1418 from ytechie/patch-1
Jan Kotas [Thu, 20 Aug 2015 15:20:11 +0000 (08:20 -0700)]
Merge pull request #1418 from ytechie/patch-1

Fixed stray character typo

8 years agoFixed stray character typo
Jason Young [Thu, 20 Aug 2015 14:43:46 +0000 (09:43 -0500)]
Fixed stray character typo

8 years agoComplete support for atypical callsites
Jan Kotas [Thu, 20 Aug 2015 05:48:01 +0000 (22:48 -0700)]
Complete support for atypical callsites

8 years agoMerge pull request #1415 from jkotas/acceptable-time-error
Jan Kotas [Wed, 19 Aug 2015 23:27:19 +0000 (16:27 -0700)]
Merge pull request #1415 from jkotas/acceptable-time-error

Fix timing in more PAL tests for FreeBSD on hypervisors

8 years agoMerge pull request #1410 from jkotas/vs2015-buildtools
Jan Kotas [Wed, 19 Aug 2015 23:21:37 +0000 (16:21 -0700)]
Merge pull request #1410 from jkotas/vs2015-buildtools

Update buildtools version to fix VS2015 build

8 years agoFix timing in more PAL tests for FreeBSD on hypervisors
Jan Kotas [Wed, 19 Aug 2015 17:28:14 +0000 (10:28 -0700)]
Fix timing in more PAL tests for FreeBSD on hypervisors

8 years agoRename ResolveNuGetPackageAssets to PrereleaseResolveNuGetPackageAssets
Jan Kotas [Tue, 11 Aug 2015 15:18:32 +0000 (08:18 -0700)]
Rename ResolveNuGetPackageAssets to PrereleaseResolveNuGetPackageAssets

8 years agoUpdate buildtools version to 00079
Jan Kotas [Tue, 11 Aug 2015 15:02:54 +0000 (08:02 -0700)]
Update buildtools version to 00079

Required by VS2015

8 years agoMerge pull request #1395 from ktos/patch-1
Matt Ellis [Wed, 19 Aug 2015 05:18:12 +0000 (22:18 -0700)]
Merge pull request #1395 from ktos/patch-1

Updated to new syntax of dnx run

8 years agoMerge pull request #1412 from nguerrera/remove-old-corefxpal
Nick Guerrera [Wed, 19 Aug 2015 03:26:16 +0000 (20:26 -0700)]
Merge pull request #1412 from nguerrera/remove-old-corefxpal

Remove PAL code that has been moved to the corefx repo

8 years agoAdd CORINFO_CALLINFO_ATYPICAL_CALLSITE flag to JIT-EE interface
Jan Kotas [Wed, 19 Aug 2015 00:51:38 +0000 (17:51 -0700)]
Add CORINFO_CALLINFO_ATYPICAL_CALLSITE flag to JIT-EE interface

CORINFO_CALLINFO_ATYPICAL_CALLSITE is meant to be used in situations where the code generator cannot guarantee that the callsite can be disassembled by delay load helper (e.g. it is not  call [rel32] on x86/x64)

8 years agoRemove PAL code that has been moved to the corefx repo
Nick Guerrera [Tue, 18 Aug 2015 23:09:19 +0000 (16:09 -0700)]
Remove PAL code that has been moved to the corefx repo

8 years agoMerge pull request #1397 from eerhardt/master
Eric Erhardt [Tue, 18 Aug 2015 22:46:55 +0000 (15:46 -0700)]
Merge pull request #1397 from eerhardt/master

Handle newer tzfiles by allowing for the "big bang" transition.

8 years agoMerge pull request #1409 from eerhardt/Fix2821
Eric Erhardt [Tue, 18 Aug 2015 22:28:07 +0000 (15:28 -0700)]
Merge pull request #1409 from eerhardt/Fix2821

TimeZoneInfo is finding the wrong AdjustmentRule on Windows.

8 years agoHandle newer tzfiles by allowing for the "big bang" transition.
Eric Erhardt [Fri, 14 Aug 2015 21:23:39 +0000 (16:23 -0500)]
Handle newer tzfiles by allowing for the "big bang" transition.

In the TZ release 2014c, a new "big bang" transition time was added
to the beginning of the tzfiles. This broke the TimeZoneInfo parsing
logic because the transition time was for 13 billion years ago, which
is unrepresentable by DateTime.

To handle these new transitions, check for times really far in the past and future, and use DateTime.Min/Max to represent them.  Then skip over any DateTime.MinValue times when generating the AdjustmentRules.

Fix https://github.com/dotnet/corefx/issues/2816.

8 years agoTimeZoneInfo is finding the wrong AdjustmentRule on Windows.
Eric Erhardt [Tue, 18 Aug 2015 20:00:51 +0000 (13:00 -0700)]
TimeZoneInfo is finding the wrong AdjustmentRule on Windows.

TimeZoneInfo.IsAdjustmentRuleValid is no longer using the "dateOnly/whole-date" portion on Windows to check for the correct AdjustmentRule.  This causes problems when converting times and determining if a time is daylight savings or not.

Fix https://github.com/dotnet/corefx/issues/2821

8 years agoUpdated to new syntax of dnx run and references to beta7
Marcin Badurowicz [Fri, 14 Aug 2015 20:20:42 +0000 (22:20 +0200)]
Updated to new syntax of dnx run and references to beta7

Extended PR#1393 to every documentation file as @jasonwilliams200OK noticed in
comments to bc1ba75. Changed documentation as well to reference more current,
beta7 versions.

Relevant annoucement is https://github.com/aspnet/Announcements/issues/52.

8 years agoMerge pull request #1405 from ellismg/build-mscorlib-on-linux
Stephen Toub [Tue, 18 Aug 2015 11:40:24 +0000 (07:40 -0400)]
Merge pull request #1405 from ellismg/build-mscorlib-on-linux

Build mscorlib on linux

8 years agoBuild mscolrib.dll on Unix
Matt Ellis [Tue, 11 Aug 2015 05:36:57 +0000 (22:36 -0700)]
Build mscolrib.dll on Unix

Initial work to get mscorlib.dll building via Roslyn + MSBuild running
on top of Mono on Linux.

- Use a newer version of BclRewriter.exe which works cross-platform,
  the major difference here is that now we need to specify the input
  assembly as a named argument instead (since fully qualified paths on
  Unix look like flags on Windows).

- The ResGen we use comes from Mono, which does not support the -d
  flag, so we need to stop passing defines to ResGen. I know the mono
  folks recently did some work to address this, but long term we need
  to move towards getting our ResGen.exe running on CoreCLR and use
  that instead.

- Don't require that mono is installed in order to build coreclr.  If
  mono is not on the path, skip the build step to enable folks to do
  development without Mono. In this case, they will need to continue
  to build mscorlib.dll on Windows, targeting Unix.

- Mono stability has been an issue for folks that have buddy tested
  this. I've found that recent mono 4.2 builds, when run with the
  Boehm GC work well for me. Other folks have other builds they like
  instead. The `skipmscorlib` flag can be passed to build.sh if you
  want to skip building mscorlib.dll locally.

8 years agoRemove unused resource string
Matt Ellis [Mon, 10 Aug 2015 23:45:38 +0000 (16:45 -0700)]
Remove unused resource string

StackTrace_Stack was conditional between Unix and Windows, which is
problematic when building on Unix, since the Mono provided ResGen does
not understand our define directives. It turns out this string is
unused (in both CoreCLR and Desktop) so to make things easier, we can
just remove it.

8 years agoMerge pull request #1403 from nguerrera/revert-getfileinfo
Nick Guerrera [Mon, 17 Aug 2015 23:55:05 +0000 (16:55 -0700)]
Merge pull request #1403 from nguerrera/revert-getfileinfo

Remove GetFileInformation stat wrapper from PAL

8 years agoRemove GetFileInformation stat wrapper from PAL
Nick Guerrera [Mon, 17 Aug 2015 04:54:49 +0000 (21:54 -0700)]
Remove GetFileInformation stat wrapper from PAL

It has been replaced by stat shims in corefx System.Native.

Reverts commits:
79ebe5605a94d559d2996997aec3cbcf8a4504c3.
0119283384f1bac80da8bb1736453c87d4f8e689.

8 years agoMerge pull request #1391 from AlexGhiondea/fixProject
Stephen Toub [Sun, 16 Aug 2015 12:19:09 +0000 (08:19 -0400)]
Merge pull request #1391 from AlexGhiondea/fixProject

Remove incorrect msbuild logic for creating relative paths

8 years agoMerge pull request #1399 from dotnet-bot/from-tfs
Stephen Toub [Sun, 16 Aug 2015 12:18:11 +0000 (08:18 -0400)]
Merge pull request #1399 from dotnet-bot/from-tfs

Merge changes from TFS

8 years agodocs: Fixes link in docgen and config knobs.
Peter Jas [Sat, 11 Jul 2015 18:58:34 +0000 (18:58 +0000)]
docs: Fixes link in docgen and config knobs.

8 years agoThe newly introduced method PopulateAllSystemTimeZones was copied from a method that...
Alex Ghiondea [Sat, 15 Aug 2015 05:17:29 +0000 (22:17 -0700)]
The newly introduced method PopulateAllSystemTimeZones was copied from a method that had the SecuritySafeCritical attribute but it does not have the attribute itself.

This change adds the attribute to the new method.

[tfs-changeset: 1514941]

8 years agoMerge pull request #1398 from dotnet-bot/from-tfs
Aditya Mandaleeka [Sat, 15 Aug 2015 02:15:16 +0000 (19:15 -0700)]
Merge pull request #1398 from dotnet-bot/from-tfs

Merge changes from TFS

8 years agoMerge pull request #1394 from dotnet-bot/from-tfs
Aditya Mandaleeka [Fri, 14 Aug 2015 23:52:07 +0000 (16:52 -0700)]
Merge pull request #1394 from dotnet-bot/from-tfs

Merge changes from TFS

8 years agoMerge pull request #1378 from eerhardt/master
Eric Erhardt [Fri, 14 Aug 2015 22:36:08 +0000 (17:36 -0500)]
Merge pull request #1378 from eerhardt/master

Make use of TimeZoneInfo.CachedData on Linux.

8 years agoMore xplat binplace clean-up.
Joel Hendrix [Fri, 14 Aug 2015 21:37:25 +0000 (14:37 -0700)]
More xplat binplace clean-up.
Fixed up proj files for CLR and FxCore partitions.
Moved xplat build to phase one coreclr builds.

[tfs-changeset: 1514852]

8 years agoMake use of TimeZoneInfo.CachedData on Linux.
Eric Erhardt [Tue, 11 Aug 2015 22:19:55 +0000 (17:19 -0500)]
Make use of TimeZoneInfo.CachedData on Linux.

Fix https://github.com/dotnet/corefx/issues/2497.

8 years agoConsolidate enabling of xplat binary downloads into GetXPlatBinaries.targets.
Joel Hendrix [Fri, 14 Aug 2015 18:39:35 +0000 (11:39 -0700)]
Consolidate enabling of xplat binary downloads into GetXPlatBinaries.targets.
Disable xplat build for SSV builds.

[tfs-changeset: 1514806]

8 years agoMerge pull request #1393 from ktos/patch-1
Aditya Mandaleeka [Fri, 14 Aug 2015 18:35:36 +0000 (11:35 -0700)]
Merge pull request #1393 from ktos/patch-1

Updated to new syntax of dnx run

8 years agoMerge pull request #1390 from AlexGhiondea/fix_1386
AlexGhiondea [Fri, 14 Aug 2015 18:31:17 +0000 (11:31 -0700)]
Merge pull request #1390 from AlexGhiondea/fix_1386

Rebuild the resource file when the input file changes

8 years agoMerge pull request #1392 from hackcraft/typo_retrive_retrieve
Aditya Mandaleeka [Fri, 14 Aug 2015 18:20:53 +0000 (11:20 -0700)]
Merge pull request #1392 from hackcraft/typo_retrive_retrieve

Fix typo "retrive" and "retrieved" to "retrieve" and "retrieved"

8 years agoUpdated to new syntax of dnx run
Marcin Badurowicz [Fri, 14 Aug 2015 17:50:35 +0000 (19:50 +0200)]
Updated to new syntax of dnx run

Syntax for running application changed from `dnx . run` into `dnx run` so last step in docs is always resulting in exception `System.InvalidOperationException: Unable to load application or execute command '.'.` thrown by dnx.

8 years agoFix typo "retrive" and "retrieved" to "retrieve" and "retrieved"
Jon Hanna [Fri, 14 Aug 2015 17:28:00 +0000 (18:28 +0100)]
Fix typo "retrive" and "retrieved" to "retrieve" and "retrieved"

Mostly just in comments, test case and trace text, but the exception
thrown if you try to GetInterfaceMap on an array type has it in
the description.

8 years agoMerge pull request #1388 from ellismg/add-skip-mscorlib-to-build-sh
Matt Mitchell [Fri, 14 Aug 2015 15:45:22 +0000 (08:45 -0700)]
Merge pull request #1388 from ellismg/add-skip-mscorlib-to-build-sh

Add skipmscorlib option to build.sh

8 years agoRemove incorrect msbuild logic for creating relative paths
Alex Ghiondea [Fri, 14 Aug 2015 06:42:08 +0000 (23:42 -0700)]
Remove incorrect msbuild logic for creating relative paths

The logic was using Link to try and show mscorlib sources show up in VS.
Turns out the logic was both incorrect and not needed.

8 years agoRebuild the resource file when the input file changes
Alex Ghiondea [Fri, 14 Aug 2015 06:34:18 +0000 (23:34 -0700)]
Rebuild the resource file when the input file changes

When building mscorlib resources we are not taking into account the file
that contains the resource strings when deciding if we need to rebuild the
resources file.

Becasue of this, adding/modifying a resource string will not show up in the
build resource file until you delete the intermediate folder.

8 years agoMerge pull request #1387 from stephentoub/named_primitives
Jan Kotas [Fri, 14 Aug 2015 02:03:13 +0000 (19:03 -0700)]
Merge pull request #1387 from stephentoub/named_primitives

Throw PlatformNotSupported for named sync primitives on Unix

8 years agoMerge pull request #1385 from dotnet-bot/from-tfs
Matt Ellis [Fri, 14 Aug 2015 00:21:56 +0000 (17:21 -0700)]
Merge pull request #1385 from dotnet-bot/from-tfs

Merge changes from TFS

8 years agoAdd skipmscorlib option to build.sh
Matt Ellis [Thu, 13 Aug 2015 21:29:00 +0000 (14:29 -0700)]
Add skipmscorlib option to build.sh

In perperation for supporting mscorlib.dll builds on *NIX, provide a
switch for the CI system to disable building mscorlib as part of the
build, since we pick up the cross compiled Linux version and our mono
seems to crash often in CI.

Once this is checked in we can start having the CI jobs pass this
switch without causing an error, then have a future commit which
enables mscorlib building key off it.

8 years agoThrow PlatformNotSupported for named sync primitives on Unix
stephentoub [Thu, 13 Aug 2015 23:28:17 +0000 (19:28 -0400)]
Throw PlatformNotSupported for named sync primitives on Unix

libcoreclr's synchronization primitives implementation currently supports names, but those names have process-wide rather than system-wide scope.  This is very dangerous for most code that would want names, as they're typically used for cross-process synchronization, and as such the current behavior could lead to bad race conditions difficult to diagnose.  Until a better solution is available, we will throw PlatformNotSupportedException when trying to create such named primitives.

8 years agoThere was a testcase failing (Interop\WinRT\Exception\ManagedClientNativeServer\Excep...
Bryan Arant [Thu, 13 Aug 2015 20:21:22 +0000 (13:21 -0700)]
There was a testcase failing (Interop\WinRT\Exception\ManagedClientNativeServer\ExceptionTest.csproj).

The test checks that the HResult 0x8000000e maps to a System.InvalidOperationException.

What was happening: We returned a System.COMException with the message "A method was called at an unexpected time." (we're just constructing an exception based on an HR message).

What should be happening: We return a System.InvalidOperationException (i.e. we check against the exceptionKind maps for a specific HResult to map to an exception).

The point of failure is in the creation of the EEMessageException. When calling GetKindFromHR(...) we were inverting the boolean that uses the WinRT mappings.

Removing that inversion allows us to check the WinRT Exception Maps for exceptions. When I made this change, we correctly return the correct Exception.

Test coverage: I ran a full DDR, and the whole TOF (both against my build and against the newest build). All passed successfully (i.e. no additional failures).

[tfs-changeset: 1514327]

8 years agoMerge pull request #1384 from janvorli/fix-gc-during-exception-handling
Jan Vorlicek [Thu, 13 Aug 2015 19:13:48 +0000 (21:13 +0200)]
Merge pull request #1384 from janvorli/fix-gc-during-exception-handling

Fix GC issues during exception handling on Unix

8 years agoFix a section number in table of contents.
Aditya Mandaleeka [Thu, 13 Aug 2015 19:05:15 +0000 (12:05 -0700)]
Fix a section number in table of contents.

The "Primitive Types" link pointed to 2.9 rather than 2.9.1.

8 years agoMerge pull request #1137 from hadibrais/patch-1
Aditya Mandaleeka [Thu, 13 Aug 2015 19:00:53 +0000 (12:00 -0700)]
Merge pull request #1137 from hadibrais/patch-1

Add Table of Contents to clr-code-guide.md

8 years agoMerge pull request #1383 from dotnet-bot/from-tfs
Jan Kotas [Thu, 13 Aug 2015 14:44:08 +0000 (07:44 -0700)]
Merge pull request #1383 from dotnet-bot/from-tfs

Merge changes from TFS

8 years agoFix GC issues during exception handling on Unix
Jan Vorlicek [Thu, 13 Aug 2015 10:27:31 +0000 (12:27 +0200)]
Fix GC issues during exception handling on Unix

This change fixes two issues that happens in some cases when GC scans stack of
a thread that is handling exception at that moment.

First issue was caused by the fact that the stack walker wasn't modified to
take into account the difference in exception handling on Unix. When an exception
is thrown from a catch handler or finally block (a funclet )on Unix, part of the stack
is unwound immediatelly, while on Windows, the stack is not reclaimed until
the exception is fully handled.
The problem was caused by the fact that when GC happens in the funclet before the exception
is processed, but after a point where GC knows that the lifetime of locals in the caller frame
is over, it doesn't update the references in the caller frame for objects that it has relocated.
On Windows, this is detected just from walking the stack, since the funclet frame is still there
and the stack walker can then skip scanning the parent frame GC references.
On Linux, the funclet is not on stack anymore, so this case was not detected and GC attempted to
scan the stale references and crashed.
The fix was to detect that a frame was a caller to a funclet from the chain of previous exception
trackers that is fortunately preserved and the trackers hold the necessary information.

The second issue was more subtle. During interleaved exception handling, when we unwind a native
portion of the stack and switch back to unwinding a managed block of stack frames, we re-create
the exception tracker and carry over just a few members necessary to continue processing the
same exception. The way it was done was that we have first removed the current tracker from
the list of trackers of the current thread, then we have destroyed it, created a new one and
put it back to the front of the list.
The issue happened when GC started walking the stack of the thread in the small time slot when
the current tracker was removed from the list, but the re-created tracker was not added there yet.
Then the detection necessary for handling the previous issue didn't work and we got a crash.
The fix was to make the whole re-creation of the exception tracker atomic w.r.t. the GC.

8 years agoMerge pull request #1382 from dotnet-bot/from-tfs
Jan Kotas [Thu, 13 Aug 2015 02:44:29 +0000 (19:44 -0700)]
Merge pull request #1382 from dotnet-bot/from-tfs

Merge changes from TFS

8 years agoWe are incorrectly stripping away the Identity method from the EnumHelper type when...
Alex Ghiondea [Thu, 13 Aug 2015 00:41:15 +0000 (17:41 -0700)]
We are incorrectly stripping away the Identity method from the EnumHelper type when building mscorlib.

[tfs-changeset: 1513902]

8 years agoMerge pull request #1380 from dotnet-bot/from-tfs
Aditya Mandaleeka [Wed, 12 Aug 2015 23:53:30 +0000 (16:53 -0700)]
Merge pull request #1380 from dotnet-bot/from-tfs

Merge changes from TFS

8 years agoBuild Toolbox\BinaryRewriting as part of the PK product group
Matt Ellis [Wed, 12 Aug 2015 23:11:43 +0000 (16:11 -0700)]
Build Toolbox\BinaryRewriting as part of the PK product group

We need this so we can get a signed build of BclRewriter.exe which is only produced by the offical build out of the ProjectK branch.

[tfs-changeset: 1513878]

8 years agoPort the DateTime parser fix from the Desktop
Tarek Mahmoud Sayed [Wed, 12 Aug 2015 19:50:14 +0000 (12:50 -0700)]
Port the DateTime parser fix from the Desktop

This change is fixing the DateTime parser in cases of date/time strings for cultures which has the date and time separators are same. This happen with Norway, Serbia and Finland cultures

[tfs-changeset: 1513801]

8 years agoMerge pull request #1329 from AndreyAkinshin/master
Matt Mitchell [Wed, 12 Aug 2015 15:34:31 +0000 (08:34 -0700)]
Merge pull request #1329 from AndreyAkinshin/master

Fix a bug with disappeared cast to byte in numeric binary expressions

8 years agoFix a bug with disappeared cast to byte in numeric binary expressions
Andrey Akinshin [Mon, 3 Aug 2015 13:33:26 +0000 (16:33 +0300)]
Fix a bug with disappeared cast to byte in numeric binary expressions

Lowering::IndirsAreEquivalent doesn't check if the 2 indirections have the same type and because of that a RMW style instruction is generated instead of the expected

movzx    rax, byte  ptr [7FFA61024742h]
xor      eax, 33
mov      word  ptr [7FFA61024742h], ax

This behavior was fixed by adding an additional check to IndirsAreEquivalent (implementation of the mikedn's approach: https://github.com/dotnet/coreclr/pull/1329#discussion_r36397171).

Fix #1323.

8 years agoMerge pull request #1372 from eerhardt/master
Eric Erhardt [Tue, 11 Aug 2015 23:45:31 +0000 (18:45 -0500)]
Merge pull request #1372 from eerhardt/master

Implement TimeZoneInfo.GetSystemTimeZones() on Linux

8 years agoImplement TimeZoneInfo.GetSystemTimeZones() on Linux
Eric Erhardt [Fri, 7 Aug 2015 22:39:40 +0000 (17:39 -0500)]
Implement TimeZoneInfo.GetSystemTimeZones() on Linux

Implementing GetSystemTimeZones on Linux by reading
the zone.tab file on the machine, parsing out the
valid TimeZone IDs from it, and using those Ids to read
all the time zones on the machine.

8 years agoMerge pull request #1377 from jkotas/timer
Jan Kotas [Tue, 11 Aug 2015 19:07:06 +0000 (12:07 -0700)]
Merge pull request #1377 from jkotas/timer

Delete unused System.Threading.Timer.dll dependencies

8 years agoDelete unused System.Threading.Timer.dll dependencies
Jan Kotas [Tue, 11 Aug 2015 18:27:11 +0000 (11:27 -0700)]
Delete unused System.Threading.Timer.dll dependencies

8 years agoMerge pull request #1375 from jkotas/vs2015-fixes
Jan Kotas [Tue, 11 Aug 2015 13:15:11 +0000 (06:15 -0700)]
Merge pull request #1375 from jkotas/vs2015-fixes

Assorted fixes for VS2015 build breaks

8 years agoDisable debug info generation for test with very large method
Jan Kotas [Tue, 11 Aug 2015 05:40:58 +0000 (22:40 -0700)]
Disable debug info generation for test with very large method

Roslyn is hitting out of memory exception caused by internal PDB writer limitations (dotnet/roslyn/issues/3915)

8 years agoFix VS2015 test build breaks
Jan Kotas [Tue, 11 Aug 2015 04:15:17 +0000 (21:15 -0700)]
Fix VS2015 test build breaks

8 years agoFix Windows SDK path for VS2015
Jan Kotas [Tue, 11 Aug 2015 03:22:35 +0000 (20:22 -0700)]
Fix Windows SDK path for VS2015

8 years agoFix path to test build log
Jan Kotas [Tue, 11 Aug 2015 03:14:16 +0000 (20:14 -0700)]
Fix path to test build log

8 years agoMerge pull request #1352 from eerhardt/master
Eric Erhardt [Mon, 10 Aug 2015 21:55:26 +0000 (16:55 -0500)]
Merge pull request #1352 from eerhardt/master

TimeZoneInfo parse v2 tzfile and create AdjustmentRules

8 years agoTimeZoneInfo parse v2 tzfile and create AdjustmentRules
Eric Erhardt [Mon, 3 Aug 2015 20:43:40 +0000 (15:43 -0500)]
TimeZoneInfo parse v2 tzfile and create AdjustmentRules

TimeZoneInfo on Linux needs to parse V2 tzfile information and
correctly create AdjustmentRule instances based on the tzfile
information.

To create AdjustmentRules correctly, I introduced a new flag on
AdjustmentRule - NoDaylightTransitions, which means the adjustment
is fixed for the whole time the rule is in effect.  This allows
us to create an AdjustmentRule for each time the offset changed
in a time zone (whether the change was for Daylight Savings or
for some other reason).  I also needed to relax the rule that
DateStart and DateEnd needed to be DateTimeKind.Unspecified.
Instead, when we create NoDaylightTransitions adjustment rules
in Linux, we use DateStart and DateEnd to be UTC times the offset
transitioned.

Fix #2465.

8 years agoMerge pull request #1370 from dotnet-bot/from-tfs
Jan Kotas [Mon, 10 Aug 2015 18:21:09 +0000 (11:21 -0700)]
Merge pull request #1370 from dotnet-bot/from-tfs

Merge changes from TFS

8 years agoImplement /disassemble nidump option for readytorun images
Jan Kotas [Mon, 10 Aug 2015 17:02:28 +0000 (10:02 -0700)]
Implement /disassemble nidump option for readytorun images

[tfs-changeset: 1512604]

8 years agoMerge pull request #1369 from dotnet-bot/from-tfs
Jan Kotas [Mon, 10 Aug 2015 16:32:20 +0000 (09:32 -0700)]
Merge pull request #1369 from dotnet-bot/from-tfs

Merge changes from TFS

8 years agoFix build break on desktop
Jan Kotas [Mon, 10 Aug 2015 15:39:00 +0000 (08:39 -0700)]
Fix build break on desktop

[tfs-changeset: 1512590]

8 years agoMerge pull request #1366 from sokket/timers
Jan Kotas [Sat, 8 Aug 2015 07:33:17 +0000 (00:33 -0700)]
Merge pull request #1366 from sokket/timers

Removing old System.Threading.Timer tests and moving to CoreFX

8 years agoRemoving old System.Threading.Timer tests with the corresponding
Jonathan Miller [Sat, 8 Aug 2015 00:50:24 +0000 (17:50 -0700)]
Removing old System.Threading.Timer tests with the corresponding
move to CoreFX via CoreFX PR 2681

8 years agoMerge pull request #1362 from mikem8361/exports1
Jan Kotas [Fri, 7 Aug 2015 23:48:45 +0000 (16:48 -0700)]
Merge pull request #1362 from mikem8361/exports1

Add GetCurrentThreadId to the Linux/Unix exports from coreclr.

8 years agoMerge pull request #1365 from dotnet-bot/from-tfs
Jan Kotas [Fri, 7 Aug 2015 23:39:04 +0000 (16:39 -0700)]
Merge pull request #1365 from dotnet-bot/from-tfs

Merge changes from TFS

8 years agoMerge pull request #1363 from mmitche/fix-opensuse
Matt Mitchell [Fri, 7 Aug 2015 23:27:22 +0000 (16:27 -0700)]
Merge pull request #1363 from mmitche/fix-opensuse

Remove llvm-ranlib dependency

8 years agoFix BPMD SOS command for ReadyToRun
Jan Kotas [Fri, 7 Aug 2015 23:26:26 +0000 (16:26 -0700)]
Fix BPMD SOS command for ReadyToRun

DAC was not getting notified about new method code

[tfs-changeset: 1512178]

8 years agoRemove llvm-ranlib dependency
Matt Mitchell [Fri, 7 Aug 2015 21:50:34 +0000 (14:50 -0700)]
Remove llvm-ranlib dependency

Appears to be unused, and not available on openSUSE.

8 years agoAdd GetCurrentThreadId to the Linux/Unix exports from coreclr.
Mike McLaughlin [Fri, 7 Aug 2015 21:43:27 +0000 (14:43 -0700)]
Add GetCurrentThreadId to the Linux/Unix exports from coreclr.

8 years agoMerge pull request #1324 from kouvel/kouvel-SetSignalCountAssertFix-1318
Koundinya Veluri [Fri, 7 Aug 2015 20:30:02 +0000 (13:30 -0700)]
Merge pull request #1324 from kouvel/kouvel-SetSignalCountAssertFix-1318

Fix PAL signal count upper limit issues.

8 years agoFix PAL signal count upper limit issues.
Koundinya Veluri [Fri, 31 Jul 2015 09:20:50 +0000 (02:20 -0700)]
Fix PAL signal count upper limit issues.

- Fix assert in SetSignalCount to allow int32 max as a valid value.
- Change ISynchStateController signal count functions to use LONG
  instead of DWORD to match the storage type for consistency.
- In ReleaseSemaphoreInternal, handle overflow of (oldCount +
  releaseCount) to return failure. Updated PAL semaphore tests to catch
  this case.

Fix #1318

8 years agoMerge pull request #1254 from James-Ko/patch-1
Jan Kotas [Fri, 7 Aug 2015 06:06:45 +0000 (23:06 -0700)]
Merge pull request #1254 from James-Ko/patch-1

mscorlib: Use Array.Empty where possible