Commit dc76612
authored
fix(mobile): _pyrepl pruning + mimalloc seccomp open() on 3.13/3.14 (#29)
Two distinct on-device runtime bugs that only surface on a genuine 3.13/3.14
mobile run (3.12 unaffected), found via mobile-forge genuine multi-Python mobile
tests (fork run 27439192170):
1. _pyrepl was pruned from the iOS + Android stdlib excludes as a "dev-only /
interactive-REPL" module. But CPython 3.14 pdb.py imports _pyrepl at module
load, so any on-device code importing pdb (incl. pytest) dies with
"ModuleNotFoundError: No module named _pyrepl". 3.13 pdb does not import it,
which is why 3.13 iOS was unaffected. Un-prune _pyrepl in
darwin/python-darwin-stdlib.exclude + android/python-android-dart.exclude.
2. mimalloc (bundled in CPython since 3.13) issues a bare open(2) syscall from
its load-time constructor (mi_process_load -> unix_detect_overcommit reading
/proc/sys/vm/overcommit_memory) where SYS_open is defined (x86_64). Android
bionic seccomp forbids open(2) -> SIGSYS at dlopen of libpython, before the
interpreter starts. arm64 is unaffected (no SYS_open; mimalloc falls back to
libc open() -> openat). Patch mi_prim_open to use SYS_openat
(android/patches/mimalloc_seccomp_openat.patch, gated >=3.13 in build.sh).1 parent ecbd1a0 commit dc76612
4 files changed
Lines changed: 33 additions & 4 deletions
File tree
- android
- patches
- darwin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
0 commit comments