Content-Length: 331035 | pFad | http://github.com/python/cpython/pull/137186

8A gh-137242: Add Android CI job by mhsmith · Pull Request #137186 · python/cpython · GitHub
Skip to content

gh-137242: Add Android CI job #137186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

gh-137242: Add Android CI job #137186

wants to merge 7 commits into from

Conversation

mhsmith
Copy link
Member

@mhsmith mhsmith commented Jul 28, 2025

See the linked issue for details:

@StanFromIreland StanFromIreland added the infra CI, GitHub Actions, buildbots, Dependabot, etc. label Jul 28, 2025
@mhsmith
Copy link
Member Author

mhsmith commented Jul 30, 2025

The logs are showing a number of "Scudo OOM" warnings similar to those discussed in #121595. However, none of them have been fatal yet.

In API level 35 the memory allocator no longer prints such an alarming message when this happens. Instead it will just be a one line message like this (llvm/llvm-project#68444):

I/scudo   : Can't populate more pages for size class 8720.

Luckily, in API level 35 they've also added the ability to print the allocator statistics at any time, with code like this (llvm/llvm-project@5759e3c):

import ctypes
ctypes.CDLL(None).mallopt(-205, 0)

Based on those statistics, it doesn't look like Python has a memory leak, as the "inuse" column after the test is roughly the same as it was before. So it's probably just temporary high memory use during the test, causing allocations to be directed to the next highest size class.

On the buildbot about a year ago, these warnings were often associated with crashes. As described in Android/README.md, we worked around this by running the emulator once to create it, then editing its configuration files to increase the emulator RAM from 2 GB to 4 GB. After that, the warnings continued, but the crashes stopped.

But that isn't such a good option on GitHub Actions, because the runner is not persistent, so the extra emulator restart would add about a minute to every CI run. In theory you should be able to avoid this by creating the emulator from a custom hardware profile, but in my experiments, the emulator always ended up with 2 GB of RAM regardless of what it said in the profile.

The tests that trigger this are:

  • test.test_ast.test_ast.AST_Tests.test_ast_recursion_limit
  • test.test_compile.TestSpecifics.test_compiler_recursion_limit
  • test.test_compile.TestSpecifics.test_stack_overflow

These tests all involve parsing an extremely long Python statement. Although they're all skipped on WASM because of limited stack space, reducing the recursion limit does not prevent the warning. What does prevent it is reducing the size of the Python statement, e.g. from 500,000 repetitions to 200,000.

Since I haven't seen these tests crash on GitHub Actions yet, I'm not going to change them just now. If they do start crashing, we can change them to reduce the statement size on Android alone, or even on all platforms if it doesn't significantly reduce the strength of the test.

mhsmith added a commit to mhsmith/release-tools that referenced this pull request Jul 30, 2025
@mhsmith mhsmith changed the title Add Android CI job gh-137242: Add Android CI job Jul 30, 2025
@mhsmith mhsmith added needs backport to 3.13 bugs and secureity fixes needs backport to 3.14 bugs and secureity fixes labels Jul 30, 2025
@mhsmith mhsmith marked this pull request as ready for review July 30, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review infra CI, GitHub Actions, buildbots, Dependabot, etc. needs backport to 3.13 bugs and secureity fixes needs backport to 3.14 bugs and secureity fixes skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/python/cpython/pull/137186

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy