Skip to content

Make GCDump work on Linux #116816

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

Merged
merged 3 commits into from
Jun 20, 2025
Merged

Conversation

MichalStrehovsky
Copy link
Member

Fixes #116686.

Turns out the test was failing because everything involved in GCDump was disabled outside Windows.

Cc @dotnet/ilc-contrib

Fixes dotnet#116686.

Turns out the test was failing because everything involved in GCDump was disabled outside Windows.
Copy link
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

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 re-enables GCDump functionality on Linux by removing OS-specific exclusions and adapting ETW and interlocked calls for cross-platform support.

  • Removes the Linux-specific test exclusion for GCDump so tests now run on Linux.
  • Un-guards and adjusts the ETW heap-walk helper and event tracing code for non-Windows builds.
  • Updates atomic exchange calls, header includes, and adds null-safety in bulk-type event logging.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/tests/issues.targets Removed the Linux exclusion for tracing/eventpipe/gcdump to allow the GCDump test to run on Linux.
src/coreclr/nativeaot/Runtime/profheapwalkhelper.cpp Dropped the FEATURE_ETW guard so heap walking runs on Linux.
src/coreclr/nativeaot/Runtime/eventtrace_gcheap.cpp Swapped Windows-only InterlockedExchange64 for PalInterlockedExchange64 for portability.
src/coreclr/nativeaot/Runtime/eventtrace_bulktype.cpp Fixed casing on include, added nothrow allocation and null check, and ensured a default case.
src/coreclr/nativeaot/Runtime/eventtrace.h Removed fallback inline stubs for non-ETW builds (now absent).
src/coreclr/nativeaot/Runtime/eventtrace.cpp Changed filter parsing to skip on Unix and removed the FEATURE_ETW guard around ForceGC.
src/coreclr/nativeaot/Runtime/eventpipe/CMakeLists.txt Reordered sources to include profheapwalkhelper.cpp under the eventtrace list.
Comments suppressed due to low confidence (3)

src/coreclr/nativeaot/Runtime/profheapwalkhelper.cpp:175

  • This ETW call is now unconditionally compiled on all platforms, but the ETW methods may not be defined when FEATURE_ETW is disabled, leading to build errors. Consider reintroducing the FEATURE_ETW guard or providing stub declarations.
    if (ETW::GCLog::ShouldWalkHeapObjectsForEtw())

src/coreclr/nativeaot/Runtime/eventtrace.cpp:277

  • The ForceGC call was previously guarded by FEATURE_ETW. With the guard removed, this call will be compiled when ETW support is absent, leading to missing symbols. Re-add an appropriate guard or ensure the methods exist on Linux.
        ETW::GCLog::ForceGC(l64ClientSequenceNumber);

@MichalStrehovsky
Copy link
Member Author

/azp run runtime-nativeaot-outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MichalStrehovsky
Copy link
Member Author

/azp run runtime-nativeaot-outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
@MichalStrehovsky MichalStrehovsky merged commit 47a4767 into dotnet:main Jun 20, 2025
98 of 100 checks passed
@MichalStrehovsky MichalStrehovsky deleted the fix116686 branch June 20, 2025 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GCDump tests failing on Linux
4 participants