Skip to content

Commit

Permalink
Disabled stackoverflow tests with largeframe for RISCV64 (#106383)
Browse files Browse the repository at this point in the history
For bigger structures than the page size, the current way of calculating
whether failureAddress is a part of the stack is not always proper.
Because siginfo_t structure with failureAddress (si_addr field) comes from OS
the problem must be related with SP or with the formula:
  (failureAddress - (sp - GetVirtualPageSize())) < 2 * GetVirtualPageSize()
which is used to check if SIGSEGV is a stack overflow.
  • Loading branch information
SzpejnaDawid authored Aug 22, 2024
1 parent 9d5d9d1 commit def2d14
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ public static void TestStackOverflowSmallFrameMainThread()
[Fact]
public static void TestStackOverflowLargeFrameMainThread()
{
if ((RuntimeInformation.ProcessArchitecture == Architecture.Arm64) &&
if (((RuntimeInformation.ProcessArchitecture == Architecture.Arm64) || (RuntimeInformation.ProcessArchitecture == Architecture.RiscV64)) &&
((Environment.OSVersion.Platform == PlatformID.Unix) || (Environment.OSVersion.Platform == PlatformID.MacOSX)))
{
// Disabled on Unix RISCV64, similar to ARM64.
// Disabled on Unix ARM64 due to https://github.com/dotnet/runtime/issues/13519
// The current stack probing doesn't move the stack pointer and so the runtime sometimes cannot
// recognize the underlying sigsegv as stack overflow when it probes too far from SP.
Expand Down Expand Up @@ -181,9 +182,10 @@ public static void TestStackOverflowSmallFrameSecondaryThread()
[Fact]
public static void TestStackOverflowLargeFrameSecondaryThread()
{
if ((RuntimeInformation.ProcessArchitecture == Architecture.Arm64) &&
if (((RuntimeInformation.ProcessArchitecture == Architecture.Arm64) || (RuntimeInformation.ProcessArchitecture == Architecture.RiscV64)) &&
((Environment.OSVersion.Platform == PlatformID.Unix) || (Environment.OSVersion.Platform == PlatformID.MacOSX)))
{
// Disabled on Unix RISCV64, similar to ARM64.
// Disabled on Unix ARM64 due to https://github.com/dotnet/runtime/issues/13519
// The current stack probing doesn't move the stack pointer and so the runtime sometimes cannot
// recognize the underlying sigsegv as stack overflow when it probes too far from SP.
Expand Down

0 comments on commit def2d14

Please sign in to comment.