Rosetta x86 `mmap()` 系统调用行为异常,导致 SIGSEGV
作者: enduity创建于 2025年11月24日更新于 2026年8月28日
- Start Colima with VZ and Rosetta enabled:
colima start --arch aarch64 --vm-type vz --vz-rosetta- Run an Alpine x86_64 PHP container enabling Opcache (CLI mode). This triggers the memory corruption immediately:
Docker run --rm --platform linux/amd64 php:8.3-cli-alpine ash -c \
'php -n -dzend_extension=opcache -dopcache.enable_cli=1 -v'Result: Segmentation fault (core dumped)
- (Optional) Run an Ubuntu x86_64 PHP container enabling Opcache (CLI mode). This triggers a different error message:
Docker run --rm --platform linux/amd64 php:8.3-cli sh -c \
'php -n -dzend_extension=opcache -dopcache.enable_cli=1 -v'Result:
rosetta error: futex(FUTEX_LOCK_PI_PRIVATE) failure: 35
Trace/breakpoint trap (core dumped)- (Optional) Run this C Proof of Concept which maps a "Survivor" page, writes data to it, and then attempts to overwrite it with a
MAP_FIXED | MAP_HUGETLBallocation that is guaranteed to fail.
内容来源: abiosoft/colima