Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/custommem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2851,7 +2851,12 @@ uint32_t getProtection_fast(uintptr_t addr)

int getMmapped(uintptr_t addr)
{
return (rb_get(mapallmem, addr)&MEM_ALLOCATED); // will be ok for both MEM_ALLOCATED & MEM_MMAP
return (rb_get(mapallmem, addr)&MEM_MMAP) == MEM_MMAP;
}

int getMAllocated(uintptr_t addr)
{
return (rb_get(mapallmem, addr)&MEM_ALLOCATED);
}

int memExist(uintptr_t addr)
Expand Down
1 change: 1 addition & 0 deletions src/include/custommem.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ void refreshProtection(uintptr_t addr);
uint32_t getProtection(uintptr_t addr);
uint32_t getProtection_fast(uintptr_t addr);
int getMmapped(uintptr_t addr);
int getMAllocated(uintptr_t addr);
int memExist(uintptr_t addr);
void loadProtectionFromMap(void);
#ifdef DYNAREC
Expand Down
2 changes: 1 addition & 1 deletion src/libtools/signals.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx)
#ifdef BAD_SIGNAL
// try to see if the si_code makes sense
// the RK3588 tend to need a special Kernel that seems to have a weird behaviour sometimes
if((sig==X64_SIGSEGV) && (addr) && (info->si_code == 1) && getMmapped((uintptr_t)addr)) {
if((sig==X64_SIGSEGV) && (addr) && (info->si_code == 1) && getMAllocated((uintptr_t)addr)) {
printf_log(LOG_DEBUG, "Workaround for suspicious si_code for %p / prot=0x%hhx\n", addr, prot);
info->si_code = 2;
}
Expand Down
Loading