Skip to content

fix(deploy): disable OpenSSL ARM crypto extensions to avoid SIGILL - #197

Open
stewroux wants to merge 1 commit into
reconurge:mainfrom
stewroux:fix/api-sigill-openssl-armcap-arm64-vz
Open

fix(deploy): disable OpenSSL ARM crypto extensions to avoid SIGILL#197
stewroux wants to merge 1 commit into
reconurge:mainfrom
stewroux:fix/api-sigill-openssl-armcap-arm64-vz

Conversation

@stewroux

Copy link
Copy Markdown

Summary

  • make prod fails on Apple Silicon under Colima (Apple Virtualization Framework / vz backend): the api container crash-loops with Illegal instruction (core dumped) (SIGILL, exit 132) during alembic upgrade head, so flowsint-api-prod never becomes healthy and make prod aborts.
  • Root cause: the guest kernel reports AArch64 crypto-extension HWCAP flags (AES/PMULL/SHA) that the hypervisor's vCPU doesn't actually support. alembic upgrade headflowsint_coreredis → PyJWT → cryptography.hazmat.bindings loads cryptography's Rust/OpenSSL extension, whose runtime CPU-feature detection picks an accelerated codepath that then executes an unsupported instruction.
  • Fix: set OPENSSL_armcap=0 on the api and celery services to force OpenSSL's portable C fallback. This only affects OpenSSL's AArch64 codepath — it's a no-op on x86_64 and on hosts where the HWCAP flags are reported correctly, so it's safe to set unconditionally.

Test plan

  • Reproduced by bisecting the crash down to import cryptography.hazmat.bindings._rust inside the api image, confirmed via docker compose run --rm -e OPENSSL_armcap=0 ... that the import succeeds with the flag set.
  • docker compose -f docker-compose.prod.yml up -d with the fix applied: api, celery, postgres, redis, neo4j, app all reach healthy/Up.
  • curl http://127.0.0.1:5001/health returns {"status":"ok"}.
  • Not verified on Docker Desktop / native Linux ARM64 / x86_64 (expected no-op there, but untested by me).

🤖 Generated with Claude Code

https://claude.ai/code/session_01R3yAhS1TuD13NwPheDuMv6

api and celery crash-loop with 'Illegal instruction (core dumped)'
(SIGILL, exit 132) on some ARM64 hypervisors — reproduced under Colima
using Apple's Virtualization Framework (vz backend). alembic upgrade
head triggers it via redis -> PyJWT -> cryptography.hazmat.bindings,
which loads cryptography's Rust/OpenSSL extension.

Root cause: the guest kernel reports AArch64 crypto-extension HWCAP
flags (AES/PMULL/SHA) that the hypervisor's vCPU does not actually
support, so OpenSSL's runtime CPU-feature detection picks an
accelerated code path that executes an unsupported instruction.

OPENSSL_armcap=0 disables that detection, forcing the portable C
fallback. It only affects OpenSSL's AArch64 codepath and is a no-op
on x86_64 or on hosts where the flags are reported correctly, so it
is safe to set unconditionally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant