mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-09 13:16:26 +00:00
A few native stack detection fixes for macOS/arm64 (#3368)
This commit is contained in:
parent
410ee580ae
commit
120b9659dd
2
.github/workflows/compilation_on_macos.yml
vendored
2
.github/workflows/compilation_on_macos.yml
vendored
|
@ -380,9 +380,7 @@ jobs:
|
||||||
./iwasm wasm-apps/trap.aot | grep "#" > call_stack_aot.txt
|
./iwasm wasm-apps/trap.aot | grep "#" > call_stack_aot.txt
|
||||||
bash -x ../symbolicate.sh
|
bash -x ../symbolicate.sh
|
||||||
|
|
||||||
# skip on arm64 (macos-14) for now
|
|
||||||
- name: Build Sample [native-stack-overflow]
|
- name: Build Sample [native-stack-overflow]
|
||||||
if: matrix.os != 'macos-14'
|
|
||||||
run: |
|
run: |
|
||||||
cd samples/native-stack-overflow
|
cd samples/native-stack-overflow
|
||||||
./build.sh
|
./build.sh
|
||||||
|
|
|
@ -523,8 +523,13 @@
|
||||||
|
|
||||||
/* Guard page count for stack overflow check with hardware trap */
|
/* Guard page count for stack overflow check with hardware trap */
|
||||||
#ifndef STACK_OVERFLOW_CHECK_GUARD_PAGE_COUNT
|
#ifndef STACK_OVERFLOW_CHECK_GUARD_PAGE_COUNT
|
||||||
|
#if defined(__APPLE__) && defined(__aarch64__)
|
||||||
|
/* Note: on macOS/iOS arm64, the user page size is 16KB */
|
||||||
|
#define STACK_OVERFLOW_CHECK_GUARD_PAGE_COUNT 1
|
||||||
|
#else
|
||||||
#define STACK_OVERFLOW_CHECK_GUARD_PAGE_COUNT 3
|
#define STACK_OVERFLOW_CHECK_GUARD_PAGE_COUNT 3
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Default wasm block address cache size and conflict list size */
|
/* Default wasm block address cache size and conflict list size */
|
||||||
#ifndef BLOCK_ADDR_CACHE_SIZE
|
#ifndef BLOCK_ADDR_CACHE_SIZE
|
||||||
|
|
|
@ -113,10 +113,11 @@ main(int argc, char **argv)
|
||||||
printf("-------------------------------------------------------------------"
|
printf("-------------------------------------------------------------------"
|
||||||
"--------\n");
|
"--------\n");
|
||||||
|
|
||||||
|
uint32_t page_size = os_getpagesize();
|
||||||
unsigned int stack;
|
unsigned int stack;
|
||||||
unsigned int prevstack = 0; /* appease GCC -Wmaybe-uninitialized */
|
unsigned int prevstack = 0; /* appease GCC -Wmaybe-uninitialized */
|
||||||
unsigned int stack_range_start = 0;
|
unsigned int stack_range_start = 0;
|
||||||
unsigned int stack_range_end = 4096 * 6;
|
unsigned int stack_range_end = page_size * 6;
|
||||||
unsigned int step = 16;
|
unsigned int step = 16;
|
||||||
struct record rec0;
|
struct record rec0;
|
||||||
struct record rec1;
|
struct record rec1;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user