Skip to content

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Sep 3, 2025

This regressed after #119176. Tiering is enabled by default so this bug slipped through.

@Copilot Copilot AI review requested due to automatic review settings September 3, 2025 04:30
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 regression where the interpreter attempts to free tiering-related data even when tiering is disabled. The issue was introduced in a previous PR (#119176) and wasn't caught because tiering is enabled by default in testing environments.

Key Changes

  • Adds an early return guard to prevent processing when tiering is disabled
  • Prevents potential crashes or undefined behavior when tiering functionality is turned off

Copy link
Contributor

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

@BrzVlad
Copy link
Member Author

BrzVlad commented Sep 9, 2025

/ba-g wasm unrelated failures

@BrzVlad BrzVlad merged commit e76141c into dotnet:main Sep 9, 2025
67 of 71 checks passed
BrzVlad added a commit to BrzVlad/runtime that referenced this pull request Sep 11, 2025
BrzVlad added a commit to BrzVlad/runtime that referenced this pull request Sep 12, 2025
…otnet#119176)

* [mono][interp] Fix leaking of compilation data

For dynamic methods, imethod_alloc0 allocates from the dynamic method's mempool which is freed when the method is collected. We were previously allocating only from the global memory manager.

* [mono][interp] Stop leaking data items

Previously we were registering imethod locations from these data items in order for them to be patched once a method is tiered up. Because of this registering, the data item had to always be around. We now free the data item for dynamic methods and also we deregister the patch locations when freeing such a method.

* [mono][interp] Free headers allocated for inlined methods

We add them to a list for later freeing. This uses the same pattern as jit.

* [mono][interp] Skip interp free for methods not yet compiled

Fix attempt to free tiering data when tiering is disabled (dotnet#119294)
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.

2 participants