Skip to content

listnearobj can't confirm heap consistency with .NET 7 #3566

Closed

Description

@omajid

Description

Running listnearobj against the first address of gen0, we would get output like this with .NET 6:

Before:  00007f807ffff000           24 (0x18)	Free
Current: 00007f807ffff018           24 (0x18)	Free
After:   00007f807ffff030           24 (0x18)	Free
Heap local consistency confirmed.

With .NET 7:

Before: couldn't find any object between 0X00007F2B20800020 and 0X00007F2B20800020
Current: 00007f2b20800020           64 (0x40)   System.Action`1[[System.Object, System.Private.CoreLib]]
After:   00007f2b20800060           64 (0x40)   System.Threading.CancellationTokenSource+Registrations
Heap local consistency not confirmed.

The "not confirmed" part seems surprising to me. Is this a known issue? Or should I provide more details?

Configuration

  • Is this related to a specific tool?: dotnet-dump/dotnet dump analyze
  • What's the output of dotnet info
$ dotnet --info
.NET SDK:
 Version:   7.0.101
 Commit:    bb24aafa11

Runtime Environment:
 OS Name:     fedora
 OS Version:  37
 OS Platform: Linux
 RID:         fedora.37-x64
 Base Path:   /home/omajid/local/dotnet/microsoft/7.0.101/sdk/7.0.101/

Host:
  Version:      7.0.1
  Architecture: x64
  Commit:       97203d38ba

.NET SDKs installed:
  7.0.101 [/home/omajid/local/dotnet/microsoft/7.0.101/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.1 [/home/omajid/local/dotnet/microsoft/7.0.101/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.1 [/home/omajid/local/dotnet/microsoft/7.0.101/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/home/omajid/local/dotnet/microsoft/7.0.101/]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Regression?

  • Did this work in a previous build or release - either of the tool or of the .NET runtime being used?

Yes, with .NET 6 , listnearobj could confirm heap consistency.

Other information

Activity

  1. added
    bug
    on Dec 21, 2022
  2. self-assigned this
    on Dec 21, 2022
  3. added this to the 8.0.0 milestone on Dec 21, 2022
  4. hoyosjs commented on Dec 27, 2022

    @hoyosjs
    Member

    This might be related to the way the command was implemented and the way segments vs regions works.

  5. cshung commented on Jan 5, 2023

    @cshung
    Contributor

    The presentation is questionable, but the behavior is by design. In .NET 7, we switched to USE_REGIONS, and with USE_REGIONS, we no longer need to have a free object at the first address of gen 0. So there is nothing before the first object. Nothing is wrong with that.

  6. leculver commented on Feb 20, 2023

    @leculver
    Contributor

    The presentation is questionable, but the behavior is by design. In .NET 7, we switched to USE_REGIONS, and with USE_REGIONS, we no longer need to have a free object at the first address of gen 0. So there is nothing before the first object. Nothing is wrong with that.

    Nothing is wrong with not putting a free object first, but the output of !listnearobj still needs to be fixed, or folks will suspect that something is wrong with the heap. If GC features break diagnostics, the work still has to be done to clean up the diagnostic output, even if the new GC behavior is expected.

  7. leculver commented on Mar 10, 2023

    @leculver
    Contributor

    Assigning to myself as part of #3736.

  8. ghost locked as resolved and limited conversation to collaborators on Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions