platform/upstream/coreclr.git
5 years agoMake the new stream class sealed
Jan Vorlicek [Thu, 28 Feb 2019 19:59:34 +0000 (20:59 +0100)]
Make the new stream class sealed

5 years agoFix resource stream for collectible assemblies
Jan Vorlicek [Thu, 28 Feb 2019 19:06:57 +0000 (20:06 +0100)]
Fix resource stream for collectible assemblies

The GetManifestResourceStream was returning a stream that didn't keep
the underlying assembly alive. For collectible assemblies, that means
that an assembly could be collected and the stream still kept,
potentially reading garbage.

The fix is to create a new stream type that stores a reference to the
underlying assembly, thus ensuring the proper lifetime management.

5 years agoFix Thread.ExecutionContext breaking change (#22882)
Stephen Toub [Wed, 27 Feb 2019 18:16:11 +0000 (13:16 -0500)]
Fix Thread.ExecutionContext breaking change (#22882)

Its getter is a public API and can't be made internal.

5 years agoFix WaitTimeout breaking change (#22881)
Stephen Toub [Wed, 27 Feb 2019 17:40:06 +0000 (12:40 -0500)]
Fix WaitTimeout breaking change (#22881)

WaitHandle.WaitTimeout is a public API.  It can't be made internal.

5 years ago[master] Update dependencies from dotnet/core-setup (#22854)
dotnet-maestro[bot] [Wed, 27 Feb 2019 17:17:03 +0000 (09:17 -0800)]
[master] Update dependencies from dotnet/core-setup (#22854)

* Update dependencies from https://github.com/dotnet/core-setup build 20190227.1

This change updates the following dependencies
- Microsoft.NETCore.App - 3.0.0-preview4-27427-1

5 years agoRemove BuildTestsAgainstPackages logic
Russ Keldorph [Tue, 26 Feb 2019 19:02:53 +0000 (11:02 -0800)]
Remove BuildTestsAgainstPackages logic

No longer necessary without PipeBuild logic

5 years agoAdd blob feed to dependencies.props (#22857)
Jeremy Koritzinsky [Wed, 27 Feb 2019 06:59:33 +0000 (22:59 -0800)]
Add blob feed to dependencies.props (#22857)

5 years agoPreserve Marshal.GetLastWin32Error in SafeHandle.DangerousRelease (#22871)
Jan Kotas [Wed, 27 Feb 2019 06:51:21 +0000 (22:51 -0800)]
Preserve Marshal.GetLastWin32Error in SafeHandle.DangerousRelease (#22871)

5 years agoMove Thread to shared CoreLib (#22744)
Filip Navara [Wed, 27 Feb 2019 06:48:33 +0000 (07:48 +0100)]
Move Thread to shared CoreLib (#22744)

* Move Thread to shared CoreLib

* Remove all local variables from Thread in shared code

* Remove duplicate checks

* Port back CoreRT changes needed for shared code

* Fix missing culture initialization in ThreadStart()

* Adjust for shared WaitHandle

5 years agoMake BitOperations public (CoreCLR) (#22864)
Grant [Wed, 27 Feb 2019 05:04:37 +0000 (21:04 -0800)]
Make BitOperations public (CoreCLR) (#22864)

* Make BitOps public

* Update name to BitOperations

* Change namespace to System.Numerics

* Fix file name

* Alphabetical

5 years agoRemove bogus assert in Thread::MarkThreadForAbort (#22869)
Andrew Au [Wed, 27 Feb 2019 04:39:30 +0000 (20:39 -0800)]
Remove bogus assert in Thread::MarkThreadForAbort (#22869)

5 years agoUpdate EventCounter spec (#22852)
Noah Falk [Wed, 27 Feb 2019 03:32:34 +0000 (19:32 -0800)]
Update EventCounter spec (#22852)

* Update EventCounter spec

We made a flurry of decisions in our meeting last wednesday.
Partly this fills in areas of the design we didn't adequately decide on and
partly this suggests a few changes after having had time to think on it.

1) My suggestion to use IntervalSec as an identifier for a series doesn't
work. I proposed a new field 'Series' that is used for that same purpose.

2) I am proposing we no longer standardize on the five-tuple of stats.
Although it made sense to me at the time, decisions we made later in the
meeting invalidated the basis for that choice IMO.

3) Aggregating seems like an overly generic name that all counters do, so
I propose 'Incrementing' as a more specific term.

4) I am proposing we stop accepting fractional time intervals because
probably nobody would have used them anyways and now we don't have to worry
about floating point rounding and canonicalization issues when determining
if two clients share the same time series or in round tripping the identifier
back to them.

5) I defined specific fields for 'DisplayName' and 'CounterType' in our
wire protocol. Although not opposed to a generic metadata field for other
purposes, it seemed unnecessary for our current purposes.

6) I switched Incrementing coutner to float, because it it
would be a shame if we had to make a whole new counter in the future
that did exactly the same thing just with floating point values. For example
'GC Seconds Paused'

5 years agoFix `optVNConstantPropOnTree`. (#22865)
Sergey Andreenko [Wed, 27 Feb 2019 00:58:37 +0000 (16:58 -0800)]
Fix `optVNConstantPropOnTree`. (#22865)

It should use the same VN that `optVNConstantPropOnTree` uses.

Without this fix `optVNConstantPropOnTree` was doing nothing.

5 years agoFix Assembly::Load context for collectible assemblies (#22494)
Jan Vorlicek [Tue, 26 Feb 2019 22:46:00 +0000 (23:46 +0100)]
Fix Assembly::Load context for collectible assemblies (#22494)

* Fix Assembly::Load context for collectible assemblies

This change fixes a problem when Assembly::Load is called from an
assembly in a collectible AssemblyLoadContext. In that case, we ended up
loading it into the default context instead of the context of the
calling assembly.

5 years agoFix _IlasmDir definition (#22856)
Eric StJohn [Tue, 26 Feb 2019 22:16:55 +0000 (14:16 -0800)]
Fix _IlasmDir definition (#22856)

5 years agoJIT: In morph, only call DefinesLocal on assignments (#22753)
Andy Ayers [Tue, 26 Feb 2019 19:39:46 +0000 (11:39 -0800)]
JIT: In morph, only call DefinesLocal on assignments (#22753)

When checking for local assertions to kill in morph, only call `DefinesLocal` on `GT_ASG` nodes.

Also, assert that we never see LIR style assignments.

Resolves #22747.

5 years agoMerge pull request #22841 from josalem/stacktrace-cache-unloading-20179-prechange
John Salem [Tue, 26 Feb 2019 18:11:11 +0000 (10:11 -0800)]
Merge pull request #22841 from josalem/stacktrace-cache-unloading-20179-prechange

Adds collection of `Assembly` objects while walking the stack in `DebugStackTrace::GetStackFrameInternal`
* new field in `StackFrameHelper` in both managed and native (plus mscorlib macro definition)
* retrieved via `methodDesc->GetAssembly()->GetDomainAssembly()->GetExposedAssemblyObject()`

Calls `GetSourceLineInfo` with delegate signature that *does not* consume an `Assembly`.  As a result, this there will be a follow up change to call the updated version after it exists in CoreFX.

#20179

5 years agoUpdate added types and methoddefs on ApplyMetadata (#22617)
David Mason [Tue, 26 Feb 2019 16:56:45 +0000 (08:56 -0800)]
Update added types and methoddefs on ApplyMetadata (#22617)

5 years agoGCC compatibility fixes #7 (#22810)
Sinan Kaya [Tue, 26 Feb 2019 10:55:05 +0000 (05:55 -0500)]
GCC compatibility fixes #7 (#22810)

* Use thread_local for thread local storage on non MSVC targets

* Use local copy of visitor rather than function parameter

* Remove extra class qualifier

* Replace hex number representation in ASM files

* Reorder STDAPI and DLLEXPORT

* Suppress conversion

Suppress warning during hash

add casting

* Remove anonymous struct

src/vm/codeversion.h:112:16: warning: ‘struct NativeCodeVersion::<anonymous union>::SyntheticStorage’ invalid; an anonymous union can only have non-static data members [-fpermissive]
         struct SyntheticStorage

* Remove class declaration

Remove extra class declaration

* Remove extern C

* Add implicit paranthesis

src/vm/amd64/virtualcallstubcpu.hpp:735:103: warning: suggest parentheses around ‘-’ in operand of ‘&’ [-Wparentheses]
     resolveInit.toMiss1                = offsetof(ResolveStub,miss)-(offsetof(ResolveStub,toMiss1)+1) & 0xFF;
                                                                                                       ^
src/vm/amd64/virtualcallstubcpu.hpp:741:103: warning: suggest parentheses around ‘-’ in operand of ‘&’ [-Wparentheses]
     resolveInit.toMiss2                = offsetof(ResolveStub,miss)-(offsetof(ResolveStub,toMiss2)+1) & 0xFF;

Add parenthesis

src/vm/dataimage.cpp:631:55: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
                  previousRvaInfo->rva == rvaInfo->rva && previousRvaInfo->size >= rvaInfo->size

Add parenthesis

src/debug/daccess/daccess.cpp:6871:29: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
     _ASSERTE(peFile == NULL && reflectionModule != NULL || peFile != NULL && reflectionModule == NULL);

Add parenthesis

src/vm/dataimage.cpp:631:57: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
                  (previousRvaInfo->rva == rvaInfo->rva) && (previousRvaInfo->size >= rvaInfo->size)

* Initialize member 1

src/ilasm/method.cpp:35:36: warning: operation on ‘((Method*)this)->Method::m_ulColumns[0]’ may be undefined [-Wsequence-point]
     m_ulColumns[0]=m_ulColumns[0]=0;

* Remove unknown compiler option

* Abstract DLLEXPORT

5 years agoSpec for EventCounter changes (#22811)
Noah Falk [Tue, 26 Feb 2019 08:17:02 +0000 (00:17 -0800)]
Spec for EventCounter changes (#22811)

5 years agoAdd the coreclr blob feed as a restore source for test builds. (#22839)
Jeremy Koritzinsky [Tue, 26 Feb 2019 07:54:21 +0000 (23:54 -0800)]
Add the coreclr blob feed as a restore source for test builds. (#22839)

* Add the coreclr blob feed as a restore source for test builds.
* Use one NuGet.config in the root folder for restore targets.

5 years agoSpecial-case 1 module per assembly in Assembly.GetTypes/DefinedTypes (#22825)
Stephen Toub [Tue, 26 Feb 2019 03:17:19 +0000 (22:17 -0500)]
Special-case 1 module per assembly in Assembly.GetTypes/DefinedTypes (#22825)

It's very common for an assembly to have only one module, in which case we can avoid unnecessary allocations and copies in Assembly.GetTypes() and Assembly.DefinedTypes.

5 years agoRemove buildpipelines (#22835)
Steve MacLean [Tue, 26 Feb 2019 01:57:44 +0000 (20:57 -0500)]
Remove buildpipelines (#22835)

* Remove old buildpipeline

* Remove obsolete publish-packages

* Remove obsolete helix scripts

5 years agoAdd platforms template parameter to platform-matrix.yml (#22800)
Egor Chesakov [Tue, 26 Feb 2019 00:41:40 +0000 (16:41 -0800)]
Add platforms template parameter to platform-matrix.yml (#22800)

5 years agoFor linux-musl-arm64 use OutputRid (#22840)
Jarret Shook [Mon, 25 Feb 2019 23:50:59 +0000 (15:50 -0800)]
For linux-musl-arm64 use OutputRid (#22840)

This variable was added for linux-musl-x64 in our old official builds,
because our current logic in src/.nuget/dirs.props incorrectly parses
the __DistroRid passed.

5 years agoFix and re-enable some finalizer tests (#22771)
Andy Ayers [Mon, 25 Feb 2019 23:50:03 +0000 (15:50 -0800)]
Fix and re-enable some finalizer tests (#22771)

Mark key allocating methods noinline, otherwise they may get inlined
under jit stress and leave jit temps referring to allocations that the test
expects should be collectible.

Resolves #19218.

5 years agoRemove support for ICLRExecutionManager and pause/resume code for waits (#22834)
Filip Navara [Mon, 25 Feb 2019 23:38:54 +0000 (00:38 +0100)]
Remove support for ICLRExecutionManager and pause/resume code for waits (#22834)

5 years agoSimplify getting exposed Assembly, and specifies parameter types for GetSourceLineInfo
John Salem [Mon, 25 Feb 2019 22:53:16 +0000 (14:53 -0800)]
Simplify getting exposed Assembly, and specifies parameter types for GetSourceLineInfo

5 years ago[master] Update dependencies from dotnet/core-setup (#22819)
dotnet-maestro[bot] [Mon, 25 Feb 2019 22:34:36 +0000 (14:34 -0800)]
[master] Update dependencies from dotnet/core-setup (#22819)

* Update dependencies from https://github.com/dotnet/core-setup build 20190223.3

This change updates the following dependencies
- Microsoft.NETCore.App - 3.0.0-preview4-27423-3

* Update dependencies from https://github.com/dotnet/core-setup build 20190224.2

This change updates the following dependencies
- Microsoft.NETCore.App - 3.0.0-preview4-27424-2

5 years agoMove WaitHandle to shared CoreLib (#22634)
Filip Navara [Mon, 25 Feb 2019 17:28:46 +0000 (18:28 +0100)]
Move WaitHandle to shared CoreLib (#22634)

* Move part of WaitHandle to shared CoreLib

* Bring back OpenExistingResult to fix build

* Move reminder of WaitHandle to shared, implement SynchronizationContext logic in managed code, handle SafeHandle referencing in managed code

* Update with changes neeeded for CoreRT

* Span -> ReadOnlySpan

* Remove dead code

* Fix SafeHandle error handling

* Avoid double check on input values in WaitHandle.WaitOne overloads

* Make OpenExistingResult private protected instead of internal

* Make WaitHandle._waitHandle private

* Code style fixes

* Remove unnecessary GC.KeepAlive

* Move ERROR_TOO_MANY_POSTS exception handling to CoreCLR specific code

* Add cache for wait arrays to match previous CoreRT behavior and reduce GC pressure, change unmanaged code to allocate small array on stack

* Address PR feedback

* Reduce allocations/copying by moving stack allocation to managed code

* Address PR feedback

* Minor code reshuffle

* Move thread local access close to each other

* Address code style feedback

* Add const to Wait* constants

5 years agoMerge pull request #22796 from ericstj/splitILAsmCopy
Eric StJohn [Mon, 25 Feb 2019 17:19:01 +0000 (09:19 -0800)]
Merge pull request #22796 from ericstj/splitILAsmCopy

Split out copy of Ilasm and make it optional

5 years agoRemoved erroneous use of 'PROCESSOR_ARCHITECTURE' Enviroment variable (#22743)
John [Sat, 23 Feb 2019 17:08:00 +0000 (17:08 +0000)]
Removed erroneous use of 'PROCESSOR_ARCHITECTURE' Enviroment variable (#22743)

Removed erroneous use of 'PROCESSOR_ARCHITECTURE' Enviroment variable

Changed all uses of 'Enviroment.GetEnviromentVariable("PROCESSOR_ARCHITECTURE")'
to usage of 'System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture'
and 'enum System.Runtime.InteropServices.Architecture'.

Fix #22694

5 years agofix BSWAP16 intrinsic handling of signed values (#22666)
Clinton Ingram [Sat, 23 Feb 2019 17:06:16 +0000 (09:06 -0800)]
fix BSWAP16 intrinsic handling of signed values (#22666)

5 years agoMove AssemblyLoadContext to shared partition (#22685)
Marek Safar [Sat, 23 Feb 2019 10:06:32 +0000 (11:06 +0100)]
Move AssemblyLoadContext to shared partition (#22685)

* Move AssemblyLoadContext to shared partition

* Move static initializer to DefaultAssemblyLoadContext

and remove stream copying from lock scope

5 years agoMake System.Runtime.CompilerServices.Unsafe inbox (dotnet/corefx#35526)
Eric StJohn [Sat, 23 Feb 2019 02:20:16 +0000 (18:20 -0800)]
Make System.Runtime.CompilerServices.Unsafe inbox (dotnet/corefx#35526)

* Make System.Runtime.CompilerServices.Unsafe inbox

Fix a couple places where we wanted to use it from other inbox assemblies but couldn't.

Unsafe remains as a package and newer versions of Unsafe will replace the inbox Version,
permitting us to add API over time.

* Update Rune tests to use TryEncodeToUtf8Bytes directly

* Add temporary suppression to package tests

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
5 years agoAdding a missing single-quote (#22809)
Tanner Gooding [Sat, 23 Feb 2019 03:11:32 +0000 (19:11 -0800)]
Adding a missing single-quote (#22809)

5 years agoRemove 'from HRESULT' (#22782)
Dan Moseley [Sat, 23 Feb 2019 02:57:02 +0000 (18:57 -0800)]
Remove 'from HRESULT' (#22782)

5 years agoChange Environment.Version to return product version (#22664)
Jan Kotas [Sat, 23 Feb 2019 01:56:02 +0000 (17:56 -0800)]
Change Environment.Version to return product version (#22664)

* Change Environment.Version to return product version

- Contributes to https://github.com/dotnet/corefx/issues/31099
- Use AssemblyInformationalVersion attribute as fallback

* Add sanity test for Environment.Version

* Disable CodeDom tests

* Fix test assembly name

5 years agoCorrectly build packages for linux-musl-arm64 (#22793)
Jarret Shook [Sat, 23 Feb 2019 00:01:03 +0000 (16:01 -0800)]
Correctly build packages for linux-musl-arm64 (#22793)

* Correctly build packages for linux-musl-arm64

Also add build-package step to PR.

* Correctly add back if

* Fix build-packages

5 years agoEnable FEATURE_BASICFREEZE (#22776)
Mukul Sabharwal [Fri, 22 Feb 2019 23:56:28 +0000 (15:56 -0800)]
Enable FEATURE_BASICFREEZE (#22776)

5 years agoRestore original delegate use until corresponding corefx changes have gone through
John Salem [Fri, 22 Feb 2019 23:36:23 +0000 (15:36 -0800)]
Restore original delegate use until corresponding corefx changes have gone through

5 years agoMirror StackFrameHelperChanges in mscorlib.h and change allocation type to more gener...
John Salem [Fri, 22 Feb 2019 22:29:10 +0000 (14:29 -0800)]
Mirror StackFrameHelperChanges in mscorlib.h and change allocation type to more generic g_pObjectClass

5 years agoAdd fatal error details printing (#22789)
Jan Vorlicek [Fri, 22 Feb 2019 22:11:14 +0000 (23:11 +0100)]
Add fatal error details printing (#22789)

Before this change, we were only printing details on fatal errors with
error code COR_E_FAILFAST. For other error codes we were just silently
exiting.
This change enables printing fatal error details for all kinds of fatal
errors.

5 years agoUpdate CoreFX Windows Arm32 exclusion list. (#22695)
Sergey Andreenko [Fri, 22 Feb 2019 21:38:50 +0000 (13:38 -0800)]
Update CoreFX Windows Arm32 exclusion list. (#22695)

* Update CoreFX Windows Arm32 exclusion list.

* Exclude System.Globalization.Calendars.Tests.

* Disable System.Net.Sockets.Tests

5 years agoSplit out copy of Ilasm and make it optional
Eric St. John [Fri, 22 Feb 2019 21:09:31 +0000 (13:09 -0800)]
Split out copy of Ilasm and make it optional

Allow for a repository to provide its own copy of ILAsm rather than restoring & copying it its own location.

To use, set the ILAsmToolPath proerty to the directory containing ilasm, similar to CscToolPath.

I noticed that these targets left behind the ILAsm files in temp for each project every time it
built when ToolsDir wasn't defined, so I've fixed that by instead copying to obj.

5 years agoIgnore EINVAL/EBADF errors from FTruncate in FileStream.Init (#22788)
Stephen Toub [Fri, 22 Feb 2019 21:15:31 +0000 (16:15 -0500)]
Ignore EINVAL/EBADF errors from FTruncate in FileStream.Init (#22788)

They indicate we're working with a special file, where failure to truncate is not a fatal condition.

5 years agoDisable IJW tests on Windows 7. (#22779)
Jeremy Koritzinsky [Fri, 22 Feb 2019 20:39:56 +0000 (12:39 -0800)]
Disable IJW tests on Windows 7. (#22779)

Windows 7 loads desktop mscoree.dll when loading System.Private.CoreLib, before we can load our fake mscoree. So, when IJW modules are loaded, they load the real mscoree.dll, which breaks coreclr's IJW loading. Once we have true .NET Core IJW support in the MSVC++ compiler and .NET Core, then we'll be able to reenable these tests on Win7.

Fixes #21796.

cc: @RussKeldorph @echesakovMSFT

5 years agoR2RDump - Gracefully handle inability to parse GC Info
Simon Nattress [Thu, 21 Feb 2019 21:37:50 +0000 (13:37 -0800)]
R2RDump - Gracefully handle inability to parse GC Info

The Amd64 GC Info parser is not complete in its implementation and
sometimes will index to a location beyond the size of the image.

If we fail to parse the GC info for a method, continue dumping the rest
of the image.

Emit a warning when this happens so we don't forget about this.

5 years agoMore GNUC Fixes (#22687)
Sinan Kaya [Fri, 22 Feb 2019 19:11:19 +0000 (14:11 -0500)]
More GNUC Fixes (#22687)

* Replace __sync_swap with __atomic_exchange_n

__sync_swap() is a clang specific function.

* Remove multiline comment

* Add paranthesis around sum

src/md/hotdata/../inc/streamutil.h:73:34: warning: suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses]
     UINT32 aligned = *totalBytes + 3 & ~3;

* Define __int64

* Define windows types for tests

* Remove undefined has_builtin defines and define alloca and inline for GNUC

* Remove __clang__ where possible

* Add implicit casting to help compiler find WCHAR* variant

src/binder/assembly.cpp:294:73: error: no matching function for call to ‘SString::SString(SString)’
         return (pAsmName == nullptr ? nullptr : pAsmName->GetSimpleName());
                                                                         ^
In file included from src/inc/sstring.h:1082:0,
                 from src/inc/ex.h:19,
                 from src/inc/stgpool.h:28,
                 from src/inc/../md/inc/metamodel.h:18,
                 from src/inc/../md/inc/metamodelro.h:19,
                 from src/inc/metadata.h:17,
                 from src/binder/../vm/util.hpp:19,
                 from src/binder/../vm/common.h:110,
                 from src/binder/assembly.cpp:14:
src/inc/sstring.inl:73:8: note: candidate: SString::SString(void*, COUNT_T)
 inline SString::SString(void *buffer, COUNT_T size)
        ^
src/inc/sstring.inl:73:8: note:   candidate expects 2 arguments, 1 provided
src/inc/sstring.inl:436:8: note: candidate: SString::SString(SString::tagLiteral, const WCHAR*, COUNT_T)
 inline SString::SString(tagLiteral dummytag, const WCHAR *literal, COUNT_T count)
        ^
src/inc/sstring.inl:436:8: note:   candidate expects 3 arguments, 1 provided
src/inc/sstring.inl:418:8: note: candidate: SString::SString(SString::tagLiteral, const WCHAR*)
 inline SString::SString(tagLiteral dummytag, const WCHAR *literal)
        ^
src/inc/sstring.inl:418:8: note:   candidate expects 2 arguments, 1 provided
src/inc/sstring.inl:401:8: note: candidate: SString::SString(SString::tagUTF8Literal, const UTF8*)
 inline SString::SString(tagUTF8Literal dummytag, const UTF8 *literal)
        ^
src/inc/sstring.inl:401:8: note:   candidate expects 2 arguments, 1 provided
src/inc/sstring.inl:382:8: note: candidate: SString::SString(SString::tagLiteral, const CHAR*)
 inline SString::SString(tagLiteral dummytag, const ASCII *literal)

* Reorder DLLEXPORT and STDAPI

GNUC wants extern "C" <attribute> format.

* Abstract __FUNCSIG__

* Abstract __debugbreak()

* Move common compiler options out of clang and add Wno-unused-value

* Add paranthesis around || and &&

src/gc/gc.cpp:9084:38: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
                     (!chosen_power2) && (i < free_space_count));

* Set Wno-delete-non-virtual-dtor for CXX files only

* Don't warn on unterminated endif labels

* Suppress unused functions

* Use 0x syntax rather than h syntax on GNU asm files

* Correct constructor call directly

src/ToolBox/superpmi/superpmi-shared/logging.cpp:301:27:   required from here
src/inc/clr_std/string:58:9: error: cannot call constructor ‘std::basic_string<char>::basic_string’ directly
         this->basic_string::basic_string(_Ptr, c_len(_Ptr));

* Suppress NULL used in arithmetic warnings

5 years agoDisable tests that fail to build under 3.0.0-preview3 (#22774)
Jarret Shook [Fri, 22 Feb 2019 17:32:38 +0000 (09:32 -0800)]
Disable tests that fail to build under 3.0.0-preview3 (#22774)

5 years agoExclude /Interop/COM/NETClients/Events/NETClientEvent for arm32 Windows. (#22785)
Sergey Andreenko [Fri, 22 Feb 2019 17:27:21 +0000 (09:27 -0800)]
Exclude /Interop/COM/NETClients/Events/NETClientEvent for arm32 Windows. (#22785)

5 years agoStore information about partial ngen in R2R images (#22680)
Michal Strehovský [Fri, 22 Feb 2019 14:44:01 +0000 (15:44 +0100)]
Store information about partial ngen in R2R images (#22680)

5 years agoUpdate ReJIT/MethodDescBackpatchInfoTracker lock relationship (#22741)
David Mason [Fri, 22 Feb 2019 07:59:54 +0000 (23:59 -0800)]
Update ReJIT/MethodDescBackpatchInfoTracker lock relationship (#22741)

5 years agoDelete unused FEATURE flags (#22781)
Jan Kotas [Fri, 22 Feb 2019 06:33:31 +0000 (22:33 -0800)]
Delete unused FEATURE flags (#22781)

5 years agoFix CoreFX build break. (#22773)
Sergey Andreenko [Fri, 22 Feb 2019 05:50:06 +0000 (21:50 -0800)]
Fix CoreFX build break. (#22773)

* Fix CoreFX build break.

Introduced by https://github.com/dotnet/corefx/pull/34385.

5 years agoCleanup unnecessary COUNTER_ONLY (#22759)
Jan Kotas [Fri, 22 Feb 2019 02:16:16 +0000 (18:16 -0800)]
Cleanup unnecessary COUNTER_ONLY (#22759)

5 years agoAdd exception counter (#22734)
Sung Yoon Whang [Fri, 22 Feb 2019 01:48:48 +0000 (17:48 -0800)]
Add exception counter (#22734)

* Add exception counter

* Fix build

* Make FCall return UINT32

* Move GetExceptionCount to Exception

* more PR comments, fix x86 build

* Remove global variable initialization

5 years agoCorrect __CrossBuild in build-packages to be 0 or 1 (#22769)
Jarret Shook [Fri, 22 Feb 2019 00:29:59 +0000 (16:29 -0800)]
Correct __CrossBuild in build-packages to be 0 or 1 (#22769)

5 years agoMerge pull request #22731 from briansull/issue-22436
Brian Sullivan [Thu, 21 Feb 2019 23:37:55 +0000 (15:37 -0800)]
Merge pull request #22731 from briansull/issue-22436

Fix Issue 22436 - noway_assert  'expTyp == cseLclVarTyp' in optcse.cpp

5 years agoDo not use portablebuild=false for linux-musl (#22760)
Jarret Shook [Thu, 21 Feb 2019 22:41:40 +0000 (14:41 -0800)]
Do not use portablebuild=false for linux-musl (#22760)

5 years ago[XUnit] Use ParallelRun==Collections on all platforms. (#22746)
Sergey Andreenko [Thu, 21 Feb 2019 22:38:42 +0000 (14:38 -0800)]
[XUnit] Use ParallelRun==Collections on all platforms. (#22746)

* Use ParallelRun==Collections on all platforms.

* Fix formatting

5 years agoRemove unused perfcounter code (#22742)
Sung Yoon Whang [Thu, 21 Feb 2019 22:19:27 +0000 (14:19 -0800)]
Remove unused perfcounter code (#22742)

* removing references to COUNTER_ONLY, ENABLE_PERF_COUNTERS in src/vm directory

* removing perfcounters* files

* Fix build

* Remove PerfCounterSupportedBuild

* Some more cleanup on the GC side

5 years ago[Unix|*] Rework and share the logic for determining __DistroRid (#22628)
Jarret Shook [Thu, 21 Feb 2019 21:16:33 +0000 (13:16 -0800)]
[Unix|*] Rework and share the logic for determining __DistroRid (#22628)

* [Unix|*] Rework and share the logic for determining __DistroRid

This will consolidate all of our different functions which determine
the __DistroRid into one file. In addition, it will remove the unused
__HostDistroRid file.

Lastly, it corrects the rid choice when crossbuilding musl-arm64 as the
cross-rootfs non-portable build will correctly be picked up.

* Fix typo and use __BuildArch in place of __Arch

* Correct non-portable build decision

* Add error for missing redhat-release

* Fix redhat comparison

* Correct previous rhel or

* Fix cross scenerio

* Fix missed $

* Set __RuntimeId for runtest.proj

* Correct naming convention of file

* Address feedback and support -portablebuild=0

With this change:

1. build.sh and build-test.sh should build portable by default.
2. init-distro-rid.sh checks __PortableBuild=1. If so, then it must force rhel 6 and freebsd to __PortableBuild=0 and use the non-portable build
    - For __PortableBuild=0 init-distro-rid.sh sets the non-portable rid correctly to "${ID}.${VERSION_ID}-${buildArch}"

* Correct arguments

* Fix if to include then

* A few more changes to correct linux-musl-arm64

* Add error for non-cross build and correctly pass ROOTFS_DIR

* Correctly exit instead of echo

* Correct isCrossBuild and use rootfsDir only

* Add documentation

* Address feedback

* Rework rhel if

5 years agoincreasing LocalGC version to 3 for 3.0 (#22751)
Maoni Stephens [Thu, 21 Feb 2019 19:54:27 +0000 (11:54 -0800)]
increasing LocalGC version to 3 for 3.0 (#22751)

5 years agoClean up unused parameters around Assembly::Load (#22716)
Marek Safar [Thu, 21 Feb 2019 18:54:17 +0000 (19:54 +0100)]
Clean up unused parameters around Assembly::Load (#22716)

5 years agoMispelling
Brian Sullivan [Thu, 21 Feb 2019 17:53:40 +0000 (09:53 -0800)]
Mispelling

5 years agoSupport COM events (#22721)
Aaron Robinson [Thu, 21 Feb 2019 17:51:10 +0000 (09:51 -0800)]
Support COM events (#22721)

* Add support for COM events
* Add COM Event tests

5 years agoAdded enclosing brances for if/then stmts
Brian Sullivan [Thu, 21 Feb 2019 17:29:07 +0000 (09:29 -0800)]
Added enclosing brances for if/then stmts

5 years agoJIT: handle preference miss two register xmm return case (#22733)
Andy Ayers [Thu, 21 Feb 2019 16:25:52 +0000 (08:25 -0800)]
JIT: handle preference miss two register xmm return case (#22733)

Fix a bug in codegen when returning a Vector3 result where the target
register is not one of the two return registers.

Re-enable the associated test.

Closes #22401.

5 years agoAdd VS debugging info to our instructions
Noah Falk [Thu, 21 Feb 2019 12:10:41 +0000 (04:10 -0800)]
Add VS debugging info to our instructions

5 years agoEnable the HWIntrinsic extension methods and remove the instance implementations...
Tanner Gooding [Thu, 21 Feb 2019 11:09:40 +0000 (03:09 -0800)]
Enable the HWIntrinsic extension methods and remove the instance implementations (#22705)

* Removing various S.R.I.Vector instance method APIs, since they should now be exposed as extension methods

* Updating the JIT to recognize the S.R.I.Vector extension methods.

* Updating various S.R.I.Vector test templates

* Regenerating the S.R.I tests that are created from a template.

* Fixing the numArgs for Base_Vector256_GetLower

* Fixing the handling for `Base_VectorXXX_As` to normalize the struct type.

* Adding the Base_Vector128_As intrinsics back for arm64

5 years agoMove Thread to shared CoreLib (dotnet/corefx#35462)
Filip Navara [Thu, 21 Feb 2019 02:23:41 +0000 (03:23 +0100)]
Move Thread to shared CoreLib (dotnet/corefx#35462)

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
5 years agoReduce struct copy by 1 in ValueTask.GetAwaiter (#22738)
Ben Adams [Thu, 21 Feb 2019 07:26:06 +0000 (07:26 +0000)]
Reduce struct copy by 1 in ValueTask.GetAwaiter (#22738)

* Reduce struct copy by 1 in ValueTask.GetAwaiter

* Bit more explicit

5 years agoRemoved some dead code
Andrew Au [Wed, 20 Feb 2019 04:39:26 +0000 (20:39 -0800)]
Removed some dead code

5 years agoFix Isuue 22436 - noway_assert 'expTyp == cseLclVarTyp' in optcse.cpp
Brian Sullivan [Thu, 21 Feb 2019 00:26:38 +0000 (16:26 -0800)]
Fix Isuue 22436 - noway_assert  'expTyp == cseLclVarTyp' in optcse.cpp
We now allow TYP_BYREF to be compatible with TYP_I_IMPL when performing CSE substitutions.
Re-enable the failing BestFitMapping interop tests

5 years agoRemove accidentally added Windows.10.Nano.Amd64 from Windows_x86 in platform-matrix...
Egor Chesakov [Wed, 20 Feb 2019 22:43:35 +0000 (14:43 -0800)]
Remove accidentally added Windows.10.Nano.Amd64 from Windows_x86 in platform-matrix.yml (#22723)

5 years agoAdd CoreCLR blobfeed to NuGet.config (#22699)
Juan Hoyos [Wed, 20 Feb 2019 21:23:37 +0000 (13:23 -0800)]
Add CoreCLR blobfeed to NuGet.config (#22699)

CoreCLR packages are not found for versions created after #21947 split the feeds and we stopped publishing to MyGet. This adds the new CoreCLR feed.

5 years agoFix dblarray tests and reenable for arm32 (#22718)
Andy Ayers [Wed, 20 Feb 2019 20:39:02 +0000 (12:39 -0800)]
Fix dblarray tests and reenable for arm32 (#22718)

Run the allocate/gen-check sequence under a forbid GC region, and enable the
tests for arm32.

Closes #22015.

5 years agoFix GC Hole by using SetAt on the PTRARRAY for the Assembly objects
John Salem [Wed, 20 Feb 2019 20:22:24 +0000 (12:22 -0800)]
Fix GC Hole by using SetAt on the PTRARRAY for the Assembly objects

5 years agoUse ThrowHelper in ManualResetValueTaskSourceCore (#22714)
Stephen Toub [Wed, 20 Feb 2019 19:36:56 +0000 (14:36 -0500)]
Use ThrowHelper in ManualResetValueTaskSourceCore (#22714)

Just move the helper being used to ThrowHelper.

5 years agoUse Build.DefinitionName for Creator when submitting tests to Helix (#22692)
Egor Chesakov [Wed, 20 Feb 2019 19:35:58 +0000 (11:35 -0800)]
Use Build.DefinitionName for Creator when submitting tests to Helix (#22692)

5 years agoFix tizen rootfs building (#22715)
Konstantin Baladurin [Wed, 20 Feb 2019 19:13:35 +0000 (22:13 +0300)]
Fix tizen rootfs building (#22715)

Move tizen-release package from base to unified repo

5 years agoFix bug introduced during cleanup in JapaneseLunisolarCalendar (#22717)
Stephen Toub [Wed, 20 Feb 2019 18:34:32 +0000 (13:34 -0500)]
Fix bug introduced during cleanup in JapaneseLunisolarCalendar (#22717)

5 years agoAllow Task.WaitAny completion to run synchronously (#21245)
Ben Adams [Wed, 20 Feb 2019 18:32:40 +0000 (18:32 +0000)]
Allow Task.WaitAny completion to run synchronously (#21245)

5 years agoAbstract deprecated and selectany for GCC and remove LLVM'ism where possible (#22662)
Sinan Kaya [Wed, 20 Feb 2019 16:59:22 +0000 (11:59 -0500)]
Abstract deprecated and selectany for GCC and remove LLVM'ism where possible (#22662)

* Abstract selectany

* Fix initializer element is not constant

src/corefx/System.Globalization.Native/pal_icushim.c:58:34: error: initializer element is not constant
 static const int MaxICUVersion = MinICUVersion + 20;

* Enable ms extensions

* Apply LLVM patterns to GCC

* Remove deprecated function

* Fix const conversion error

src/corefx/System.Globalization.Native/pal_calendarData.c:390:16: warning: passing argument 1 of ‘ures_close_ptr’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
ures_close(erasResBundle);

src/corefx/System.Globalization.Native/pal_calendarData.c:419:22: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
char* name = GetCalendarName(calendarId);

* Remove old compiler option

5 years agoFix race condition in ManualResetValueTaskSourceCore (#22711)
Stephen Toub [Wed, 20 Feb 2019 11:54:11 +0000 (06:54 -0500)]
Fix race condition in ManualResetValueTaskSourceCore (#22711)

* Fix race condition in ManualResetValueTaskSourceCore

ManualResetValueTaskSourceCore.GetStatus is used from ValueTaskAwaiter.IsCompleted.  If GetStatus returns Success too early, then IsCompleted will also return true too early, which will result in GetResult being called too early.  This doesn't happen today when an MRVTSC is used sequentially.  But if an instance is pooled by the object its stored on getting put back into a pool as part of a call to the wrapper's GetResult, then we can end up in the following situation:
- Thread 1 starts an await on an instance containing an MRVTSC.  It calls IsCompleted.
- Thread 2 starts to complete that instance, getting as far as calling SignalCompletion and setting _completed to true but not yet setting _continuation.
- Thread 1 sees _completed == true and returns true from IsCompleted.  It calls GetResult, and the wrapper extracts the result from the instance, resets it, and puts it back into the pool.
- Thread 3 takes the object out of the pool and starts using it.
- Thread 2 continues SignalCompletion on that instance, and sets _continuation to the sentinel.
- Now Thread 3's instance's _continuation is the sentinel when it should be null.  If it calls SignalCompletion, it'll erroneously find that _continuation is not null and will queue _continuation/_continuationState for execution, resulting in the sentinel getting executed.  If it calls OnCompleted, it'll find that the _continuation is not null, and will queue the supplied continuation/state to execute immediately even though the operation may not yet actually be done.

The fix is simply to check not just _completed but also _continuation.  The operation is considered pending if either _completed is false, meaning SignalCompletion has not yet been called, or if _continuation is still null, meaning it's neither been set to the supplied delegate nor to the sentinel.  We can't just rely on _completed for the above outlined reasons, and we can't just rely on _continuation because it can be non-null if OnCompleted was called to hook up a callback (if we only cared about the await pattern, then we could just check _continuation and wouldn't need _completed, but we also need to support non-await access).

* Address PR feedback

5 years agoFix CLRDataCreateInstance export. This was breaking SOS. (#22701)
Mike McLaughlin [Wed, 20 Feb 2019 07:16:25 +0000 (23:16 -0800)]
Fix CLRDataCreateInstance export. This was breaking SOS. (#22701)

Fix CLRDataCreateInstance export. This was breaking SOS.

Added the right cmake magic so the function is exported properly.

5 years agoAdd ManagedRuntimeEventSource (#22515)
Sung Yoon Whang [Wed, 20 Feb 2019 05:40:12 +0000 (21:40 -0800)]
Add ManagedRuntimeEventSource (#22515)

* Adding a dummy ManagedRuntimeEventSource

* Add ManagedRuntimeEventSource

* Renaming ManagedRuntimeEventSource to RuntimeEventSource

* some cleanup

* use Condition instead of ifdefing out the whole file

* some cleanups

* remove unused namespaces

* Move m_RuntimeEventSource to RuntimeEventSource from EventPipeController

* Adding some TODO items

* address more pr comments

* Use GUID to initialize RuntimeEventSource

* Exclude BasicEventSourceTests from CoreFX test CI leg

* Addressing rest of the PR feedback

* dont dispose counters on disable command to avoid races

5 years agoEarly out from vectored exception handler on uninitialized threads (#22702)
Jan Kotas [Wed, 20 Feb 2019 04:48:19 +0000 (20:48 -0800)]
Early out from vectored exception handler on uninitialized threads (#22702)

Fixes #22698

5 years agoUse out arguments in UmAlQuraCalendar (#22704)
Jan Kotas [Wed, 20 Feb 2019 04:38:15 +0000 (20:38 -0800)]
Use out arguments in UmAlQuraCalendar (#22704)

5 years agoCleanup CoreLib makefiles (#22706)
Jan Kotas [Wed, 20 Feb 2019 04:36:46 +0000 (20:36 -0800)]
Cleanup CoreLib makefiles (#22706)

5 years agoAdding tannergooding to the arm64Users list. (#22665)
Tanner Gooding [Wed, 20 Feb 2019 02:07:44 +0000 (18:07 -0800)]
Adding tannergooding to the arm64Users list. (#22665)

5 years agoMerge pull request #22656 from briansull/fix_arm64_assert
Brian Sullivan [Wed, 20 Feb 2019 01:31:27 +0000 (17:31 -0800)]
Merge pull request #22656 from briansull/fix_arm64_assert

ARM64: Correct the assert to add R8 as a potential valid arg register

5 years agoAdd array of managed assembly objects to StackFrameHelper class:
John Salem [Tue, 19 Feb 2019 23:20:06 +0000 (15:20 -0800)]
Add array of managed assembly objects to StackFrameHelper class:
 * allows for more robust caching of source info (in CoreFX) in light of unloadability
 * allows dynamic and regular assemblies to use the same key for source info caching (in CoreFX)

 #20179

5 years agoFix formatting
Brian Sullivan [Tue, 19 Feb 2019 23:30:09 +0000 (15:30 -0800)]
Fix formatting

5 years agoUse RunContinuationsAsynchronously in SemaphoreSlim.WaitAsync (#22686)
Stephen Toub [Tue, 19 Feb 2019 22:35:06 +0000 (17:35 -0500)]
Use RunContinuationsAsynchronously in SemaphoreSlim.WaitAsync (#22686)

SemaphoreSlim.Release shouldn't invoke arbitrary continuations as part of its invocation, so when it dequeues a task waiter and goes to complete it, rather than just calling TrySetResult, it queues the task to the thread pool to have TrySetResult invoked there.  Now that we have RunContinuationsAsynchronously, though, we can just use that functionality instead.  This has two main benefits:
1. We avoid queueing a work item entirely if there are no continuations from the task.  This might happen, for example, if the semaphore is released so quickly after waiting on it that the WaitAsync caller hasn't yet hooked up a continuation, in which case the await on the WaitAsync task will just see IsCompleted as true and continue running.
2. We avoid queueing a work item when the task represents a synchronous Wait, which happens if there's already a pending WaitAsync when Wait goes to block.  The main benefit here is avoiding potential thread pool starvation, if threads in the pool are blocked in such Waits, and previously another thread pool thread would have been needed to run the queued work item to complete the synchronous Wait.

5 years agoCorrect the assert to add R8 as a potential valid register
Brian Sullivan [Sat, 16 Feb 2019 02:06:38 +0000 (18:06 -0800)]
Correct the assert to add R8 as a potential valid register
Also fix the calls to RemoveElemD to use lvVarIndex
Re-enable the interop tests that were failing on ARM64

5 years agoCleanup Calendars code (#22582)
Hugh Bellamy [Tue, 19 Feb 2019 21:33:26 +0000 (21:33 +0000)]
Cleanup Calendars code (#22582)

5 years agoFixing extension method overload resolution for some S.R.I.Vector methods (#22696)
Tanner Gooding [Tue, 19 Feb 2019 21:24:30 +0000 (13:24 -0800)]
Fixing extension method overload resolution for some S.R.I.Vector methods (#22696)

5 years agoUpdate dependencies from https://github.com/dotnet/core-setup build 20190218.4 (...
dotnet-maestro[bot] [Tue, 19 Feb 2019 18:42:20 +0000 (10:42 -0800)]
Update dependencies from https://github.com/dotnet/core-setup build 20190218.4 (#22689)

This change updates the following dependencies
- Microsoft.NETCore.App - 3.0.0-preview4-27418-4