Timur Mustafin [Mon, 2 Jun 2025 14:15:14 +0000 (17:15 +0300)]
Fix Checked build after Sync_mar25 PR #689
Sync mar25 release/8.0-tizen (#689)
* [RISC-V] Increase timeouts in CacheTests (#107278)
This patch fixes System.Text.Json.Serialization.Tests.CacheTests on Debug build.
* Fix typo in comment of SAVE_ARGUMENT_REGISTERS (#106011)
* [RISC-V] Update ABI doc (#107286)
* Update ABI doc
* Managed/native varargs are supported on Windows only
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Add github issue links
* Update varargs link ref
* Managed varargs are supported on Windows only
---------
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* [RISC-V] Fixed bug in debug stub (#107972)
* [RISC-V] Fix Int32 to Unsigned overflow check (#107024)
* [RISC-V] Allowed CHECK_POSITIVE to have temporary register
* [RISC-V] Fixed CHECK_POSITIVE in genIntCastOverflowCheck
* [RISC-V] Improved J pseudoinstruction printing
* [RISC-V] Added ret pseudoinstruction to disasm
* [RISC-V] Fixed register type in disasm
* [RISC-V] Fixed ins_Load
* [RISC-V] Formatted code
* [RISC-V] Fixed format bug
* Revert "[RISC-V] Fixed ins_Load"
This reverts commit
144629fb3f98ccbd817dbe3b5cd6d3f687ed942a.
* [RISC-V] Fixed comment in codegenlinear
* [RISC-V] Fixed sextw attribute type
* [RISC-V] Simplified casts logic
* [RISC-V] Improved CHECK_SMALL_INT_RANGE casts
* [RISC-V] Optimized check int range
* [RISC-V] Fixes in codegenriscv64
* [RISC-V] Removed unused comment
* [RISC-V] Fixed long/ulong casts
* [RISC-V] Added some comments
* [RISC-V] Fixes in CHECK_SMALL_INT_RANGE
* [RISC-V] More bugfixes in int casts
* [RISC-V] Generalized CHECK_SMALL_INT_RANGE a little bit
* [RISC-V] Fixed typo
* [RISC-V] Fix some minor errors (#107179)
* [RISC-V] Fix minor errors
* Delete Unused Codes in RISCV64 Unwinder
* [RISC-V][LoongArch64] Encode missing tailcall in GC info (#109512)
* Encode missing tailcall in GC info
* Documentation typos
* Use ABI names for floating registers (#109728)
* Add LoongArch64 and RISC-V to list of ports (#110144)
* [RISC-V] JIT: Fix emitInsMayWriteToGCReg (#110390)
* Remove instructions from privileged ISA
* Fix emitInsMayWriteToGCReg; it's easier to inspect instruction opcodes than indices
* Implement EmitJMP case in RiscV64Emitter (#111273)
* Update host test RID fallbacks to include arm64 (#109235)
When running against a mock coreclr, host tests create a minimal Microsoft.NETCore.App.deps.json that also includes a sparse fallback RID graph. That graph gets used in tests for RID-specific asset resolution that target explicitly enabling the RID fallback graph. This change adds arm64 to the mock RID fallback graph, which should allow those tests to run properly on arm64.
* [RISC-V] Fix HostActivation.Tests unknown-rid (#110687)
* [RISC-V] JIT: Remove src/dst from CORINFO_HELP_ASSIGN_BYREF GC kill set (#111360)
* Remove t3 and t5 from RBM_CALLEE_TRASH_NOGC
* Use li instead of ori for load immediate (#111453)
* [RISC-V] Enable JitDisasmWithCodeBytes (#111450)
* Remove unused IsMovInstruction
* Fix relocs errors on riscv64 (#111317)[PARTIALLY]
Partially cherry-pick: src/coreclr/{jit,tools} pick, src/coreclr/nativeaot drop.
* Fix relocs errors on riscv64
* Fix RELPTR32 and feedback
* Align with PutLoongArch64JIR
* Consolidate relocs
Co-authored-by: Tomek Sowiński <tomeksowi@gmail.com>
* Use reloc-57
Co-authored-by: Filip Navara <filip.navara@gmail.com>
* Combine PC & JALR to correct reloc
* Fix var macros
* Update emitriscv64.h
* Remove JALR
* Combine TODO comments related to CAS-128
---------
Co-authored-by: Tomasz Sowiński <tomeksowi@gmail.com>
Co-authored-by: Filip Navara <filip.navara@gmail.com>
* GC-report all associated LoaderAllocators (#110856)
* Report all LoaderAllocators associated with an interior pointer
* Remove IsInRange's unused out parameter
* Remove assertion for at least one valid LoaderAllocator object ref
---------
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Fix reversed code offsets in GcInfo (#111792)
* [RISC-V] Fix unwind code size table (#112267)
* Fix assigning context pointers, callee-saved registers are not contiguous
* Fix bad save_freg code size on VM side
* Fix relocs for linux-riscv64 AOT (#112331)
Co-authored-by: Filip Navara <filip.navara@gmail.com>
* [RISC-V] Synthesize some floating constants inline (#111529)
* [RISC-V] Clean up code gen for floating comparisons (#111626)
* Clean up code gen for floating comparisons
* Don't allocate temp reg for floating comparisons
* Check for an empty string for the TimeZoneDirectory environment variable (#112831)
* Check for an empty string for the TimeZoneDirectory environment variable
* Code feedback
* [RISC-V] Use zero register as argument for atomics (#112693)
* zero register in simple atomics
* Use zero register for CAS comparand
* Use zero register for CAS data node
* Fix unextended CAS comparand
* Address previous nit
* Remove unnecessary diff
* [RISC-V] Replace load local address with load global (#113125)
---------
Co-authored-by: yurai007 <dawid_jurek@vp.pl>
Co-authored-by: Gleb Balykov <g.balykov@samsung.com>
Co-authored-by: Tomasz Sowiński <tomeksowi@gmail.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Grzegorz Tomasz Czarnecki <grzegorz.czarnecki.2021@gmail.com>
Co-authored-by: Dong-Heon Jung <clamp03@gmail.com>
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
Co-authored-by: Tymoteusz Wenerski <tymoteusz.wenerski@gmail.com>
Co-authored-by: Filip Navara <filip.navara@gmail.com>
Co-authored-by: JongHeonChoi <j-h.choi@samsung.com>
ashaurtaev [Mon, 7 Apr 2025 09:04:45 +0000 (12:04 +0300)]
[Tizen] Update application profiles in the examples folder
Gleb Balykov [Wed, 9 Apr 2025 15:12:54 +0000 (18:12 +0300)]
[Tizen] Remove hasNativeImage from mcj structs
Co-authored-by: Aleksandr Shaurtaev <a.shaurtaev@partner.samsung.com>
Gleb Balykov [Tue, 9 Aug 2022 10:00:51 +0000 (13:00 +0300)]
[Tizen] Fix module setup in mcj-edit for generic args and fnptr args
See usage of GetTypeHandleThrowing in src/coreclr/vm/siginfo.cpp for more details.
Gleb Balykov [Thu, 23 Jun 2022 09:58:18 +0000 (12:58 +0300)]
[Tizen] Add truncate command to mcj-edit
Gleb Balykov [Wed, 22 Jun 2022 19:33:48 +0000 (22:33 +0300)]
[Tizen] Fix calculation of method count for modules
This was a bit out of sync with the way runtime increments methodCount in MulticoreJitRecorder::EncodeModule.
Value of methodCount for module is not used in runtime, but anyway this is a bug and merge of module with itself
without this patch produces different sha256 because counters did not match. After this patch sha256 match.
Gleb Balykov [Wed, 15 Jun 2022 13:13:02 +0000 (16:13 +0300)]
[Tizen] Fix typo for size of longCounters
Gleb Balykov [Fri, 22 Apr 2022 10:28:32 +0000 (13:28 +0300)]
[Tizen] Add mcj-edit.py tool that can modify MultiCoreJit profiles.
Available commands:
- split (splits mcj profile in app-dependent and app-independent based on modules)
- merge (merges mcj profiles in one profile)
- verify (verifies correctness of mcj profile)
- find (finds method or module in mcj profile)
- compare (compares mcj profiles)
- clean-stats (cleans mcj profile usage stats)
- print (prints mcj profile)
- help (shows short summary on some aspects of mcj profile)
- self-test (performs some testing)
See README for more details on usage, see examples/ for examples of mcj profiles.
Implement software write watch for arm32. (#680)
* Implement software write watch for arm32.
* [Tizen] Add coreclr skips for RPI4 for arm32
GC write watch related subset of src/tests/issues.targets
이형주/MDE Lab(SR)/삼성전자 [Fri, 11 Apr 2025 01:33:46 +0000 (10:33 +0900)]
[Tizen] Use ArrayPool for CSTRMarshaler (#692)
Partially port upstream PR https://github.com/dotnet/runtime/pull/97253 (#696)
Port only commit:
https://github.com/dotnet/runtime/pull/97253/commits/
56e42c2cfc8a75ddc51a8bb0bf30ac60eeba285d
Fix for arm32 dotnet-dump `clrstack` SOS command work with system NI dlls. For example, without this fix it
show some frames as `
BEF60CA8 B485C854 <unknown>` instead of `
BEF60CA8 B485C854 TestApp.Program.Main()`.
[Tizen] Fix debugger breakpoint work for NI loaded code. (#695)
Prevent memory flush in case debugger attached, since it could set managed breakpoint in loaded R2R code (read section), that will be flushed in this case.
Woongsuk [Tue, 25 Mar 2025 07:24:28 +0000 (16:24 +0900)]
[Tizen] Use python3 for building
The build team requested that the Python version should be spcified.
So, update it to use Python3.0
Gleb Balykov [Thu, 13 Mar 2025 14:02:54 +0000 (17:02 +0300)]
[Tizen] Fix pgo setup for armel (without enabling pgo)
---------------------------
I. How to get pgo profiles:
---------------------------
1. Rebuild coreclr in instrumentation mode (set pgo_instrument to 1 in coreclr.spec in case of gbs build)
2. Setup device (rpi4) correctly, pgo profiling setup should match setup of device for perf measurements:
a) generate ni.dll using crossgen2 for all dlls from /usr/share/dotnet.tizen/netcoreapp, /usr/share/dotnet.tizen/framework and for all apps:
e.g. next crossgen2 options can be used: --jitpath /usr/share/dotnet.tizen/netcoreapp/libclrjit.so --targetarch armel -O
b) install plugin-prebuilt
c) generate mcj profiles for all apps
3. Run applications using instrumented coreclr in standalone mode:
To launch apps use app_launcher -e, then terminate app with app_launcher -t.
Profile data will be stored in /tmp/clrjit-<pid>.profdata and /tmp/coreclr-<pid>.profdata files. It's possible to change filename using LLVM_PROFILE_FILE environment variable (both for clrjit and coreclr).
4. Merge profile data:
$ llvm-profdata merge -output=/tmp/coreclr.profdata /tmp/coreclr-*.profdata
$ llvm-profdata merge -output=/tmp/clrjit.profdata /tmp/clrjit-*.profdata
This can be done on device, llvm-profdata is available in llvm-*.rpm.
----------------------------
II. How to use pgo profiles:
----------------------------
1. Put profile data in ./pgodata/<arch>/data
Be sure to verify there are no lines about PGO or LTO in gbs build log! Otherwise pgo profiles are placed incorrectly!
2. Rebuild coreclr with disabled pgo_instrument and enabled pgo_optimized (PGO is disabled by default)
Woongsuk [Mon, 17 Mar 2025 08:14:54 +0000 (17:14 +0900)]
Revert "[Tizen] Enable aggresive optimization for aarch64"
A crash occurs when executing with the aarch64 native images which are genearted in MIC stage.
This crash occurs after applying the latest patches.
The issue seems that the runtime is built with different settings for x86_64 and aarch64.
After revert this patch, it operates normally.
This reverts commit
82a0d6dfe9c287258094aac85bc0eb714235962e.
[Tizen] Update env vars in coreclr tests runner script from COMPlus to DOTNET (#687)
[Tizen] Flush clean pages each 1000 ms after method load (#686)
This checks that 1000 ms timeout has passed only on new method load and then flushes clean pages.
So, flush is not done each 1000 ms if nothing was loaded and this doesn't affect startup time.
Gleb Balykov [Fri, 15 Mar 2024 16:15:57 +0000 (19:15 +0300)]
[Tizen] Add GC heap hard limit for 32 bit
Timur Mustafin [Mon, 3 Feb 2025 16:39:50 +0000 (19:39 +0300)]
[Tizen] FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION
Turn on FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION
Fix build with FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION
Gleb Balykov [Sun, 1 Sep 2024 09:38:37 +0000 (12:38 +0300)]
[Tizen] Flush clean pages of PE images after load/compilation of methods
- After certain amount of compiled/loaded methods
- After certain amount of time passed since last flush (checked after compilation/load of method)
이형주/MDE Lab(SR)/삼성전자 [Tue, 2 Jul 2024 10:17:39 +0000 (19:17 +0900)]
[Tizen] Apply PEImage::CleanAllReadOnlyPages() at the end of multicoreplay(#541)
ashaurtaev [Mon, 3 Feb 2025 12:40:03 +0000 (15:40 +0300)]
[Tizen] Add API to flush cache of PE files
This API allows to drop clean pages of IL-only and R2R dlls
!This patch should be rebased with caution, see comment for PEImageLayout::CleanAllReadOnlyPages!
How to call from c# code via reflection:
Type type = typeof(AssemblyLoadContext);
MethodInfo method = type.GetMethod("FlushPECaches");
if (method != null)
method.Invoke(null, new object[]{});
Co-authored-by: Gleb Balykov <g.balykov@samsung.com>
Gleb Balykov [Mon, 29 Nov 2021 19:12:10 +0000 (22:12 +0300)]
[Tizen] Enable Linq expressions interpreter instead of compiler for tests
Limitations of linq expressions interpreter:
- can't get IL for interpreted linq expressions (see `VerifyIL` on how to get IL code), because it either won't match, or exception will happen because method is not dynamic; besides, there's actually no IL for interpreted expression, interpreter has its own internal representation
- target of Delegate returned by interpreter can't be casted to Closure (see VerifyEmitConstantsToIL<T> in CompilerTests.cs)
- aliased byref parameters are not supported with interpreted linq expressions (https://github.com/dotnet/runtime/issues/19286)
- interpreting TryExpression that is inside the Filter expression of a CatchBlock of another TryExpression works in interpreter, but throws in compiler (https://github.com/dotnet/runtime/issues/20083)
- analysis of Quote expression is a bit different for interpreter (see AssertIsBox<T> in UnaryQuoteTests.cs)
- with disabled FEATURE_DLG_INVOKE and FEATURE_FAST_CREATE if TypeMissing is used in linq expression, then exception is thrown (https://github.com/dotnet/runtime/issues/15553), this is fixed if these features are enabled
Gleb Balykov [Wed, 24 Nov 2021 17:54:48 +0000 (20:54 +0300)]
[Tizen] Enable Linq expressions interpreter instead of compiler
Hyungju Lee [Wed, 24 Apr 2019 08:24:15 +0000 (17:24 +0900)]
[Tizen] Disable FEATURE_DLG_INVOKE and FEATURE_FAST_CREATE in System.Linq.Expression
This increases memory consumption
Timur Mustafin [Thu, 23 Jan 2025 11:33:18 +0000 (14:33 +0300)]
[Tizen] Fix build for .NET 8 with Lazy Entrypoints
Mike McLaughlin [Tue, 16 Jul 2024 22:42:46 +0000 (15:42 -0700)]
Fix crash in DAC enum memory code that brings down createdump (#104939)
* Fix crash in createdump in DAC enum memory code
David Wrighton [Sun, 14 Jul 2024 19:20:21 +0000 (12:20 -0700)]
Change temporary entrypoints to be lazily allocated (#101580)
* WorkingOnIt
* It basically works for a single example.
Baseline
Loader Heap:
----------------------------------------
System Domain:
7ffab916ec00
LoaderAllocator:
7ffab916ec00
LowFrequencyHeap: Size: 0xf0000 (983040) bytes total.
HighFrequencyHeap: Size: 0x16a000 (
1482752) bytes total, 0x3000 (12288) bytes wasted.
StubHeap: Size: 0x1000 (4096) bytes total.
FixupPrecodeHeap: Size: 0x168000 (
1474560) bytes total.
NewStubPrecodeHeap: Size: 0x18000 (98304) bytes total.
IndirectionCellHeap: Size: 0x1000 (4096) bytes total.
CacheEntryHeap: Size: 0x1000 (4096) bytes total.
Total size: Size: 0x3dd000 (
4050944) bytes total, 0x3000 (12288) bytes wasted.
Compare
Loader Heap:
----------------------------------------
System Domain:
7ff9eb49dc00
LoaderAllocator:
7ff9eb49dc00
LowFrequencyHeap: Size: 0xef000 (978944) bytes total.
HighFrequencyHeap: Size: 0x1b2000 (
1777664) bytes total, 0x3000 (12288) bytes wasted.
StubHeap: Size: 0x1000 (4096) bytes total.
FixupPrecodeHeap: Size: 0x70000 (458752) bytes total.
NewStubPrecodeHeap: Size: 0x10000 (65536) bytes total.
IndirectionCellHeap: Size: 0x1000 (4096) bytes total.
CacheEntryHeap: Size: 0x1000 (4096) bytes total.
Total size: Size: 0x324000 (
3293184) bytes total, 0x3000 (12288) bytes wasted.
LowFrequencyHeap is 4KB bigger
HighFrequencyHeap is 288KB bigger
FixupPrecodeHeap is 992KB smaller
NewstubPrecodeHeap is 32KB smaller
* If there isn't a parent methodtable and the slot matches... then it by definition the method is defining the slot
* Fix a couple more issues found when running a subset of the coreclr tests
* Get X86 building again
* Attempt to use a consistent api to force slots to be set
* Put cache around RequiresStableEntryPoint
* Fix typo
* Fix interop identified issue where we sometime set a non Precode into an interface
* Move ARM and X86 to disable compact entry points
* Attempt to fix build breaks
* fix typo
* Fix another Musl validation issue
* More tweaks around NULL handling
* Hopefully the last NULL issue
* Fix more NULL issues
* Fixup obvious issues
* Fix allocation behavior so we don't free the data too early or too late
* Fix musl validation issue
* Fix tiered compilation
* Remove Compact Entrypoint logic
* Add new ISOSDacInterface15 api
* Fix some naming of NoAlloc to a more clear IfExists suffix
* Remove way in which GetTemporaryEntryPoint behaves differently for DAC builds, and then remove GetTemporaryEntrypoint usage from DAC entirely in favor of GetTemporaryEntryPointIfExists
* Attempt to reduce most of the use of EnsureSlotFilled. Untested, but its late.
* Fix the build before sending to github
* Fix unix build break, and invalid assert
* Improve assertion checks to validate that we don't allocate temporary entrypoints that will be orphaned if the type doesn't actually end up published.
* Remove unused parameters and add contracts
* Update method-descriptor.md
* Fix musl validation issue
* Adjust SOS api to be an enumerator
* Fix assertion issues noted
Fix ISOSDacInterface15 to actually work
* Remove GetRestoredSlotIfExists
- Its the same as GetSlot .... just replace it with that function.
* Update src/coreclr/debug/daccess/daccess.cpp
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Update docs/design/coreclr/botr/method-descriptor.md
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Update src/coreclr/vm/methodtable.inl
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Update src/coreclr/vm/methodtable.h
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Fix GetMethodDescForSlot_NoThrow
Try removing EnsureSlotFilled
Implement IsEligibleForTieredCompilation in terms of IsEligibleForTieredCompilation_NoCheckMethodDescChunk
* Fix missing change intended in last commit
* Fix some more IsPublished memory use issues
* Call the right GetSlot method
* Move another scenario to NoThrow, I think this should clear up our tests...
* Add additional IsPublished check
* Fix MUSL validation build error and Windows x86 build error
* Address code review feedback
* Fix classcompat build
* Update src/coreclr/vm/method.cpp
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
* Remove assert that is invalid because TryGetMulticCallableAddrOfCode can return NULL ... and then another thread could produce a stable entrypoint and the assert could lose the race
* Final (hopefully) code review tweaks.
* Its possible for GetOrCreatePrecode to be called for cases where it isn't REQUIRED. we need to handle that case.
---------
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
David Wrighton [Thu, 28 Mar 2024 19:42:30 +0000 (12:42 -0700)]
Add support for the ISOSDacInterface14 api (#100364)
* Add support for the ISOSDacInterface14 api
- This is a split out of the diagnostics changes associated with PR #99183
- This will allow the removal of the useability of the DomainLocalModule apis from ISOSDacInterface without changing the functionality of the interface by allowing consumers to move to the new apis - NOTE, the SOS_BREAKING_CHANGE number is expected to move from 4 to 5 at that point, so users of ISOSDacInterface which understand ISOSDacInterface14 should indicate that they understand version 5.
j-h.choi [Tue, 14 Feb 2023 06:45:02 +0000 (15:45 +0900)]
[Tizen] Create mcj data in '/tmp/.dotnet/mcj/'
Gleb Balykov [Fri, 14 Feb 2025 15:35:54 +0000 (18:35 +0300)]
[Tizen] Fix tests build on all arches
ENABLE_AVX should be defined for all arches
ashaurtaev [Fri, 31 Jan 2025 09:29:57 +0000 (12:29 +0300)]
[Tizen] Add option GCTrimYoungestKeepPercent to specifies the percent of youngest gen to keep during trimming
ashaurtaev [Fri, 30 Aug 2024 14:09:46 +0000 (17:09 +0300)]
[Tizen] Add environment variable timeout to update low memory status
olekarev [Wed, 5 Feb 2025 10:28:26 +0000 (13:28 +0300)]
[Tizen] Disable AVX for X64 tests as Tizen emulator doesn't support it
olekarev [Sat, 25 Jan 2025 08:49:02 +0000 (11:49 +0300)]
[Tizen] Add x64 coreclr test skips
These are mostly a subset of src/tests/issues.targets or marked by <GCStressIncompatible>true</GCStressIncompatible> in csproj with some additional excludes:
- readytorun/r2rdump/FrameworkTests/R2RDumpTests/R2RDumpTests is excluded because System.Private.CoreLib.dll is not a r2r image in default mode
Those 2 are excluded because the emulator doesn't have enough memory to run them:
- GC/LargeMemory/Regressions/largearraytest/largearraytest.sh
- profiler/gc/gc/gc.sh
Woongsuk Cho [Thu, 26 Dec 2024 18:22:51 +0000 (21:22 +0300)]
[Tizen] Enable aggresive optimization for aarch64
In case of aarch64, DISABLE_AGGRESSIVE_OPT option makes start-time slow and use a lot of memory.
So, enable aggressive optimization for aarch64.
Co-authored-by: ashaurtaev <a.shaurtaev@partner.samsung.com>
Dong-Heon Jung [Mon, 13 Jan 2025 08:38:37 +0000 (11:38 +0300)]
[Tizen] More R2R Compilation
Compiles more methods which have IsAggressiveOptimization attribute.
Co-authored-by: ashaurtaev <a.shaurtaev@partner.samsung.com>
[Tizen] Fix property setup for DisableAggressiveOpt
Co-authored-by: Gleb Balykov <g.balykov@samsung.com>
Woongsuk [Mon, 13 Jan 2025 23:19:19 +0000 (08:19 +0900)]
[Tizen] Publish crossgen2 with own source code
The .NET 8 SDK does not recognize RISC-V 64-bit machine values.
(System.Reflection.PortableExecutable.Machine)
Therefore, when creating a self-contained/single-file using this SDK with crossgen2,
the PE header generation for RISC-V 64-bit may malfunction (recognized as 32-bit), resulting in a "BadImageFormatException".
To resolve this issue, modify the runtime build process to build and publish crossgen2 from its own sources.
Woongsuk [Wed, 8 Jan 2025 23:43:46 +0000 (08:43 +0900)]
[Tizen] Add libclrjit_unix_riscv64_x64.so for crosscompilation
To generate native image for riscv64 on MIC stage,
add libclrjit_unix_riscv64_x64.so to crossgen-mic package
Gleb Balykov [Fri, 27 Dec 2024 20:22:22 +0000 (23:22 +0300)]
[Tizen] Disable stripping of crossgen2 binary from crossgen2-mic
This is a workaround for error:
Failure processing application bundle; possible file corruption.
Arithmetic overflow while reading bundle.
A fatal error occurred while processing application bundle
Self-contained builds do not support stripping, see e.g. https://github.com/dotnet/runtime/issues/54947 for more details.
Gleb Balykov [Thu, 19 Dec 2024 11:36:04 +0000 (14:36 +0300)]
[Tizen] Disable Dynamic/Tiered PGO
Gleb Balykov [Thu, 19 Dec 2024 11:35:21 +0000 (14:35 +0300)]
[Tizen] Disable W^X for all architectures
Gleb Balykov [Fri, 20 Dec 2024 09:56:20 +0000 (12:56 +0300)]
[Tizen] Add coreclr skips for RPI4 for arm64
These are mostly a subset of src/tests/issues.targets or marked by <GCStressIncompatible>true</GCStressIncompatible> in csproj with some additional excludes:
- readytorun/r2rdump/FrameworkTests/R2RDumpTests/R2RDumpTests is excluded because System.Private.CoreLib.dll is not a r2r image in default mode
Gleb Balykov [Fri, 20 Dec 2024 09:54:00 +0000 (12:54 +0300)]
[Tizen] Fix tests that require SuperFileCheck (x64/arm64 only)
Gleb Balykov [Tue, 24 Dec 2024 08:38:47 +0000 (11:38 +0300)]
[Tizen] Remove not-working workflows
ashaurtaev [Thu, 19 Dec 2024 08:26:01 +0000 (11:26 +0300)]
[Tizen] Reduce arm_phdr_cb call overhead
- Too many calls to arm_phdr_cb even though it get the same data.
- It caches an ARM_CB_DATA for libcoreclr.so, then reuse.
Co-authored-by: dheon-jung <dheon.jung@samsung.com>
Raphtaliyah [Thu, 16 Nov 2023 14:39:13 +0000 (15:39 +0100)]
Fix build issues with clang18 (#94782)
* Fixed build issues with clang18
* Convert use of VLAs to alloca
* Enable warnings for VLAs
* Convert VLA to alloca in Apple specific code
Timur Mustafin [Thu, 5 Dec 2024 23:09:16 +0000 (02:09 +0300)]
[Tizen] Add clang19 to init-compiler.sh
Adeel Mujahid [Tue, 5 Nov 2024 18:11:35 +0000 (20:11 +0200)]
Conditionally check the compiler flags in libs.native (#109228)
Adeel Mujahid [Sat, 20 Jul 2024 16:53:40 +0000 (19:53 +0300)]
Fix clang19 build (#105141)
Gleb Balykov [Sat, 14 Dec 2024 22:26:07 +0000 (01:26 +0300)]
[Tizen] Further fix corefx tests
- reenable tests launch with sudo if it's requested for System.IO.Pipes.Tests, System.Net.Ping.Functional.Tests, System.Diagnostics.Process, System.Formats.Tar due to sudo being available now for latest Tizen
- reenable tests requiring sudo for System.IO.FileSystem.Tests due to sudo being available now for latest Tizen
Gleb Balykov [Thu, 21 Nov 2024 14:31:46 +0000 (17:31 +0300)]
[Tizen] Update riscv64 unsupported coreclr tests
Reenable crossgen2 tests
Gleb Balykov [Thu, 21 Nov 2024 13:14:55 +0000 (16:14 +0300)]
[Tizen] Fix self-contained crossgen2 build for x64
이형주/MDE Lab(SR)/삼성전자 [Thu, 14 Nov 2024 05:47:30 +0000 (14:47 +0900)]
[Tizen] Bypass GBS build fail for exitcode 143 (#637)
Gleb Balykov [Sun, 27 Oct 2024 12:23:40 +0000 (15:23 +0300)]
[Tizen] Add more coreclr skips for riscv64 (BPI-F3)
These tests are gcstress incompatible
Sync aug24 release/8.0-tizen (#595)
* [RISC-V] Add crossgen2 for riscv64 (#95188)
* Add crossgen2 for riscv64
* Fix review comments
* Fix review
* [RISC-V] Enable R2RDump (#97156)
* [RISC-V] Fix errors in crosgen2 for risc-v (#97368)
* [RISC-V] Fix crossgen2
* [RISC-V] Fix typo in codegen
* [RISC-V] Update assert to support all rel insts
* [RISC-V] Fix helper function call
* [RISC-V] Update GetRISCV64PassStructInRegisterFlags
* [RISC-V] Fix int arg reg passing for float type
A failure during crossgen2 SPC.dll
`System.Diagnostics.Tracing.NativeRuntimeEventSource:LogThreadPoolWorkerThreadAdjustmentStats(double,double,double,double,double,double,double,double,double,ushort,ushort)`
* [RISC-V] Update EPILOG_WITH_TRANSITION_BLOCK_RETURN
* [RISC-V] Update indentation in dump
* [RISC-V] Fix stubs
* [RISC-V] Fix virtualcallstubcpu
* [RISC-V] Update a comment
* [RISC-V] Update RO data block
* [RISC-V] Fix data overwrites
* [RISC-V] Fix typo
* [RISC-V] Fix register number of A3
* [RISC-V] Code Formatting
* [RISC-V] Fix format and typos
* Revert "[RISC-V] Fix int arg reg passing for float type"
This reverts commit
381858cb2335782d66e8a6439db9c6f053adff21.
* [RISC-V] Fix a typo in a comment
* [RISC-V] Fix error when arg type and arg reg mismatch
* [RISC-V] Rename according to review
* [LoongArch64] Remove LA64 specific handling for unspilling
* Enable riscv64 R2R in installer (#96941)
* [RISC-V] R2RDump to handle System.Private.CoreLib (#98849)
* Add missing codes for RISC-V to enable R2RDump'ing unwind and gcInfo
* Handle decode failures from coredistools in R2RDump instead of getting stuck in an infinite loop
* Remove unused dll import DumpCodeBlock
* [RISC-V] Enable crossgen for corelib (#99436)
* [RISC-V] Fix alignment for vector types (#99589)
For vector256 and vector512, set possible max alignment value.
Reference
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc
* Update Architecture to unknown machine (#101038)
* Update Architecture to unknown machine
* Update src/tools/illink/src/linker/Linker.Steps/OutputStep.cs
Suggested by @am11. Thank you.
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
---------
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* [RISC-V] Simplify flags for passing struct in registers (#100080)
* [RISC-V] Fix struct info value in crossgen2
* [RISC-V] Fix assertion in crossgen
Asserts in `./Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutExp/MarshalStructAsLayoutExp.sh`
Error message is
`Assertion failed 'roundUp(structSize, TARGET_POINTER_SIZE) == roundUp(loadExtent, TARGET_POINTER_SIZE)' in 'Managed:MarshalStructAsParam_AsExpByVal(int)' during 'Morph - Global' (IL size 2208; hash 0x9fd9734a; MinOpts)`
Copied missed codes of GetRiscV64PassStructInRegiste in vm to crossgen2
* Check size in GetRiscV64PassStructInRegisterFlags early, use named constant
* Simplify managed branch of GetRiscV64PassStructInRegisterFlags
* Fix assert IsPrimitiveType for 2nd field
* Handle empty structs
* Apply FIELD_SIZE_IS8 flags only when there's at least one float
* Handle empty array struct elements
* Enregister any field type <= 8 bytes, not just primitives; i.e. pointers and refs are also OK
* Simplify native layout branch of GetRiscV64PassStructInRegisterFlags
* Rewrite native branch to look at only at native layout info
* Calculate flags already in GetFlattenedFieldTypes to avoid returning fake CorElementTypes from native branch
* Ignore empty structs during field flattenting because RISC-V calling convention tells us to
* Simplify crossgen2 GetRISCV64PassStructInRegisterFlags, make C++ and C# versions of this method look more alike
* Remove early exit if nFields == 0 because it wasn't doing much, the loop won't do any work if there's no fields
* Return early from HasImpliedRepeatedFields. GetApproxFieldDescListRaw() is null on empty structs, which crashes pFieldStart->GetFieldType()
* Cleanup GetRiscV64PassStructInRegisterFlags call sites
* Stackalloc field types to avoid GC allocations
---------
Co-authored-by: Dong-Heon Jung <clamp03@gmail.com>
* [RISC-V] Add quirks for riscv to R2RDump (#101683)
* [RISC-V] Add quirks for riscv
* [RISC-V] minimize code
* [LoongArch64] Fix the `ArgIteratorTemplate::GetNextOffset()` return argOfs for 'ELEMENT_TYPE_VALUETYPE' which is flattened liking struct{Arr[], float}. (#103108)
* [LoongArch64] Fix the `ArgIteratorTemplate::GetNextOffset()` return argOfs for 'ELEMENT_TYPE_VALUETYPE' which is flattened liking struct{Arr[], float}.
* The 'ELEMENT_TYPE_VALUETYPE' is marked to 'TYPE_GC_OTHER' and the first flattened element Arr[] should GC.
* This also fixed the assert failure "!CREATE_CHECK_STRING(pMT && pMT->Validate())" under GC=8 of MarshalStructAsLayoutSeq.sh.
* Update callingconvention.h
delete redundancy condition.
* Fix ArgIteratorTemplate::GetNextOffset() for struct{Arr[], float} (#103125)
* fix ping with TTL on Linux (#99875)
* fix ping with TTL on Linux
* feedback
* feedback
* [RISC-V] Set proper options for connected IPv6 raw socket (#103127)
Before this change we get following failure from PingTest.SendPingWithIPAddres:
System.Net.NetworkInformation.PingException : An exception occurred during a Ping request.\n---- System.Net.Sockets.SocketException : Protocol not available
at System.Net.NetworkInformation.Ping.Send(IPAddress address, Int32 timeout, Byte[] buffer, PingOptions options) in /runtime/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.cs:line 411
at System.Net.NetworkInformation.Ping.Send(IPAddress address, Int32 timeout, Byte[] buffer) in /runtime/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.cs:line 319
at System.Net.NetworkInformation.Ping.Send(IPAddress address, Int32 timeout) in /runtime/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.cs:line 258
at System.Net.NetworkInformation.Tests.PingTest.<>c__DisplayClass12_0.<SendPingWithIPAddress>b__0(Ping ping) in /runtime/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs:line 149
at System.Net.NetworkInformation.Tests.PingTest.SendPing(Func`2 sendPing, Action`1 pingResultValidator) in /runtime/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs:line 628
at System.Net.NetworkInformation.Tests.PingTest.SendBatchPing(Func`2 sendPing, Action`1 pingResultValidator) in /runtime/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs:line 611
at System.Net.NetworkInformation.Tests.PingTest.SendPingWithIPAddress(AddressFamily addressFamily) in /runtime/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs:line 148
at InvokeStub_PingTest.SendPingWithIPAddress(Object, Span`1)
In this patch we fix setsockopt error by adding extra handling of IPv6 case.
* Fix sending ICMP echo request when host is unreachable (#103158)
Before this change we get following failure from PingTest.SendPingToExternalHostWithLowTtlTest:
System.Net.NetworkInformation.PingException : An exception occurred during a Ping request.
---- System.Net.Sockets.SocketException : No route to host
Stack Trace:
/runtime/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.cs(729,0): at System.Net.NetworkInformation.Ping.SendPingAsyncInternal[TArg](TArg getAddressArg, Func`3 getAddress, Int32 timeout, Byte[] buffer, PingOptions options, CancellationToken cancellationToken)
/home/d.jurczak2/runtime/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs(743,0): at System.Net.NetworkInformation.Tests.PingTest.SendPingToExternalHostWithLowTtlTest()
--- End of stack trace from previous location ---
----- Inner Stack Trace -----
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs(1395,0): at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.CreateException(SocketError error, Boolean forAsyncThrow)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs(1097,0): at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ReceiveFromAsync(Socket socket, CancellationToken cancellationToken)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs(423,0): at System.Net.Sockets.Socket.ReceiveFromAsync(Memory`1 buffer, SocketFlags socketFlags, EndPoint remoteEndPoint, CancellationToken cancellationToken)
/runtime/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.RawSocket.cs(334,0): at System.Net.NetworkInformation.Ping.SendIcmpEchoRequestOverRawSocketAsync(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options)
/runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs(38,0): at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at System.Net.NetworkInformation.Ping.SendIcmpEchoRequestOverRawSocketAsync(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options)
/runtime/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.Unix.cs(32,0): at System.Net.NetworkInformation.Ping.SendPingAsyncCore(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options)
/runtime/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.cs(721,0): at System.Net.NetworkInformation.Ping.SendPingAsyncInternal[TArg](TArg getAddressArg, Func`3 getAddress, Int32 timeout, Byte[] buffer, PingOptions options, CancellationToken cancellationToken)
/runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs(292,0): at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncS
In this patch we add HostUnreachable handling to SendIcmpEchoRequestOverRawSocketAsync
and fix getting empty message from error queue.
* Fix alloc-dealloc mismatch in GC (#102929)
* Fix alloc-dealloc mismatch
* Fix few more alloc-dealloc mismatch in GC
* [RISC-V] Disable EnableWriteXorExecute by default on riscv64 architectue (#103408)
* Disable EnableWriteXorExecute by default on riscv64 architectue
On riscv64 architectue any dotnet process that loads corossgened assembly
without DOTNET_EnableWriteXorExecute=0 environment variable set
crashes with "Segmentation fault" error.
For example System.Private.CoreLib.dll is compiled with crossgen2 by default
during build phase so this crash applies to any processes that loads it.
Setting EnableWriteXorExecute=0 disables this options on riscv64 architecure
and prevents these crashes.
Co-authored-by: Dong-Heon Jung <clamp03@gmail.com>
* Add a link to an issue about re-enabling WriteXorExecute on riscv64 arch.
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
---------
Co-authored-by: Dong-Heon Jung <clamp03@gmail.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Fix nonvolatile context restoration (#101709)
* Fix nonvolatile context restoration
There is a possibility of a race between the
ClrRestoreNonVolatileContext and an async signal handling (like
the one we use for runtime suspension). If the signal kicks in after
we've loaded Rsp, but before we jumped to the target address, the
context we are loading the registers from could get overwritten by the
signal handler stack. So the ClrRestoreNonVolatileContext would end up
jumping into a wrong target address.
The fix is to load the target address into a register before loading the
Rsp and then jumping using the register.
* Fix arm and x86
* [RISC-V] Fix context restoration as #101709 describes (#101865)
* [RISCV-V] Fix context restoration as 101709
* Feedback
* [x64][SysV] Classify empty structs for passing like padding (#103799)
The current implementation barred a struct containing empty struct fields from enregistration. This did not match the [System V ABI](https://refspecs.linuxbase.org/elf/x86_64-abi-0.99.pdf) which says "NO_CLASS This class is used as initializer in the algorithms. It will be used for padding and **empty structures** and unions". It also does not match the behavior of GCC & Clang on Linux.
* [RISC-V] Fix coreclr test readytorun/coreroot_determinism/coreroot_determinism/coreroot_determinism.sh (#104140)
To make test passing we increase TimeoutMilliseconds to 30 min.
* Fix alpine-riscv64 build (#104920)
* [RISC-V] Fix System.Net.Sockets.Tests on Qemu (#104094)
* [RISC-V] Fix System.Net.Sockets.Tests on Qemu
Before this change there are 8 failures from System.Net.Sockets.Tests with following reports:
root@
69fa7050f168:/runtime/artifacts/bin/System.Net.Sockets.Tests/Release/net9.0-unix# /runtime/artifacts/bin/testhost/net9.0-linux-Release-riscv64/dotnet exec --runtimeconfig System.Net.Sockets.Tests.runtimeconfig.json --depsfile System.Net.Sockets.Tests.deps.json xunit.console.dll System.Net.Sockets.Tests.dll -xml testResults.xml -nologo -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -notrait category=failing -maxthreads 32
Discovering: System.Net.Sockets.Tests (method display = ClassAndMethod, method display options = None)
Discovered: System.Net.Sockets.Tests (found 1672 of 1820 test cases)
Starting: System.Net.Sockets.Tests (parallel test collections = on [32 threads], stop on fail = off)
System.Net.Sockets.Tests.CreateSocket.Ctor_Raw_NotSupported_ExpectedError [SKIP]
Condition(s) not met: "NotSupportsRawSockets"
System.Net.Sockets.Tests.KeepAliveTest.Socket_Get_KeepAlive_Time_AsByteArray_OptionLengthZero_Failure [FAIL]
System.Net.Sockets.SocketException : Bad address
Stack Trace:
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3737,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3728,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketOptionErrorAndThrowException(SocketError error, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(2145,0): at System.Net.Sockets.Socket.GetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionLength)
/home/d.jurczak2/runtime/src/libraries/System.Net.Sockets/tests/FunctionalTests/KeepAliveTest.cs(136,0): at System.Net.Sockets.Tests.KeepAliveTest.Socket_Get_KeepAlive_Time_AsByteArray_OptionLengthZero_Failure()
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
/runtime/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
System.Net.Sockets.Tests.ArgumentValidation.Connect_ConnectTwice_NotSupported(invalidatingAction: 1) [FAIL]
System.Net.Sockets.SocketException : Protocol not available
Stack Trace:
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3737,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3728,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketOptionErrorAndThrowException(SocketError error, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3466,0): at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue, Boolean silent)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(1966,0): at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue)
/home/d.jurczak2/runtime/src/libraries/System.Net.Sockets/tests/FunctionalTests/ArgumentValidationTests.cs(809,0): at System.Net.Sockets.Tests.ArgumentValidation.Connect_ConnectTwice_NotSupported(Int32 invalidatingAction)
at InvokeStub_ArgumentValidation.Connect_ConnectTwice_NotSupported(Object, Span`1)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
System.Net.Sockets.Tests.SocketOptionNameTest.MulticastInterface_Set_AnyInterface_Succeeds [FAIL]
System.Net.Sockets.SocketException : Unknown socket error
Stack Trace:
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3737,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3728,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketOptionErrorAndThrowException(SocketError error, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3479,0): at System.Net.Sockets.Socket.SetMulticastOption(SocketOptionName optionName, MulticastOption MR)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(2021,0): at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Object optionValue)
/home/d.jurczak2/runtime/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs(96,0): at System.Net.Sockets.Tests.SocketOptionNameTest.MulticastInterface_Set_Helper(Int32 interfaceIndex)
/home/d.jurczak2/runtime/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs(71,0): at System.Net.Sockets.Tests.SocketOptionNameTest.MulticastInterface_Set_AnyInterface_Succeeds()
--- End of stack trace from previous location ---
System.Net.Sockets.Tests.KeepAliveTest.Socket_Get_KeepAlive_Time_AsByteArray_BufferNullOrTooSmall_Failure(buffer: null) [FAIL]
System.Net.Sockets.SocketException : Bad address
Stack Trace:
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3737,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3728,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketOptionErrorAndThrowException(SocketError error, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(2121,0): at System.Net.Sockets.Socket.GetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Byte[] optionValue)
/home/d.jurczak2/runtime/src/libraries/System.Net.Sockets/tests/FunctionalTests/KeepAliveTest.cs(156,0): at System.Net.Sockets.Tests.KeepAliveTest.Socket_Get_KeepAlive_Time_AsByteArray_BufferNullOrTooSmall_Failure(Byte[] buffer)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
/runtime/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(178,0): at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
System.Net.Sockets.Tests.KeepAliveTest.Socket_Get_KeepAlive_Time_AsByteArray_BufferNullOrTooSmall_Failure(buffer: []) [FAIL]
System.Net.Sockets.SocketException : Bad address
Stack Trace:
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3737,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3728,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketOptionErrorAndThrowException(SocketError error, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(2121,0): at System.Net.Sockets.Socket.GetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Byte[] optionValue)
/home/d.jurczak2/runtime/src/libraries/System.Net.Sockets/tests/FunctionalTests/KeepAliveTest.cs(156,0): at System.Net.Sockets.Tests.KeepAliveTest.Socket_Get_KeepAlive_Time_AsByteArray_BufferNullOrTooSmall_Failure(Byte[] buffer)
at InvokeStub_KeepAliveTest.Socket_Get_KeepAlive_Time_AsByteArray_BufferNullOrTooSmall_Failure(Object, Span`1)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
System.Net.Sockets.Tests.SocketOptionNameTest.MulticastOption_CreateSocketSetGetOption_GroupAndInterfaceIndex_SetSucceeds_GetThrows [FAIL]
System.Net.Sockets.SocketException : Unknown socket error
Stack Trace:
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3737,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3728,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketOptionErrorAndThrowException(SocketError error, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3479,0): at System.Net.Sockets.Socket.SetMulticastOption(SocketOptionName optionName, MulticastOption MR)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(2021,0): at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Object optionValue)
/home/d.jurczak2/runtime/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs(61,0): at System.Net.Sockets.Tests.SocketOptionNameTest.MulticastOption_CreateSocketSetGetOption_GroupAndInterfaceIndex_SetSucceeds_GetThrows()
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
/runtime/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
System.Net.Sockets.Tests.SocketOptionNameTest.MulticastInterface_Set_IPv6_AnyInterface_Succeeds [FAIL]
System.Net.Sockets.SocketException : Protocol not available
Stack Trace:
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3737,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3728,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketOptionErrorAndThrowException(SocketError error, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3466,0): at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue, Boolean silent)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(1966,0): at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue)
/home/d.jurczak2/runtime/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs(199,0): at System.Net.Sockets.Tests.SocketOptionNameTest.MulticastInterface_Set_IPv6_Helper(Int32 interfaceIndex)
/home/d.jurczak2/runtime/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs(129,0): at System.Net.Sockets.Tests.SocketOptionNameTest.MulticastInterface_Set_IPv6_AnyInterface_Succeeds()
--- End of stack trace from previous location ---
System.Net.Sockets.Tests.ArgumentValidation.ConnectAsync_ConnectTwice_NotSupported(invalidatingAction: 1) [FAIL]
System.Net.Sockets.SocketException : Protocol not available
Stack Trace:
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3737,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3728,0): at System.Net.Sockets.Socket.UpdateStatusAfterSocketOptionErrorAndThrowException(SocketError error, String callerName)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(3466,0): at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue, Boolean silent)
/runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs(1966,0): at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue)
/home/d.jurczak2/runtime/src/libraries/System.Net.Sockets/tests/FunctionalTests/ArgumentValidationTests.cs(842,0): at System.Net.Sockets.Tests.ArgumentValidation.ConnectAsync_ConnectTwice_NotSupported(Int32 invalidatingAction)
at InvokeStub_ArgumentValidation.ConnectAsync_ConnectTwice_NotSupported(Object, Span`1)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Finished: System.Net.Sockets.Tests
=== TEST EXECUTION SUMMARY ===
System.Net.Sockets.Tests Total: 2874, Errors: 0, Failed: 8, Skipped: 1, Time: 139.280s
Those failures are caused by Qemu's buggy and/or implementation defined behavior like:
https://gitlab.com/qemu-project/qemu/-/issues/2410
https://gitlab.com/qemu-project/qemu/-/issues/2390
https://gitlab.com/qemu-project/qemu/-/issues/1837
In this patch we add couple of workarounds to make all System.Net.Sockets.Tests passing.
---------
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* [RISC-V] Fix passing float and uint arguments in VM (#105021)
* Add tests
* Fix passing float and uint arguments in VM
* Change test lib name so it doesn't clash with managed DLL on Windows
* Disable execution of two WorkingSet tests on QEMU (#105689)
System.Diagnostics.Tests.ProcessTests.TestMaxWorkingSet()
System.Diagnostics.Tests.ProcessTests.TestMinWorkingSet()
These two corefx tests fail because on QEMU the file /proc/pid/stat
contains incorrect values.
See issue #105686 for details.
* Fix _LOGALLOC define (#106023)
* [RISC-V][LoongArch64] HijackFrame::UpdateRegDisplay restore A0 (#106018)
* [RISC-V] Fix Reg Order for Float Registers (#105930)
* [RISC-V] Fix coreroot_determinism in release build
Initialize regOrder and put all floating registers in REG_VAR_ORDER_FLT
* [RISC-V] Update GetLocalFloatingPointValue for RISC-V
* [RISC-V] System.Console CancelKeyPressTests.ExitDetectionNotBlockedByHandler increase timeout (#106119)
* Increase timeout to prevent failure of CancelKeyPressTests.ExitDetectionNotBlockedByHandler on Debug RISC-V
* Make WaitFailTestTimeoutSeconds static, move it closer to where it's used
* [RISC-V] JitDisasmWithGC: Output any delta in GC info (#106196)
* [RISC-V] Add GetRegOffsInCONTEXT() implementation (fix for `clrstack -p` SOS command). (#106277)
* [RISC-V] Fix GenerateResolveStub (#106562)
Fix to allow use of fast cached way.
* Fix alloc-dealloc mismatch (#106957)
* [Tizen] Fix build cause SDK does not know Riscv64
On reverting this #97021 should be picked.
---------
Co-authored-by: Aleksandr Shaurtaev <38426614+ashaurtaev@users.noreply.github.com>
Co-authored-by: Tomasz Sowiński <tomeksowi@gmail.com>
Co-authored-by: Dong-Heon Jung <clamp03@gmail.com>
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: SzpejnaDawid <166010737+SzpejnaDawid@users.noreply.github.com>
Co-authored-by: Xu Liangyu <xuliangyu@loongson.cn>
Co-authored-by: Tomas Weinfurt <tweinfurt@yahoo.com>
Co-authored-by: yurai007 <dawid_jurek@vp.pl>
Co-authored-by: Gleb Balykov <g.balykov@samsung.com>
Co-authored-by: rzsc <160726116+rzsc@users.noreply.github.com>
Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
Co-authored-by: t-mustafin <66252296+t-mustafin@users.noreply.github.com>
Co-authored-by: Mikhail Kurinnoi <m.kurinnoi@samsung.com>
Gleb Balykov [Thu, 5 Sep 2024 13:33:09 +0000 (16:33 +0300)]
[Tizen] Add more coreclr skips for armel (RPI4)
These are tests from src/tests/issues.targets
Gleb Balykov [Wed, 7 Aug 2024 10:33:40 +0000 (13:33 +0300)]
[Tizen] Fix typo in coreclr skips for armel (RPI4) and riscv64 (VisionFive2)
Jan Kotas [Fri, 26 Jul 2024 05:57:44 +0000 (22:57 -0700)]
Use ConcurrentDictionary in runtimecounters test (#105520)
* Use ConcurrentDictionary in runtimecounters test
Fixes #105443
* Fix build break
Mikhail Kurinnoi [Tue, 2 Jul 2024 16:12:53 +0000 (19:12 +0300)]
[Tizen] Enable HotReload feature for RISCV64.
t-mustafin [Sun, 23 Jun 2024 15:24:45 +0000 (18:24 +0300)]
[RISC-V] Add RiscV64 arch to tests/JIT/Stress/ABI/ (#103830)
Gleb Balykov [Mon, 24 Jun 2024 10:57:14 +0000 (13:57 +0300)]
[RISC-V] Add riscv64 arch to tracing/eventpipe/processinfo tests (#103832)
* Add riscv64 arch to tracing/eventpipe/processinfo tests
* Add loongarch64 to tracing/eventpipe/processinfo tests
* Unify architecture identification in tracing/eventpipe/processinfo tests
Gleb Balykov [Sun, 14 Jul 2024 13:14:12 +0000 (16:14 +0300)]
[Tizen] Add more coreclr skips for armel (RPI4) and riscv64 (VisionFive2)
These tests are gcstress incompatible
[Tizen] Microsoft.Diagnostics.Tracing.TraceEvent version up (#548)
* [Tizen] Microsoft.Diagnostics.Tracing.TraceEvent version up
* Bump Microsoft.Win32.Registry dependency version
Needs to fix build fail:
/home/abuild/rpmbuild/BUILD/coreclr-8.0.0/src/coreclr/tools/r2rtest/R2RTest.csproj : error NU1603: Warning As Error: Microsoft.Diagnostics.Tracing.TraceEvent 3.1.7 depends on Microsoft.Win32.Registry (>= 4.4.0) but Microsoft.Win32.Registry 4.4.0 was not found. An approximate best match of Microsoft.Win32.Registry 4.7.0 was resolved. [/home/abuild/rpmbuild/BUILD/coreclr-8.0.0/Build.proj]
Gleb Balykov [Fri, 12 Jul 2024 16:42:00 +0000 (19:42 +0300)]
[Tizen] Add more coreclr skips for armel (RPI4) and riscv64 (VisionFive2)
This test is not supported in release
Gleb Balykov [Wed, 24 Jul 2024 14:19:09 +0000 (17:19 +0300)]
[RISC-V] Increase timeout for tracing/eventcounter/runtimecounters (#104461)
* Increase timeout for tracing/eventcounter/runtimecounters
This test expects that all runtime counters are already prepared when timeout has passed,
however, it might be untrue for debug/checked builds and for VisionFive2 (riscv64).
* Check if event are already prepared each second (60 seconds max)
Timur Mustafin [Fri, 5 Jul 2024 10:47:56 +0000 (13:47 +0300)]
[Tizen] Fix out_of_range_fp_to_int_conversions test
Use CONVERT_SATURATING as default convertion type instead of CONVERT_MANAGED_BACKWARD_COMPATIBLE_X86_X64.
Gleb Balykov [Thu, 4 Jul 2024 10:00:27 +0000 (13:00 +0300)]
[Tizen] Add more coreclr skips for armel (RPI4) and riscv64 (VisionFive2)
These are tests from src/tests/issues.targets
Timur Mustafin [Thu, 4 Jul 2024 14:21:57 +0000 (17:21 +0300)]
[Tizen] Skip Runtime_56953
Runtime_56953 test exists in src/tests/issues.targets and fails with DOTNET_TieredCompilation=0.
최종헌/MDE Lab(SR)/삼성전자 [Sun, 9 Jun 2024 21:15:12 +0000 (06:15 +0900)]
[Tizen] Fix crossgen2 mic build (#517)
Mikhail Kurinnoi [Fri, 31 May 2024 12:09:31 +0000 (15:09 +0300)]
[RISC-V] Add gcinfodumper implementation.
Port from `runtime` upstream https://github.com/dotnet/runtime/pull/102920
Sync may31 release/8.0-tizen (#510)
* [RISC-V] Enable On Stack Replacement (#96558)
* [RISC-V] Implement On Stack Replacement
Note: Pinned local test is failing.
* [RISC-V] Apply suggestions from code review
Co-authored-by: Tomasz Sowiński <tomeksowi@gmail.com>
* [RISC-V] apply jit-format
* [RISC-V] Cosmetic changes after code review
* [RISC-V] Changes assuming memory page is always equal 4KiB
* [RISC-V] Remove stack probing
* [RISC-V] Replace GetEmitter() with emit
* [RISC-V] Sync frame type 1 in genPushCalleeSavedRegisters with genPopCalleeSavedRegisters
* [RISC-V] Fix assembly emmited by genStackProbe
* [RISC-V] Apply jit-formatter
---------
Co-authored-by: Tomasz Sowiński <tomeksowi@gmail.com>
* [RISC-V] Added designated output instruction emitters (#96741)
* Added declarations and r-type definition with assert helper
* Added insEncodeITypeInstr
* Added definition of S type instr
* Added definition of U type instr
* Added definition of B type instr
* Added definition of J type instr
* Restructurized bit operations
* Improved checks in insEncode functions
* Fixed some of the encoding methods
* Bugfix
* Fixed comparation sign
* Revert "Fixed comparation sign"
This reverts commit
c238b82cf939c19ed55ce9e027fcaf4def6ba064.
* Fixed comparation sign
* Reverted changes in emitOutputInstrJumpDistanceHelper
* Fixed misspell
* Fixes after review
* Fixes in insEncodeJTypeInstr
* Added emitOutput_RTypeInstr
* Added emitOutput_ITypeInstr
* Added emitOutput_STypeInstr
* Added emitOutput_UTypeInstr
* Added emitOutput_BTypeInstr
* Added emitOutput_JTypeInstr
* Fixes in emitOutput_ methods
* Replaced reloc with new code
* Removed invalid code
* Added emit output rellocation
* Minor changes
* Added emitOutputInstr_Addi8
* Implemented further addi32
* Reverted changes from la
* Fixed format bug
* Fixed comment
* Renamed some of the emitters
* Added some comments
* Improved implementation and finished addi32
* Microimprovements
* Quickfix to upperNBitsOfWord
* Finished substituting instr_optsi
* Fixed bug in mask
* Added emitOutputInstr_OptsRcReloc and prelimiary parent function
* Added emitOutput_OptsRcNoReloc
* Improvements in OptsRc
* Fixes and introduced an emitOutputInstr_OptsRc
* Added emitOutputInstr_OptsRl and removed unused args from other functions
* Added emitOutputInstr_OptsRlReloc
* Finished emitOutputInstr_OptsRcNoReloc
* Fixed bugs and finished opts rl
* Added emitOutputInstr_OptsJalr
* Added emitOutputInstr_OptsJalr8
* Added special comparation inverter
* Add emitOutputInstr_OptsJalr24
* Added emitOutputInstr_OptsJalr28
* Improved emitOutputInstr_OptsJalr28
* Enabled new opts jalr impl
* Added emitOutputInstr_OptsJCond
* Added emitOutputInstr_OptsJ
* Replaced old code with the new one
* Added emitOutputInstr_OptsC
* Fixed last piece of switch
* Removed old code
* Simplified code
* Other fixes
* Fixes in emitOutput_* instr
* Fixed bitmask bug
* Added temporary reinforced assers
* Added shift ins
* Improved shift func
* Inserted shift func
* Fixed minor bug
* Other fixes
* Added checks to r type emitter
* Improved sanity checks in the emitOutput_RTypeInstr
* Added ITypeInstr sanity checks
* Moved ITypeInstr_Shift sanity Check
* Added comment to the emitriscv64
* Added S-type sanity checks
* Removed Shift ITypeInstr Variant
* Fixes
* Added BType sanity check
* Added csr operations to sanity checks
* Added ITypeInstr sanity check
* Fixes
* Removed duplicated code
* Fixed bug in noreloc
* Removed dead asserts
* Removed now unused asserts
* Fixed format
* Fixed missing const
* Removed useless ifdef
* Fixed missing asserts
* Added a new assert
* Added zero assert
* Removed useless FALLTHROUGH statements
* Added trimmers
* Added explicit signed integers trimming
* Fixes to prev commit
* Added castFloatOrIntegralReg and fixed invalid asserts
* Renamed upper word helpers
* Spell fix
* Moved castFloat... to the emitter
* Changes after code review
* Removed bitcast
* Added additional check
* Removed unnecessary reinterpret casts
* Removed redundant asserts
---------
Co-authored-by: Grzegorz Czarnecki <g.czarnecki@samsung.com>
* [RISC-V] Fix errors in crosgen2 for risc-v (#97368)[PARTIALLY]
Partially cherry-picked commit: jit, pal, vm parts. Tools part need to be cherry-picked further.
* [RISC-V] Fix crossgen2
* [RISC-V] Fix typo in codegen
* [RISC-V] Update assert to support all rel insts
* [RISC-V] Fix helper function call
* [RISC-V] Update GetRISCV64PassStructInRegisterFlags
* [RISC-V] Fix int arg reg passing for float type
A failure during crossgen2 SPC.dll
`System.Diagnostics.Tracing.NativeRuntimeEventSource:LogThreadPoolWorkerThreadAdjustmentStats(double,double,double,double,double,double,double,double,double,ushort,ushort)`
* [RISC-V] Update EPILOG_WITH_TRANSITION_BLOCK_RETURN
* [RISC-V] Update indentation in dump
* [RISC-V] Fix stubs
* [RISC-V] Fix virtualcallstubcpu
* [RISC-V] Update a comment
* [RISC-V] Update RO data block
* [RISC-V] Fix data overwrites
* [RISC-V] Fix typo
* [RISC-V] Fix register number of A3
* [RISC-V] Code Formatting
* [RISC-V] Fix format and typos
* Revert "[RISC-V] Fix int arg reg passing for float type"
This reverts commit
381858cb2335782d66e8a6439db9c6f053adff21.
* [RISC-V] Fix a typo in a comment
* [RISC-V] Fix error when arg type and arg reg mismatch
* [RISC-V] Rename according to review
* [LoongArch64] Remove LA64 specific handling for unspilling
* [RISC-V] Fix gc-related bugs in risc-v emitter (#98226)
* [RISC-V] Fix mistakes in emitter
* Revert "[RISC-V] Added designated output instruction emitters (#96741)"
This reverts commit
77fd98c8fb245b30b24b8eeaf577b0a457a4449c.
* Revert "Revert "[RISC-V] Added designated output instruction emitters (#96741)""
This reverts commit
ecc044d4e6082c0f727bd7e36d53878416cf4207.
* [RISC-V] Sync emitOutputIns with the latest ref branch
* [RISC-V] Formatted code
* [RISC-V] Fixes
* [RISC-V] Fixed sign cast in assert code len
* [RISC-V] Readed assert
* [RISC-V] Fixed fence sanity check and removed fence_i
---------
Co-authored-by: Dong-Heon Jung <clamp03@gmail.com>
* [RISC-V] Set setFrameRequired like the other archs (#98535)
* [RISC-V] Remove unnecessary assertion from emitOutputInstr (#98484)
* Remove unnecessary assertion
It fired a false positive when W^X was enabled
* Use uint32 write instead of memcpy to be faster
There shouldn't be a problem when we introduce compressed instructions, VF2 supports unaligned stores (sw)
Also, replace compile-time conditions with static_asserts.
* Bring back memcpy because plain RV64 ISA allows trapping on misaligned load/stores
* [RISC-V] Check DivideByZeroException before generating check for unsigned div/mod (#98648)
* Generate check for unsigned divide by zero only when ExceptionSetFlags::DivideByZeroException is present
Not doing so caused JITting on FullOpts fail on assert(add->acdUsed) in genJumpToThrowHlpBlk_la when the DivByZero check was optimized out as a result of #98113
* Change check for GT_DIV or GT_MOD in LSRA to look the same as CodeGen::genCodeForDivMod
* Don't set RM field when fcvt doesn't round (#98857)
CPUs and QEMU tend to ignore it but according to RISC-V ISA fcvt.d.s or fcvt.d.w[u] never round so it is an error. Besides, external disassemblers choke on it.
* Remove redundant check for DivideByZeroException for unsigned division/modulo. (#99228)
The check was already generated at the beginning of the branch for integer operations.
* [RISC-V] Use getUnrollThreshold() to get unroll limits (#98798)
* [RISC-V] Use getUnrollThreshold() to get unroll limits
* Modify formatting
---------
Co-authored-by: monstercat <45393763+monstercatss@users.noreply.github.com>
* [RISC-V] Fix calculating remainingSPSize (#99288)
* [RISC-V] Fix initReg usage in genPushCalleeSavedRegisters (#99353)
* [RISC-V] Fix bug in crossgen2 (#99394)
* [RISC-V] Fix alignment for vector types (#99589) [PARTIALLY]
Partially cherry-pick: vm & libraries take, tools need to be picked further due to dependency on #95188, which cause build error.
For vector256 and vector512, set possible max alignment value.
Reference
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc
Revert tools part of "[RISC-V] Fix alignment for vector types (#99589)"
* [RISC-V] Avoid using native layout info to calculate register flags for small structs where possible (#97877)
* Remove initializing native layout info for small structs during type load
Managed->managed calling convention should not depend on native info which is used for interop marshalling with unmanaged code which is above the type loader.
* Don't use native layout in GetRiscV64PassStructInRegisterFlags unless we're calculating flags for a native value type
* Remove redundant assertions, AsNativeValueType() has the same
* Cover implied repeated fields, a.k.a fixed arrays, in when calculating small struct flags from non-native layout
* Cover implied repeated fields, a.k.a fixed arrays, also in non-native branch of IsRiscV64OnlyOneField
* [LoongArch64] Avoid using native layout info to calculate register flags for small structs where possible. (#99854)
* Also merge 'MethodTable::IsLoongArch64OnlyOneField()' and 'MethodTable::IsRiscV64OnlyOneField()' into 'MethodTable::IsOnlyOneField()'.
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* [RISC-V] Add missed instructions (#99948)
In genInstrWithConstant, loadType and zero-extends are missed.
- lbu, lhu and lwu
* LogicalName added for EmbeddedResource (#99999)
* LogicalName added for EmbeddedResource
* Disable test22888 on Mono
Mono does not support collectible assemblies that this test is exercising.
---------
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Add arch_info for TARGET_RISCV64 (#100341)
* [RISC-V] Fix intermittent failures due to unalignment access (#100431)
* [RISC-V] Fix intermittent failures due to unalignment access
* [RISC-V] Update for ALIGN_ACCESS
* Apply suggestions from code review
---------
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Enable tail call generation for test Runtime_87393 (#100593)
To pass the test needs to be built with --tailcalls compiler flag enabled.
* [RISC-V] Fix assertion for auipc and lui (#100578)
* [RISC-V] Fix assertion for auipc and lui
* [RISC-V] Update codegenriscv64
* [RISC-V] Remove an assert
* [RISC-V] Fixed printing jump destinations in disassembler on release (#100967)
* [RISC-V] Fixed printing jump destinations in release mode in disasm
* [RISC-V] Fixed cast type
* [RISC-V] Simplify flags for passing struct in registers (#100080)[PARTIALLY]
* [RISC-V] Fix struct info value in crossgen2
* [RISC-V] Fix assertion in crossgen
Asserts in `./Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutExp/MarshalStructAsLayoutExp.sh`
Error message is
`Assertion failed 'roundUp(structSize, TARGET_POINTER_SIZE) == roundUp(loadExtent, TARGET_POINTER_SIZE)' in 'Managed:MarshalStructAsParam_AsExpByVal(int)' during 'Morph - Global' (IL size 2208; hash 0x9fd9734a; MinOpts)`
Copied missed codes of GetRiscV64PassStructInRegiste in vm to crossgen2
* Check size in GetRiscV64PassStructInRegisterFlags early, use named constant
* Simplify managed branch of GetRiscV64PassStructInRegisterFlags
* Fix assert IsPrimitiveType for 2nd field
* Handle empty structs
* Apply FIELD_SIZE_IS8 flags only when there's at least one float
* Handle empty array struct elements
* Enregister any field type <= 8 bytes, not just primitives; i.e. pointers and refs are also OK
* Simplify native layout branch of GetRiscV64PassStructInRegisterFlags
* Rewrite native branch to look at only at native layout info
* Calculate flags already in GetFlattenedFieldTypes to avoid returning fake CorElementTypes from native branch
* Ignore empty structs during field flattenting because RISC-V calling convention tells us to
* Simplify crossgen2 GetRISCV64PassStructInRegisterFlags, make C++ and C# versions of this method look more alike
* Remove early exit if nFields == 0 because it wasn't doing much, the loop won't do any work if there's no fields
* Return early from HasImpliedRepeatedFields. GetApproxFieldDescListRaw() is null on empty structs, which crashes pFieldStart->GetFieldType()
* Cleanup GetRiscV64PassStructInRegisterFlags call sites
* Stackalloc field types to avoid GC allocations
---------
Co-authored-by: Dong-Heon Jung <clamp03@gmail.com>
* [RISC-V] Fix FEATURE_MULTIREG_RETURN definition (#101642)
* [RISC-V] fix rm field in riscvd instruction (#101908)
Changed rm from 1 to 0.
Fixed instructions:
- fcvt.d.w
- fcvt.w.d
- fcvt.d.wu
- fcvt.wu.d
- fcvt.d.s
- fcvt.s.d
* [LoongArch64] Simplify flags for passing struct in registers. (#102041)[PARTIALLY]
Partialli cherry-picked commit: took vm part, reject tools part which has only loongarch64 fixes.
Change-Id: Idbe644c0bc5baeb53a53e16731824e28aacf67a0
* [RISC-V] Support SV48 Virtual Memory Layout (#101966)
* Fix VirtualCallStubManager stats capturing on EE shutdown (#102073)
* Fix VirtualCallStubManager stats capturing on EE shutdown
Before this change logging stats to StubLog file doesn't work because on EE shutdown
we don't shut down manager. Since it's only about logging we can perform uninit earlier.
* Address code review comments
* Fix few gcc build warnings for RISC-V (#102426)
* [RISC-V] Fix invalid operand register in the emitted addition/subtraction code (#102074)
* [RISC-V] Added sext_w pseudoinstruction
* [RISC-V] Inserted INS_sext_w pseudoinstruction
* [RISC-V] Started implementing new overflow logic
* [RISC-V] Finished preliminar implementation of bound checks
* [RISC-V] Fixed invalid 32-bit instruction
* [RISC-V] Fixed 32-bit addition overflow check assert
* [RISC-V] More fixes in emitter
* [RISC-V] Additional fixes
* [RISC-V] Fixed triple same register problem in emitInsTernary addition and subtraction logic
* [RISC-V] Added sext.w to disassembler
* [RISC-V] Added comments
* [RISC-V] Formatted code
* [RISC-V] Fixed bug
* [RISC-V] Fixed other bug
* [RISC-V] Fixed bug causing the int32's version to never be emitted
* [RISC-V] Fixed assert
* [RISC-V] Improved comment
* [RISC-V] Fixed comment
* [RISC-V] Fixed temp reg acquiring
* [RISC-V] Removed asserts
* Fixed NodeInternalRegister's GetSingle method's comment
* [RISC-V] Revoked more changes
* [RISC-V] Revoked more changes
* [RISC-V] Embedded sext_w into codegen
* [RISC-V] Fixed some comments
* [RISC-V] Added additional comment
* [RISC-V] Improvements
* [RISC-V] Added old comment
* [RISC-V] Improve code generating resolve stub assembly (#102318)
* [RISC-V] Improve code generating resolve stub assembly
This change replaces magic numbers with proper offsetofs and use compile time asserts instead runtime ones.
That should make developers life easier in case of debugging or changing resolve stubs assembly.
* Move annotation and don't check same thing many times
* [RISC-V] Add pseudoinstructions to disassembler (#102260)
* [RISC-V] Reworked emitDispInsName a bit to ease further development
* [RISC-V] Little improvements
* [RISC-V] Refactored code
* [RISC-V] Added mv and nop pseudoinstructions to disasm
* [RISC-V] Added branch pseudos to disasm
* [RISC-V] Removed dead code
* [RISC-V] Fixes
* [RISC-V] Added j pseudoinstruction to disasm
* [RISC-V] Improved readability
* [RISC-V] Fixed mov pseudoinstruction
* Revert "[RISC-V] Fixed mov pseudoinstruction"
This reverts commit
a011c43cb75ef7fff976e6804f6474417a18eda8.
* [RISC-V] Fixed mov printing name
* [RISC-V] After review changes
* [RISC-V] More fixes after review
* [RISC-V] Adjusted 32-bit shift disasm to changes
* [RISC-V] Fixed bug
* [RISC-V] Fixed comment
* [RISC-V] Changed constants' literal type
* [RISC-V] Added more constants
* [RISC-V] Reinforced printing 1
* [RISC-V] Reinforced printing 2
* [RISC-V] Fixed bug
* [RISC-V] Resolved more bugs
* [RISC-V] Removed dead assert
* [RISC-V] Fix Interop/StructPacking/StructPacking.dll Failure (#102864)
---------
Co-authored-by: Tymoteusz Wenerski <t.wenerski@partner.samsung.com>
Co-authored-by: Tomasz Sowiński <tomeksowi@gmail.com>
Co-authored-by: Grzegorz Tomasz Czarnecki <grzegorz.czarnecki.2021@gmail.com>
Co-authored-by: Grzegorz Czarnecki <g.czarnecki@samsung.com>
Co-authored-by: Dong-Heon Jung <clamp03@gmail.com>
Co-authored-by: JongHeonChoi <j-h.choi@samsung.com>
Co-authored-by: Min <45393763+MinxuanZ@users.noreply.github.com>
Co-authored-by: monstercat <45393763+monstercatss@users.noreply.github.com>
Co-authored-by: Xu Liangyu <xuliangyu@loongson.cn>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: rzsc <160726116+rzsc@users.noreply.github.com>
Co-authored-by: t-mustafin <66252296+t-mustafin@users.noreply.github.com>
Co-authored-by: SzpejnaDawid <166010737+SzpejnaDawid@users.noreply.github.com>
Co-authored-by: yurai007 <dawid_jurek@vp.pl>
Co-authored-by: Gleb Balykov <g.balykov@samsung.com>
[Tizen] Update riscv64 unsupported coreclr tests (#522)
foregroundgc.sh exists in src/tests/issues.targets.
GetGCMemoryInfo.sh marked by <GCStressIncompatible>true</GCStressIncompatible>.
ParallelCrashWorkerThreads.sh investigation is in progress by Microsoft: https://github.com/dotnet/runtime/issues/80356.
Gleb Balykov [Thu, 2 May 2024 09:57:31 +0000 (12:57 +0300)]
[Tizen] Further fix corefx tests
- temporarily run tests without sudo if it's requested for System.IO.Pipes.Tests, System.Net.Ping.Functional.Tests, System.Diagnostics.Process, System.Formats.Tar due to missing sudo for TizenX
- temporarily skip tests requiring sudo for System.IO.FileSystem.Tests due to missing sudo for TizenX
- skip tests requiring too much memory for System.Runtime.Numerics.Tests, System.Runtime.Tests due to OOM
- pack correct System.Formats.Asn1.dll for System.Net.Security.Tests
- pack correct System.Collections.Immutable.dll for Microsoft.Extensions.Options.SourceGeneration.Unit.Tests
- pack correct dlls for System.Text.RegularExpressions.Tests
- increase timeout for RemoteExecutor from 60 seconds to 600 for System.Net.Security.Tests, System.Net.Ping.Functional.Tests, System.Net.Http.Functional.Tests
- skip tests in System.Net.Ping.Functional.Tests due to ping hang with ttl 1 on TizenX
Gleb Balykov [Wed, 24 Apr 2024 13:10:33 +0000 (16:10 +0300)]
[Tizen] Add more coreclr skips for RPI4 for armel
These are tests marked by <GCStressIncompatible>true</GCStressIncompatible> in csproj or subset of src/tests/issues.targets
이형주/MDE Lab(SR)/삼성전자 [Thu, 18 Apr 2024 10:16:08 +0000 (19:16 +0900)]
[Tizen] Require coreclr-dbgshim (#464)
Timur Mustafin [Tue, 9 Apr 2024 17:15:11 +0000 (20:15 +0300)]
Restore StubSecretArg from stack
Issue #100301
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Gleb Balykov [Tue, 2 Apr 2024 13:49:28 +0000 (16:49 +0300)]
[Tizen] Fix crossgen launch setup
Gleb Balykov [Sun, 24 Mar 2024 14:53:16 +0000 (17:53 +0300)]
[Tizen] Add coreclr gcstress skips for RPI4 for armel
These are tests marked by <GCStressIncompatible>true</GCStressIncompatible> in csproj
Gleb Balykov [Fri, 15 Mar 2024 07:24:28 +0000 (10:24 +0300)]
[Tizen] Add coreclr skips for RPI4 for armel
These are mostly a subset of src/tests/issues.targets with some additional excludes:
- readytorun/r2rdump/FrameworkTests/R2RDumpTests/R2RDumpTests is excluded because System.Private.CoreLib.dll is not a r2r image in default mode
Gleb Balykov [Sat, 23 Mar 2024 18:48:47 +0000 (21:48 +0300)]
[Tizen] Update coreclr skips for VisionFive2 riscv64
- 271010 is from src/tests/issues.targets
- lohfragmentation and largearraytest get killed on VisionFive2 4 Gb board
Timur Mustafin [Thu, 21 Mar 2024 13:25:41 +0000 (16:25 +0300)]
[TIZEN] Add unsupportedTests.GCStress.riscv64.txt
Tests marked by <GCStressIncompatible>true</GCStressIncompatible> in csproj may fail on GCStress mode. This list excludes them:
(Failed_on_riscv64_gcstress=0xc \ unsupportedTests.riscv64.txt) ∩ GCStressIncompatible_marked
[RISC-V] Fix hijack (#99809) (#449)
* [RISC-V] Store Ra into UPDATE_CONTEXT_POINTERS
* [RISC-V] Fix HijackArgs struct store
---------
Co-authored-by: t-mustafin <66252296+t-mustafin@users.noreply.github.com>
Co-authored-by: Gleb Balykov <g.balykov@samsung.com>
Timur Mustafin [Wed, 28 Feb 2024 11:02:40 +0000 (14:02 +0300)]
[Tizen] Add unsupportedTests.riscv64.txt
(issues.targets ∩ (failed_release_default U failed_release_jitstress0x2 U failed_release_jitstressregs0x2 U failed_release_gcstresslevel0xc)) U not_yet_implemented_riscv64.
not_yet_implemented_riscv64:
Loader/AssemblyDependencyResolver/MissingHostPolicyTests/MissingHostPolicyTests/MissingHostPolicyTests.sh
baseservices/TieredCompilation/BasicTestWithMcj/BasicTestWithMcj.sh
readytorun/coreroot_determinism/coreroot_determinism/coreroot_determinism.sh
readytorun/determinism/crossgen2determinism/crossgen2determinism.sh
readytorun/r2rdump/FrameworkTests/R2RDumpTests/R2RDumpTests.sh
readytorun/tests/mainv1/mainv1.sh
readytorun/tests/mainv2/mainv2.sh
Timur Mustafin [Wed, 7 Feb 2024 11:43:18 +0000 (14:43 +0300)]
[Tizen] Merging fix ForMismatchedValues
Denis Paranichev [Mon, 5 Feb 2024 20:15:51 +0000 (23:15 +0300)]
[RISC-V] Test HalfTest: fixed payload preservation testcase for RISC-V (#96888)
* Fixed payload preservation testcase in halftest for RISC-V
* Apply comments
* Add AssertExtentions.Equal function to test bit identity of two floating numbers
* Add descriptions for equal functions and fix ToStringRoundtrip test's assert argument
* Apply comments
* Fix CI failure
* Apply comments
---------
Co-authored-by: Denis Paranichev <48580269+DenisParal@users.noreply.github.com>
Co-authored-by: d.paranichev <d.paranichev@partner.samsung.com>
Tomasz Sowiński [Mon, 5 Feb 2024 01:17:50 +0000 (02:17 +0100)]
[RISC-V] Implement replacing safe-point call instructions under GC_STRESS (#97818)
* [RISC-V] Fix the System.NullReferenceException: Object reference not set to an instance of an object. in Methodical_r2.sh-deep_array_nz_r.dll when DOTNET_GCStress=4.
* [RISC-V] Implement correctly replacing safe-point instructions under GC_STRESS and getting the target of call instructions jal and jalr
* Add missing assign to shift
---------
Co-authored-by: Dawid Jurczak <dawid_jurek@vp.pl>
Denis Paranichev [Thu, 1 Feb 2024 17:13:33 +0000 (20:13 +0300)]
[RISC-V] Test TotalOrderIeee754ComparerTests: Fix NFloat - NaN testcases for RISC-V (#97340)
* Fix ieeeComparerTests NFloat NaN testcases for RISC-V
* Fix comment
* Specify test data for NaN test cases based on platform bitness
* Delete extra comment
* Fix CI failure
---------
Co-authored-by: d.paranichev <d.paranichev@partner.samsung.com>
Tomasz Sowiński [Thu, 1 Feb 2024 15:32:24 +0000 (16:32 +0100)]
Call missing genProduceReg in genCodeForCompare (#97805)
Co-authored-by: Dong-Heon Jung <clamp03@gmail.com>
yurai007 [Fri, 26 Jan 2024 19:40:07 +0000 (20:40 +0100)]
[RISC-V] Use correct registers set for fast tail call when function needs GSCookie check (#97510)
Consider scenario when JIT needs to emit GS Cookie check before performing
fast tail call through t0 at the end of function epilog. In that case CodeGen::genEmitGSCookieCheck
may blindly override t0 register to GSCookie address without respecting value already stored in t0.
We end up with hard to debug crash since our stack contains only one 0x9abcdef012345678 frame.
To prevent such issue, in this patch we follow ARM64 behaviour
and don't pick REG_GSCOOKIE_TMP_0/1 registers for fast tail calls.
It fixes couple of CoreCLR tests running in JitStress mode.
Dmitry Kurtaev [Thu, 25 Jan 2024 09:38:44 +0000 (12:38 +0300)]
[RISC-V] GCC crosscompile fixes (#97445)
* No inline in genJumpToThrowHlpBlk_la method body
* Far jump
monstercat [Fri, 12 Jan 2024 13:36:43 +0000 (21:36 +0800)]
[RISCV] Replace arm64 with riscv64 (#96889)
Co-authored-by: magus <mangypotatoes1@gmail.com>
yurai007 [Fri, 12 Jan 2024 09:19:53 +0000 (10:19 +0100)]
[RISC-V] Adjust genRangeCheck for handling integer length stored in 64 bit register (#96621)
CodeGen::genRangeCheck already takes care of integer index. We need to handle integer length in similar way.
This change fixes ArrBoundBinaryOp.sh test crash in JitStress mode:
```
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Tests.Test231_cns(Int32)
at Program.RunTest(System.Func`1<Byte>)
at Program.CompareActions(Int32, System.Func`2<Int32,Byte>, System.Func`2<Int32,Byte>)
at Program.TestEntryPoint()
at __GeneratedMainWrapper.Main()
Aborted (core dumped)
```
Grzegorz Tomasz Czarnecki [Wed, 10 Jan 2024 12:51:03 +0000 (13:51 +0100)]
[RISC-V] Fix bug in label printing in disasm (#96136)
* Bugfix
* Fixed comparation sign
* Revert "Fixed comparation sign"
This reverts commit
c238b82cf939c19ed55ce9e027fcaf4def6ba064.
* Fixed comparation sign
* Reverted changes in emitOutputInstrJumpDistanceHelper
* Fixed misspell
* Fixes after review
* Reverted changes from la
* Fixed format bug
* Fixed comment
---------
Co-authored-by: Grzegorz Czarnecki <g.czarnecki@samsung.com>
Grzegorz Tomasz Czarnecki [Sat, 16 Dec 2023 23:12:00 +0000 (00:12 +0100)]
[RISC-V] Add branch label names to disasm (#96057)
* Implemented emitDispIns for riscv
* Modified emitDispIns name
* Fixed missed case
* Added assert
* Fixed todo
* Added int to jitprintf
* Added prototype of the emit disp ins
* Fixes in emit dis ins name
* Reinforced types
* Removed useless ifdef statement from emit
* Fixed bug in emit disp ins
* Added release mode emit disp
* Formatted riscv64
* [RISC-V] Added todo comment
* [RISC-V] Applied format patch
* [RISC-V] Undo the emit.cpp dispIns changes
* [RISC-V] Fixed formatting
* Removed dead code
* Added emitDispInsDebugOnlyInfo
* Added preliminary emitOutputInstrJump
* Preliminary emitOutputInstrJump impl
* TmpSave
* [RISC-V] Changes after review
* Fixes after merge
* Fixed comment in emmit.h
* Added label printing
* Removed dead code
* Improved emitOutputInstrJumpSize
* Fixed bugs
* Fixed bug in emitOutputInstrJumpSize
* Added prelimary barch offset printing and reinforced some emitter methods
* Further reinforced disp functions
* Splitted emitOutputInstrJumpSize
* Formatted code
* Last fixes before pr
---------
Co-authored-by: Grzegorz Czarnecki <g.czarnecki@samsung.com>
이형주/MDE Lab(SR)/삼성전자 [Thu, 8 Feb 2024 07:45:20 +0000 (16:45 +0900)]
[RISC-V] Put scalar stack args with sign extension (#97662) (#392)
Co-authored-by: t-mustafin <66252296+t-mustafin@users.noreply.github.com>
[Tizen] Add method to write coredump of .NET process (#384)
This method allows to create minimal coredump (as createdump does) of a
process that is in dumping state after crush.
This is a modified version of
https://github.sec.samsung.net/dotnet/coreclr/commit/
4d043d61ecacae0b9922ecc10a73749e7c8e5987
commit, adapted to .NET 8.0
Co-authored-by: Mateusz Moscicki <m.moscicki2@partner.samsung.com>
Woongsuk Cho [Wed, 10 Jan 2024 00:34:13 +0000 (09:34 +0900)]
[Tizen] Remove unnecessary requires in the spec
In the spec file, the crossgen2-mic package requires the coreclr package.
Because of this, the coreclr package is included in image which doesnot support .NET feature.
To fix this, remove the require section of crossgen2-mic.
이형주/MDE Lab(SR)/삼성전자 [Thu, 4 Jan 2024 04:10:09 +0000 (13:10 +0900)]
[Tizen] Remove not-working workflows (#377)
* remove backport.yml
* remove check-service-labels.yml