#1452·colima

Rosetta x86 `mmap()` 系统调用行为异常,导致 SIGSEGV

作者: enduity创建于 2025年11月24日更新于 2026年8月28日
  1. Start Colima with VZ and Rosetta enabled:
bash
colima start --arch aarch64 --vm-type vz --vz-rosetta
  1. Run an Alpine x86_64 PHP container enabling Opcache (CLI mode). This triggers the memory corruption immediately:
bash
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)

  1. (Optional) Run an Ubuntu x86_64 PHP container enabling Opcache (CLI mode). This triggers a different error message:
bash
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)
  1. (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_HUGETLB allocation that is guaranteed to fail.

内容来源: abiosoft/colima