Skip to content

Report the error when injecting the activation signal fails - #136713

Merged
jkotas merged 3 commits into
dotnet:mainfrom
asyncfinkd:patch-1
Oct 31, 2026
Merged

jkotas merged 3 commits into
dotnet:mainfrom
asyncfinkd:patch-1

Conversation

@asyncfinkd

Copy link
Copy Markdown
Contributor

When pthread_kill fails in InjectActivationInternal (for any error other than EAGAIN/ESRCH), the runtime calls PROCAbort() without saying why. The process then dies with only a libc abort() trap in the kernel log, which is very hard to diagnose.

In #136603 the cause was a stacked AppArmor profile (cri-containerd.apparmor.d//&unconfined) on Ubuntu 26.04 Kubernetes nodes that denied thread-directed signals within the process. pthread_kill returned EACCES, GC thread suspension failed, and every affected .NET process aborted silently. Finding the cause required a core dump and native debugging.

This change prints the signal number and the error before aborting, e.g.:

Failed to inject activation signal 34 into thread: Permission denied (13)

It also updates the comment that said only two failure cases are possible.

Follow-up to #136603, as suggested there by @jkotas

Print the pthread_kill error before aborting so failures such as EACCES from a restrictive AppArmor policy are diagnosable. Follow-up to dotnet#136603.
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Oct 30, 2026
@github-actions github-actions Bot added the area-PAL-coreclr only for closed issues label Oct 30, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@asyncfinkd

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

@jkotas
jkotas merged commit 2b23654 into dotnet:main Oct 31, 2026
102 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-PAL-coreclr only for closed issues community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants