Skip to content

Commit

Permalink
Reduce size of RESERVED_BRK_SPACE for A32
Browse files Browse the repository at this point in the history
For unknown reasons when RESERVED_BRK_SPACE is set to 128 * PAGE_SIZE
MABMO segfaults on scanning the first instructions. The problem
first transpires after mmap and remmap involving RESERVED_BRK_SPACE
is executed. This fix reduces the reserved space back to PAGE_SIZE
for A32 - the value used before RISC-V merge. One of the possible
explnations is smaller virtual memory on A32 compared to A64 and RISC-V.
  • Loading branch information
IgWod committed May 31, 2024
1 parent 97dc384 commit 68c9563
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dbm.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@
#define MAX_CC_LINKS 100000

// The size of the initial data segment allocation for brk emulation
#define RESERVED_BRK_SPACE (128*(PAGE_SIZE))
#ifdef __arm__
#define RESERVED_BRK_SPACE (PAGE_SIZE)
#else
#define RESERVED_BRK_SPACE (128*(PAGE_SIZE))
#endif

#if defined __arm__ || __aarch64__
#define THUMB 0x1
Expand Down

0 comments on commit 68c9563

Please sign in to comment.