134 Commits
Author SHA1 Message Date
Mike McLaughlin f81e82df0c Fix crashreport for stack overflow (#57428)
* Fix crashreport for stack overflow

Issue: https://github.com/dotnet/runtime/issues/57032

The stack overflow managed exception wasn't been set/written out.

Changed the "unmanaged_frames" value to "stack_frames" because it includes both native and managed frames.

Aggregated the repeated stack frames adding a "repeated"/repeated_frames value/array for the time of times the sequence was repeated.

Looks like this:

    {
      "repeated" : "0x1542",
      "repeated_frames" : [
       {
        "is_managed" : "true",
        "module_address" : "0x10e402000",
        "stack_pointer" : "0x7000045ce020",
        "native_address" : "0x11b9ee8c9",
        "native_offset" : "0x29",
        "token" : "0x600006f",
        "il_offset" : "0x0",
        "method_name" : "Macson.Client.Diagnostics.CrashyClass.Foo2()",
        "timestamp" : "0xa8561820",
        "sizeofimage" : "0xe000",
        "filename" : "Macson.Client.dll",
        "guid" : "49cd869a682942bc95c0c34ca206c61d"
       },
       {
        "is_managed" : "true",
        "module_address" : "0x10e402000",
        "stack_pointer" : "0x7000045ce040",
        "native_address" : "0x11b9ee879",
        "native_offset" : "0x29",
        "token" : "0x6000070",
        "il_offset" : "0x0",
        "method_name" : "Macson.Client.Diagnostics.CrashyClass.Foo1()",
        ...
       },
      ]
    }

* Update createdump doc

* Fix Windows triage dump flags

* Code review feedback
2021-08-17 13:02:14 -07:00
Sergey AndreenkoandJan Kotas 13a2b6dedf Ecma edit for conv.ovf.<to type>.un. (#56450)
* Add a conv conformance test.

* Fix Ecma description.

* Fix the test.

* Update docs/design/specs/Ecma-335-Augments.md

Co-authored-by: Jan Kotas <[email protected]>

* Disable VN optimizations on arm64 because of the bug.

* add a new chapter.

* fix space

* Fix format.

* exclude the test on mono

Co-authored-by: Jan Kotas <[email protected]>
2021-08-03 17:04:17 -07:00
David Wrighton 5d4d913182 Covariant return updates to ecma augments (#56496)
* Covariant return updates to ecma augments
2021-07-28 17:43:46 -07:00
Kunal Pathak b2264cb9cd Lsra heuristic tuning experiment report (#56103)
* lsra tuning experiments

* remove the trailing space

* Review comment
2021-07-21 16:34:07 -07:00
Zoltan Varga 4156116824 [mono] Add some WASM AOT documention. (#55498) 2021-07-12 13:59:13 -04:00
893739ffe7 [mono] new Sdk that selects mono runtime components (#54432)
* Work in progress: new Sdk that selects mono runtime components

* Add props and targets description to the components doc

* condition the _MonoRuntimeAvailableComponents by RuntimeIdentifier

* [cmake] Write a component-manifest.props file during build

If we're not building a mono aot cross compiler, generate a
component-manifest.props file in artifacts/obj/mono/<host>/ that indicates if
the host will use static or dynamic components, and a list of the available
components, and the properties for constructing their names.

* Build Microsoft.NETCore.App.Runtime.Mono.<RID>.Sdk shared framework nuget

It seems to also generate a symbols nuget.  And in the nuget there's a
tools/mono-sdk-what-is-this.deps.json file from the
SharedFrameworkHostFileNameOverride property.  It would be nice to exclude that
stuff.

* put the compoonent-manifest.targets into the Sdk

* delete WIP in mono/nuget/

* fixup static component names in component-manifest.targets

* delete fixed fixme

* add missing $

* fix whitespace

* [cmake] switch to configure_file instead of file(CONFIGURE)

* add missing trailing slashes in .props.in file

* Add new Sdk packs to the workload manifest

* rework component-manifest.targets to use ItemGroups; move to new SDK

* Rename shared framework to Microsoft.NETCore.App.Runtime.Mono.<RID>.Props.Sdk

And only include component-manifest.props, not the targets

* Update manifest to include the new Props.Sdk and MonoTargets.Sdk

* Move RuntimeConfigParserTask into Microsoft.NET.Runtime.MonoTargets.Sdk

Consolidate all platform-independent tasks and targets into a single Sdk

* Add iossimulator-x86 props

* update components design doc

* Fix typo

* improve docs

* Add _MonoRuntimeComponentDontLink target output

* Drop component-manifest.props into runtime pack build/ directory

Remove from the Microsoft.NETCore.App.Mono.Props.Sdk workload nuget

* remove Microsoft.NETCore.App.Mono.Props.Sdk

* Import component-manifest.props from the runtime pack

Move the MonoTargets.Sdk import to each target platform that we support

* Fix typos

Co-authored-by: Rolf Bjarne Kvinge <[email protected]>

* Apply suggestions from code review

Co-authored-by: Ankit Jain <[email protected]>

* Add JsonToItemsTaskFactory

* fix whitespace

* Do some validation earlier in _MonoComputeAvailableComponentDefinitions

* Read component-manifest.json using the JsonToItemsTaskFactory

and bundle it in Microsoft.NET.Runtime.MonoTargets.Sdk

* remove ResolvedRuntimePack import from WorkloadManifest.targets

it's too early, and we have the JsonToItemsTaskFactory now to read the manifest

* Generate component-manifest.json in CMakeLists.txt

* Fix some copy-paste nits

* Use RuntimeFlavor==mono for runtime pack build directory

instead of TargetsMobile.  We want the build files (mono-components.json)
in every mono runtime pack, not just on mobile targets

* Apply suggestions from code review

Co-authored-by: Ankit Jain <[email protected]>

* rename component-manifest to RuntimeComponentManifest

* fixup nullability annotations

* fix whitespace

* fix formatting

* Misc fixes to JsonToItemsTaskFactory

* Rename MonoRuntimeComponentManifestReadTask

from MonoRuntimeComponentsReadManifestTask

* undo nullability annotation

Build doesn't like it for some reason (probably net472)

* fix incorrect task parameter name

* Remove Identity metadata from dictionary at json parsing time

Also improve nullability a bit by making the properties immutable

* Throw correct json deserializer exceptions

* Catch JsonException in an async function

We get nice error messages now like

```
src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/RuntimeComponentManifest.targets(8,5): error : Failed to deserialize json from file 'artifacts/bin/mono/iOSSimulator.x64.Release/build/RuntimeComponentManifest.json', JSON Path: $.items._MonoRuntimeAvailableComponents[2], Line: 14, Position: 1 [component-manifest.sample.proj]
src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/RuntimeComponentManifest.targets(8,5): error : JsonException: The JSON value could not be converted to System.Collections.Generic.Dictionary`2[System.String,System.String]. Path: $.identity | LineNumber: 0 | BytePositionInLine: 16. Path: $.items._MonoRuntimeAvailableComponents[2] | LineNumber: 14 | BytePositionInLine: 1. [component-manifest.sample.proj]
src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/RuntimeComponentManifest.targets(8,5): error : InvalidOperationException: Cannot get the value of a token type 'Number' as a string. [component-manifest.sample.proj]
src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/RuntimeComponentManifest.targets(8,5):
error :
[component-manifest.sample.proj]
```

* fixup comments

Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
Co-authored-by: Ankit Jain <[email protected]>
2021-07-08 00:49:33 +00:00
Jakob Botsch Nielsen e363f9acfa Remove unnecessary Prev field in portable tailcall helpers (#54894)
GC only ever needs to look at the top dispatcher frame as other
dispatchers cannot have live arg buffers, so it is not necessary to keep
these linked together. We can save a bit of stack this way.

Also update design document that was a bit outdated.
2021-07-01 13:30:56 +02:00
Steve MacLean 19b5bd1b58 Add Cross DAC documentation (#54498)
* Add Cross DAC documentation
2021-06-21 15:10:16 -04:00
Takym (たかやま) dbcb38752d Syntax highlighted type-loader.md (#54497)
* Syntax-highlighted `type-loader.md`

* Update type-loader.md
2021-06-21 13:06:29 -04:00
David Wrighton d07f9111c5 Enable devirtualization in more scenarios on crossgen2 (#53567)
Address deficiencies in current devirtualization infrastructure

- Remove the responsibility of creating a CORINFO_RESOLVED_TOKEN structure from the JIT and make it a responsibility of the VM side of the jit interface.
  - This enables the component (crossgen2) which has deeper understanding of the requirements here to correctly handle scenarios that would otherwise require expressing crossgen2 specific details across the jit interface.
- Add a new set of fixups (`READYTORUN_FIXUP_Check_VirtualFunctionOverride` and `READYTORUN_FIXUP_Verify_VirtualFunctionOverride`) these are used to validate that the behavior of the runtime and crossgen2 compiler is equivalent for a virtual resolution event
  - `READYTORUN_FIXUP_Check_VirtualFunctionOverride` will ensure that the virtual resolution decision is the same at crossgen2 time and runtime, and if the decision differs, any generated code affected by the decision will not be used.
  - `READYTORUN_FIXUP_Verify_VirtualFunctionOverride` will perform the same checks as `READYTORUN_FIXUP_Check_VirtualFunctionOverride`, but if it fails the check, the process will be terminated with a fail-fast. It is intended for use under the `--verify-type-and-field-layout` stress mode.
  - Currently only the `READYTORUN_FIXUP_Verify_VirtualFunctionOverride` is actually generated, and it is only generated when using the `--verify-type-and-field-layout` switch to crossgen2. Future work will identify if there are scenarios where we need to generate the `READYTORUN_FIXUP_Check_VirtualFunctionOverride` flag. One area of possible concern is around covariant returns, another is around handling of type equivalence.
- In order to express the fixup signature for the VirtualFunctionOverride fixups, a new flag has been added to `ReadyToRunMethodSigFlags`. `READYTORUN_METHOD_SIG_UpdateContext` will allow the method signature to internally specify the assembly which is associated with the method token, instead of relying on the ambient context.
- R2RDump and the ReadyToRun format documentation have been updated with the details of the new fixups/flags.
- Update the rules for handling unboxing stubs
  - See #51918 for details. This adds a new test, as well as proper handling for unboxing stubs to match the JIT behavior
  - Also revert #52605, which avoided the problem by simply disabling devirtualization in the presence of structs
- Adjust the rules for when it is legal to devirtualize and maintain version resiliency
  - The VersionsWithCode and VersionsWithType rules are unnecessarily restrictive.
  - Instead Validate that the metadata is safely checkable, and rely on the canInline logic to ensure that no IL that can't be handled is inlined.
  - This also involved adding a check that the chain of types from the implementation type to the declaration method table type is within the version bubble.
  - And changing the `VersionsWithType` check on the implementation type, to a new `VersionsWithTypeReference` check which can be used to validate that the type can be referred to, in combination with using `VersionsWithType` on the type definition.
  - By adjusting the way that the declMethod is referred to, it becomes possible to use the declMethod without checking the full method is `VersionsWithCode`, and it just needs a relationship to version matching code.
- In `resolveVirtualMethod` generate the `CORINFO_RESOLVED_TOKEN` structures for the jit
  - In particular we are now able to resolve to methods where the decl method is the resolution result but is not within the version bubble itself. This can happen if we can prove that the decl method is the only method which can possibly implement a virtual.
- Add support for devirtualization reasons to crossgen2
- Port all devirtualization abort conditions to crossgen2 from runtime that were not already present
- Fix devirtualization from a canonical virtual method when the actual implementation is more exact
- Fix variant interface override scenario where there is an interface that requires implementation of the variant interface as well as the variant interface itself.
2021-06-10 17:43:26 -07:00
Johan Lorensson 83cdaf631d Add Mono diagnostics-tracing design document. (#53302) 2021-06-10 13:39:25 +02:00
Cam Sinclair bc44b09721 Minor corrections to BotR intro chapter (#53746)
Just fixing up a couple of missing words I noticed in the intro chapter:
Missing "to" in "(more code that does not seem do much)"
Missing "a" in "This results in big productivity boost."
2021-06-04 18:05:45 -07:00
Vitek KarasandElinor Fung 911640b3a8 Add better description of what to pass to hostfxr_initialize_for_dotnet_command_line (#53678)
Co-authored-by: Elinor Fung <[email protected]>
2021-06-04 03:08:16 -07:00
Bruce Forstall 956e58445f Add information about frame chaining to CLR ABI (#53563)
* Add information about frame chaining

Update links for per-platform ABI documentation.

A few editorial changes.

* Code review feedback
2021-06-02 10:19:05 -07:00
Kunal Pathak f8066b33f9 GT_COPY source should be marked as consume during resolution (#53041) 2021-05-24 18:23:22 -07:00
Lakshan FernandoandVitek Karas 127be4b389 Native host warnings fix (#52109)
* Native host warnings fix

Native host warnings fix

* Feedback

* Update docs/design/features/IJW-activation.md

Co-authored-by: Vitek Karas <[email protected]>

* Update src/coreclr/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.xml

Co-authored-by: Vitek Karas <[email protected]>

* Update src/coreclr/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.xml

Co-authored-by: Vitek Karas <[email protected]>

* Update docs/workflow/trimming/feature-switches.md

Co-authored-by: Vitek Karas <[email protected]>

* fixing the native host feature settings

* feedback on error code

* fb

* FB

* merge conflict

Co-authored-by: Vitek Karas <[email protected]>
2021-05-15 13:26:10 -07:00
0979434b6d ECMA spec addendum dealing with static interface methods (#49558)
Co-authored-by: David Wrighton <[email protected]>
Co-authored-by: Aleksey Tsingauz <[email protected]>
Co-authored-by: Fred Silberberg <[email protected]>
2021-05-15 00:14:06 +02:00
Kia Panahi Rad 2a302a3559 Fix typo (#52694)
Under "What should be in a BotR chapter" heading.
2021-05-13 06:26:32 -07:00
e39196ffc9 Fixed Broken Links in Documentation (#50653)
Co-authored-by: Youssef Victor <[email protected]>
Co-authored-by: Marek Safar <[email protected]>
2021-05-10 10:09:08 +02:00
Konrad Kokosa 7d24b364a7 Add link to my deep .NET GC Internals series (#51551)
It's 14 hours of lectures about how .NET GC is implemented.
2021-04-20 13:09:55 -07:00
Tanner Gooding 17506ca9c7 Updating Vector<T> to support nint and nuint (#50832)
* Refactoring GenTreeJitIntrinsic to expose SimdSize and SimdBaseType via methods

* Updating the JIT to pass through the CORINFO_TYPE for hardware intrinsics

* Adding support for Vector<nint> and Vector<nuint> to managed code

* Updating the vector tests to cover nint and nuint

* Recognize Vector<nint> and Vector<nuint> in the JIT

* Updating Vector64/128/256<T> NotSupportedTest metadata to include type name

* Updating the Vector64/128/256<T> tests to have NotSupported validation for nint/nuint

* Splitting ThrowHelper.ThrowForUnsupportedVectorBaseType into separate functions for Numerics vs Intrinsics

* Updating Utf16Utility.Validation to directly use Vector<nuint>

* Don't use the auxiliary type to hold a SIMD type, since it can be trivially pulled from the operand instead

* Split the mono handling for ThrowForUnsupportedVectorBaseType into ThrowForUnsupportedNumericsVectorBaseType and ThrowForUnsupportedIntrinsicsVectorBaseType

* Add basic handling for MONO_TYPE_I and MONO_TYPE_U to simd-intrinsics.c

* Ensure simd-intrinsics.c in Mono handles `MONO_TYPE_I` and `MONO_TYPE_U` on relevant code paths

* Ensure we don't assert when encountering synthesized Vector128<nint> handles

* Applying formatting patch

* Fix the handling for Crc32 and Crc32C on ARM64

* Updating Mono mini-amd64 to handle MONO_TYPE_I and MONO_TYPE_U for SIMD operations

* Handle OP_XCOMPARE.CMP_GE_UN for MONO_TYPE_U

* Handle MONO_TYPE_I and MONO_TYPE_U for Vector types in mini-llvm
2021-04-19 17:55:09 -07:00
Mike McLaughlinandJuan Sebastian Hoyos Ayala 79ad10cf22 Add MachO dump writer to createdump (#51150)
* Add MachO dump writer to createdump

Instead of the hacky ELF core dumps on MacOS now createdump generates true MachO dumps.

Setting the COMPlus_DbgEnableElfDumpOnMacOS environment variable is no longer needed.

Add special thread info memory region containing the OS thread ids missing from macho core dumps. This allows SOS to map the thread indexes to thread ids. The address (0x7fffffff00000000) of this special memory region is above the highest user address (0x0007FFFFFFFFF000) and below a kernel reserved address (0xffffff8000xxxxxx) which is kind of moot because dumps don't include any kernel regions. lldb seems just fine with this memory region.

The changes include ARM64 support also, but since I don't have a M1 device I can't build/test them. I'm hoping Steve can at least review them.

Add --verbose/TRACE_VERBOSE support to tone down all the macho dump generation spew.

Issue: #48664

* Fix build problem

* Update docs

* Code review feedback

Co-authored-by: Juan Sebastian Hoyos Ayala <[email protected]>
2021-04-15 21:45:55 +00:00
Aleksey Kliger (λgeek) 03ea0528ae [design] Mono runtime components (#49913)
* [design] MonoVM Runtime Components

* Add details about writing a new component

* Update design doc to reflect latest changes in the prototype
2021-04-13 10:55:34 -04:00
8b25350be2 Add design document for Mobile runtimeconfig.json host configuration (#50744)
* Add design document for Mobile runtimeconfig.json host configuration

* Remove tailing space

* Address review feedbacks

* Update docs/design/mono/mobile-runtimeconfig-json.md

Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>

* Add the missing word

* Update docs/design/mono/mobile-runtimeconfig-json.md

Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>

* Remove more tailing spaces

* Update docs/design/mono/mobile-runtimeconfig-json.md

Co-authored-by: Ryan Lucia <[email protected]>

* Update docs/design/mono/mobile-runtimeconfig-json.md

Co-authored-by: Ryan Lucia <[email protected]>

* Update docs/design/mono/mobile-runtimeconfig-json.md

Co-authored-by: Ryan Lucia <[email protected]>

* Update docs/design/mono/mobile-runtimeconfig-json.md

Co-authored-by: Ryan Lucia <[email protected]>

* Update docs/design/mono/mobile-runtimeconfig-json.md

Co-authored-by: Ryan Lucia <[email protected]>

* Update docs/design/mono/mobile-runtimeconfig-json.md

Co-authored-by: Ryan Lucia <[email protected]>

* Update docs/design/mono/mobile-runtimeconfig-json.md

Co-authored-by: Ryan Lucia <[email protected]>

* Address more review feedbacks

Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
Co-authored-by: Ryan Lucia <[email protected]>
2021-04-08 15:19:20 -04:00
David Wrighton eebf52c641 Move default interfaces spec to common ecma335 addenda location (#49914) 2021-03-19 16:19:58 -07:00
Tomáš Rylek 3f28d48301 Add runtime MVID checks for composite images (#49668)
* Crossgen2 implementation of new MVID R2R section
* Runtime checks for assembly MVIDs against native images
* Basic R2RDump support for dumping the manifest assembly MVID table.
* R2R minor version increment; format spec update

Thanks

Tomas
2021-03-17 20:55:49 +01:00
Dong-Heon Jung 0779a4fd49 Minor fix in dotnet-pgo.md (#49527) 2021-03-12 14:38:03 -08:00
lindexi cb620ffe09 Fix link in covariant-return-methods.md (#49356) 2021-03-09 06:47:00 -05:00
David Wrighton 8a4d712069 Dotnet pgo phase2 (#49087)
- Add merge command as designed earlier
  - Add new typesystem variant that works based exclusively on the typerefs in existing mibc files and can operate without references to implementation binaries
  - Re-use ibc reader/merger from crossgen2 codebase
- Increase usability of the tool
  - Set default verbosity to normal
  - Normal verbosity prints a relatively limited amount of output
2021-03-04 18:08:48 -08:00
Viktor Hofer e52568de3d Address remaning master mentions that should be main (#48904)
Did a second search of master in the repo since all the M2M changes went
in and found some remaining places that weren't included in the
previous change.
2021-03-01 13:08:32 +01:00
Viktor Hofer 3553284bea Rename mention to master branch to main (#48824) 2021-03-01 10:09:31 +01:00
David Wrighton 8065f95970 Revamp dotnet-pgo arguments (#48680)
- Add a document describing the behavior and how it is expected to be used.
- Rework the existing command line handling to implement the proposed create-mibc command. (the merge command is still entirely TBD).
2021-02-25 13:35:32 -08:00
Adeel Mujahid 5d04c9e9e8 Move corehost under src/native (#48071)
* Move corehost under src/native

* Move content out of cli/ directory

* Update configurations post-move

* Update docs
2021-02-13 08:33:56 -08:00
SingleAccretion 171812ba74 Mention tiering support in the tutorial (#48047) 2021-02-09 09:31:26 -05:00
Youssef VictorandDan Moseley 5d5c3e7a58 Enable markdownlint rule (MD009) (#40887)
* Create markdownlint.yml

* Create markdownlint-problem-matcher.json

* Create .markdownlint.json

* Update .markdownlint.json

* fix violations

* fixes

* Remove "push" section

As advised by @viktorhofer so it's quite clear it only runs in CI.

Co-authored-by: Dan Moseley <[email protected]>
2021-02-08 10:43:40 -08:00
Youssef Victor 7b24471722 Fix broken link (#47041) 2021-01-15 13:03:18 +01:00
Weihan Li c142f16285 fix typo (#46423) 2020-12-28 01:32:42 -08:00
Christopher Watford d7e90d4494 Add missing issue link (#45416) 2020-12-19 14:47:59 -08:00
Dan Moseley d3a04b2959 Fix complus casing (#46167) 2020-12-16 16:45:32 -08:00
Jan Kotas 820d6c66b7 Add botr doc on managed type system (#45891) 2020-12-11 12:55:08 +01:00
Jeremy KoritzinskyandSergey Andreenko d5a9b9d06c Add a blurb on the x86 calling convention to clr-abi.md (#45807)
Co-authored-by: Sergey Andreenko <[email protected]>
2020-12-08 16:43:08 -08:00
Jan Kotas 10381a2cdc Find&Replace coreclr/src -> coreclr (#45761) 2020-12-08 10:40:17 -08:00
Carol Eidt 274a0772c9 Add description of AvoidSplittingBackedge branch and link to #40264 (#45609) 2020-12-04 12:05:23 -08:00
Tomáš Matoušek 6747320e43 Document Compilation Options and Compilation Metadata References CDIs (#37605) 2020-12-03 20:46:50 -08:00
Carol Eidt 74116f0fbc Update first-class-structs.md (#45512)
* Update first-class-structs.md

* Address feedback and add links to x64 vector ABI branches
2020-12-03 11:15:40 -08:00
Andrew Au f7530ff152 Fixes paths (#45392) 2020-12-02 17:59:50 -08:00
Carol Eidt 301056d6ff Update lsra-detail.md (#45235)
* Update lsra-detail.md
2020-12-01 05:58:38 -08:00
Igor Velikorossov 0a16644ba8 Update host-tracing.md (#45389) 2020-11-30 14:12:13 -08:00
Kunal Pathak 07193b8287 Register allocation cleanup (#44977)
* Register allocation cleanup

- Comment updates
- Misc code cleanup

* jit format
2020-11-20 13:30:42 -08:00
fdf1494334 Add feature switch for disabling startup hooks (#44050)
* Introduce feature switch for startup hook

* Add test

* Update md

* Update src/coreclr/src/System.Private.CoreLib/src/System/StartupHookProvider.cs

Co-authored-by: Jan Kotas <[email protected]>

* Add UnreferencedCode attribute

* Apply suggestions from code review

Co-authored-by: Vitek Karas <[email protected]>

* Update message

* Update baseline

Co-authored-by: Jan Kotas <[email protected]>
Co-authored-by: Vitek Karas <[email protected]>
2020-11-13 13:04:25 -08:00