From b8cd4aab88c4f677cc6f5b9ea9507566afbccf22 Mon Sep 17 00:00:00 2001 From: Malcolm Smith Date: Wed, 30 Sep 2026 21:23:22 +0100 Subject: [PATCH 1/2] Prevent mimalloc calling system calls directly on Android --- Objects/mimalloc/prim/unix/prim.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Objects/mimalloc/prim/unix/prim.c b/Objects/mimalloc/prim/unix/prim.c index 6f78eb72789e8e5..2ee49868a00d503 100644 --- a/Objects/mimalloc/prim/unix/prim.c +++ b/Objects/mimalloc/prim/unix/prim.c @@ -60,9 +60,12 @@ terms of the MIT license. A copy of the license can be found in the file // Use syscalls for some primitives to allow for libraries that override open/read/close etc. // and do allocation themselves; using syscalls prevents recursion when mimalloc is // still initializing (issue #713) +// +// This isn't done on Android because some versions have an excessively strict +// seccomp filter (https://github.com/android/ndk/issues/1298). //------------------------------------------------------------------------------------ -#if defined(MI_HAS_SYSCALL_H) && defined(SYS_open) && defined(SYS_close) && defined(SYS_read) && defined(SYS_access) +#if defined(MI_HAS_SYSCALL_H) && defined(SYS_open) && defined(SYS_close) && defined(SYS_read) && defined(SYS_access) && !defined(__ANDROID__) static int mi_prim_open(const char* fpath, int open_flags) { return syscall(SYS_open,fpath,open_flags,0); From 51ba641ac86606e7f679f0d06e5039d20c104f3d Mon Sep 17 00:00:00 2001 From: Malcolm Smith Date: Wed, 30 Sep 2026 21:30:02 +0100 Subject: [PATCH 2/2] Add news --- .../2026-09-30-21-29-54.gh-issue-158529.kZO7mX.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2026-09-30-21-29-54.gh-issue-158529.kZO7mX.rst diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-09-30-21-29-54.gh-issue-158529.kZO7mX.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-09-30-21-29-54.gh-issue-158529.kZO7mX.rst new file mode 100644 index 000000000000000..712f26f6493877c --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-09-30-21-29-54.gh-issue-158529.kZO7mX.rst @@ -0,0 +1,2 @@ +Fixed crash on Android x86_64, API levels 27-28, caused by mimalloc calling +system calls directly.