Skip to content

[release/10.0] [EventPipe] Add dotnet_ipc_created mapping#124058

Merged
steveisok merged 5 commits intorelease/10.0from
backport/pr-123779-to-release/10.0
Feb 8, 2026
Merged

[release/10.0] [EventPipe] Add dotnet_ipc_created mapping#124058
steveisok merged 5 commits intorelease/10.0from
backport/pr-123779-to-release/10.0

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Feb 5, 2026

Backport of #123779 to release/10.0

/cc @mdh1418

Customer Impact

  • Customer reported
  • Found internally

User_events support was added in .NET 10. The officially supported way to enable user_events is through One-Collect's record-trace (which dotnet-trace wraps around). Record-trace relied on an implementation detail of W^X that NativeAOT doesn't support since it doesn't support PerfMaps (see microsoft/one-collect#226), so it was belatedly discovered that user_events doesn't work for NativeAOT.

Through discussions in microsoft/one-collect#226, this dotnet_ipc_created mapping with no permissions (PROT_NONE) was found as an acceptable minimal OS interaction to signal when the .NET process' diagnostic ports are available.

Regression

  • Yes
  • No

Testing

I tested the User_events runtime tests against a locally built record-trace based on microsoft/one-collect#229 in both CoreCLR and NativeAOT on my WSL2 instance.

Risk

Low. The mapping being introduced has minimal permissions as it is a private mapping created with PROT_NONE.

@mdh1418
Copy link
Member

mdh1418 commented Feb 5, 2026

cc: @jkotas @noahfalk @lateralusX

@mdh1418
Copy link
Member

mdh1418 commented Feb 5, 2026

I will test the official build on main to double check we aren't missing headers that the logic is guarded under.

@jkotas
Copy link
Member

jkotas commented Feb 5, 2026

I will test the official build on main to double check we aren't missing headers that the logic is guarded under.

Note that we upgraded the headers in main to newer Linux version. main has Ubuntu 20 / glibc 2.31, .NET 10 has Ubuntu 18 / glibc 2.27. You may want to check the backport as well.

Alternatively, you can simplify the ifdefs to just HOST_LINUX so that the build breaks in case we are building against headers that are too old. We do not really care about supporting that.

@steveisok steveisok added Servicing-consider Issue for next servicing release review Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Feb 6, 2026
@steveisok steveisok enabled auto-merge (squash) February 6, 2026 21:51
@steveisok steveisok added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Feb 6, 2026
@steveisok
Copy link
Member

I will test the official build on main to double check we aren't missing headers that the logic is guarded under.

Holding off on merging until we have a chance to validate.

@mdh1418
Copy link
Member

mdh1418 commented Feb 7, 2026

Validated off of the VMR main's corresponding code flow built artifacts dotnet/dotnet#4680.

I built a NativeAOT app doing GC work. It generated the dotnet_ipc_created mapping, and the latest record-trace was able to discover the mapping, send an IPC command, and collect GC events from that NativeAOT app.

Is there a straightforward way to test how the VMR would build these backport changes in it's backport branch before merging this backport PR? Or is letting this flow and validated against the 10.0.3xx branch the simplest way?


Copilot CLI thinks it should be compatible with Ubuntu 18/glibc 2.27

The dotnet_ipc_created feature uses syscall(__NR_memfd_create, ...) directly (not the glibc wrapper). Here's the compatibility breakdown:

Requirement Minimum Version Ubuntu 18.04 (glibc 2.27) Status
memfd_create syscall Linux kernel 3.17 Kernel 4.15
__NR_memfd_create in headers linux-libc-dev from kernel 3.17+ Defined as syscall 319 (x86-64)
sys/mman.h Standard Available
sys/syscall.h Standard Available

Conclusion: The backport to .NET 10 (Ubuntu 18.04 / glibc 2.27) should work because:

  1. The syscall number __NR_memfd_create comes from kernel headers (linux-libc-dev), not glibc
  2. Ubuntu 18.04's kernel 4.15 headers include this syscall number
  3. The CMake check check_symbol_exists(__NR_memfd_create sys/syscall.h HAVE_MEMFD_CREATE) will succeed

@steveisok
Copy link
Member

steveisok commented Feb 7, 2026

Is there a straightforward way to test how the VMR would build these backport changes in it's backport branch before merging this backport PR? Or is letting this flow and validated against the 10.0.3xx branch the simplest way?

There are multiple stages... Simplifying a bit, the first one is does change pass out of runtime (this PR), the second one is the forward flow into the VMR, and the backflow back to runtime closes the loop that you are looking for. If you were able to do represent the backflow already, that's a strong indicator that this change can go in with confidence.

@steveisok steveisok requested a review from mdh1418 February 7, 2026 18:12
@steveisok
Copy link
Member

@mdh1418 if you're all good, please approve and I'll merge it.

@jkotas
Copy link
Member

jkotas commented Feb 7, 2026

Is there a straightforward way to test how the VMR would build these backport changes

The easiest way is to submit test-only PR to VMR with the change, trigger /azp run dotnet-unified-build-full and download the bits to tests from the PR artifacts. (Example dotnet/dotnet#3349)

If you want to do it locally, you can build in the official build docker image for .NET 10 (https://github.com/dotnet/runtime/blob/release/10.0/docs/workflow/using-docker.md has instructions) and then patch your SDK setup with your private or point SDK to use your private. The instructions for using NativeAOT privates at https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/nativeaot.md#building-packages are broken currently - you have to use workaround from #119166 (comment) .

@mdh1418
Copy link
Member

mdh1418 commented Feb 8, 2026

Validated against the 10.0.4 artifacts from the VMR test pr, thanks Jan!

@jkotas jkotas removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Feb 8, 2026
@hoyosjs
Copy link
Member

hoyosjs commented Feb 8, 2026

/ba-g known failures against a release branch

@steveisok steveisok merged commit 71dd2d8 into release/10.0 Feb 8, 2026
141 of 148 checks passed
@mdh1418 mdh1418 deleted the backport/pr-123779-to-release/10.0 branch February 9, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Tracing-coreclr Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants