Skip to content

Commit

Permalink
Linux: Disable EFAULT handler until we find something that uses it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonicadvance1 committed Jan 25, 2024
1 parent aca9e7a commit ece29b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Source/Tools/LinuxEmulation/LinuxSyscalls/SignalDelegator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1471,10 +1471,17 @@ namespace FEX::HLE {
else if (Signal == SIGSEGV &&
SigInfo.si_code == SEGV_ACCERR &&
FaultSafeMemcpy::IsFaultLocation(ArchHelpers::Context::GetPc(UContext))) {
// Return from the subroutine, returning EFAULT.
ArchHelpers::Context::SetArmReg(UContext, 0, EFAULT);
ArchHelpers::Context::SetPc(UContext, ArchHelpers::Context::GetArmReg(UContext, 30));
return;
// If you want to emulate EFAULT behaviour then enable this if-statement.
// Do this once we find an application that depends on this.
if constexpr (false) {
// Return from the subroutine, returning EFAULT.
ArchHelpers::Context::SetArmReg(UContext, 0, EFAULT);
ArchHelpers::Context::SetPc(UContext, ArchHelpers::Context::GetArmReg(UContext, 30));
return;
}
else {
LogMan::Msg::AFmt("Received invalid data to syscall. Crashing now!");
}
}
else {
if (IsAsyncSignal(&SigInfo, Signal) && MustDeferSignal) {
Expand Down
3 changes: 3 additions & 0 deletions unittests/FEXLinuxTests/Known_Failures
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ sigtest_samask.32
sigtest_samask.64
sigtest_sigmask.32
sigtest_sigmask.64

# Intentionally disabled while EFAULT causes SIGABRT
syscalls_efault.32

0 comments on commit ece29b3

Please sign in to comment.