Skip to content

[Android] Refine bad build check and testcase manager execution - #5456

Open
IvanBM18 wants to merge 3 commits into
feature/android-exit-code-process-handlerfrom
feature/android-bad-build-check
Open

[Android] Refine bad build check and testcase manager execution#5456
IvanBM18 wants to merge 3 commits into
feature/android-exit-code-process-handlerfrom
feature/android-bad-build-check

Conversation

@IvanBM18

@IvanBM18 IvanBM18 commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Bug: b/553141628

Overview

Since Android API level 30 (and apps targeting Android 11+), apps have scoped storage access. Previously, bad build checks for Android did not verify whether the application process actually survived startup because am start returns 0 even if the process dies immediately.

This PR enhances check_for_bad_build() in testcase_manager.py by ensuring command line files are written prior to execution and flipping a conditional so in the bad build check the android specific validation proceeds other validations.

The later was required because thanks to this PR we added the possibility to check for false positives, but this added a problem in which valid builds were incorrectly flagged as crashes, so by flipping the conditional we fix this.

Changes

  • src/clusterfuzz/_internal/bot/testcase_manager.py: Updated check_for_bad_build() to pass write_command_line_file=True and verify target application process presence on Android post-launch.

Tests performed

Basically the same as the parent PR

reason=2 (SIGNALED) subreason=0 (UNKNOWN) status=9

When this happen now CF correctly determines that the app crashed due to runtime issues not related to memory errors.

PR stack

  • master
    • #PR 2.1a feature/android-exit-code-constants
    • #PR 2.1b feature/android-exit-code-core
    • #PR 2.2 feature/android-exit-code-process-handler
    • #PR 2.3 feature/android-bad-build-check 👈

Note:

Adding additional debug logs in this other PR:

@IvanBM18
IvanBM18 requested a review from a team as a code owner September 3, 2026 20:47
@IvanBM18
IvanBM18 force-pushed the feature/android-bad-build-check branch from 6c51bd7 to 455c3f5 Compare September 3, 2026 20:59
@IvanBM18
IvanBM18 force-pushed the feature/android-bad-build-check branch from 455c3f5 to c41d97d Compare September 3, 2026 21:13
@IvanBM18
IvanBM18 force-pushed the feature/android-bad-build-check branch from c41d97d to 91f145b Compare September 3, 2026 21:20
@IvanBM18
IvanBM18 force-pushed the feature/android-bad-build-check branch from 91f145b to 8630786 Compare September 3, 2026 21:26
@IvanBM18 IvanBM18 self-assigned this Sep 3, 2026
@IvanBM18
IvanBM18 force-pushed the feature/android-bad-build-check branch from 8630786 to 7ea0de9 Compare September 3, 2026 21:50
Comment thread src/clusterfuzz/_internal/bot/testcase_manager.py
@IvanBM18
IvanBM18 force-pushed the feature/android-bad-build-check branch from 29bb199 to a9b0c46 Compare September 4, 2026 17:53
@IvanBM18
IvanBM18 force-pushed the feature/android-bad-build-check branch from a9b0c46 to 0e01fdf Compare September 4, 2026 22:30

@dylanjew dylanjew left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. sorry, forgot to send my comments earlier

app_directory = environment.get_value('APP_DIR')
environment.set_value('PIDS', '[]')

logs.info(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these useful or are they more debug logs?

Comment on lines 1295 to 1298
# 1. Need to account for startup crashes with no crash state. E.g. failed to
# load shared library. So, ignore state for comparison.
# 2. Ignore leaks as they don't block a build from reporting regular crashes
# and also don't impact regression range calculations.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you move this comment back to the code it describes?

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.

3 participants