Skip to content

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Jul 26, 2025

When we start the child process, we clear all signal handlers. When using vfork, on Android, this operation ends up clearing the signal handlers also for the parent process. Revert to just using fork for simplicity.

vfork usage was added back in dotnet/corefx#33289, seems like there were some potential concerns then.

Legacy Xamarin was using fork.

Fixes #97209.

When we start the child process, we clear all signal handlers. This operations ends up clearing the signal handlers also for the parent process. Revert to just using fork for simplicity.
@Copilot Copilot AI review requested due to automatic review settings July 26, 2025 16:18
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a signal handling issue on Android by reverting from vfork() to fork() for process creation. The issue occurs because Android's vfork() implementation shares signal handlers between parent and child processes, causing the parent's signal handlers to be incorrectly cleared when the child process resets its handlers during startup.

Key Changes:

  • Excludes Android from using vfork() in process creation
  • Updates comments to explain the Android-specific signal handling issue
  • Maintains existing exclusions for Apple platforms

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 26, 2025
@BrzVlad BrzVlad added area-System.Diagnostics.Process and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jul 26, 2025
@BrzVlad
Copy link
Member Author

BrzVlad commented Jul 26, 2025

cc @janvorli

@BrzVlad
Copy link
Member Author

BrzVlad commented Jul 30, 2025

/ba-g wasm failures unrelated

@BrzVlad BrzVlad merged commit e9dd250 into dotnet:main Jul 30, 2025
108 of 112 checks passed
@akoeplinger
Copy link
Member

I think this could be a candidate for backport to net9

@BrzVlad
Copy link
Member Author

BrzVlad commented Aug 4, 2025

/backport to release/9.0-staging

Copy link
Contributor

github-actions bot commented Aug 4, 2025

Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/16721026186

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android] Application crashes when an exception is thrown after running a System.Diagnostics.Process

3 participants