Skip to content

Test failure: GC/API/GC/GetAllocatedBytesForCurrentThread/GetAllocatedBytesForCurrentThread.cmd #129723

Closed

Description

@VincentBu

Failed in: runtime-coreclr gcstress-extra 20260621.1

Failed tests:

coreclr linux arm64 Checked heapverify1 @ AzureLinux.3.Arm64.Open
- GC/API/GC/GetAllocatedBytesForCurrentThread/GetAllocatedBytesForCurrentThread.cmd

Error message:

apply_reg_state: ip and cfa unchanged; stopping here (ip=0xf67455a5b734)
waitpid() returned successfully (wstatus 00000000) WEXITSTATUS 0 WTERMSIG 0
/datadisks/disk1/work/A71108D3/w/B0F40996/e/GC/GC/../API/GC/GetAllocatedBytesForCurrentThread/GetAllocatedBytesForCurrentThread.sh: line 441:  7536 Aborted                 (core dumped) $LAUNCHER $ExePath "${CLRTestExecutionArguments[@]}"

Return code:      1
Raw output file:      /datadisks/disk1/work/A71108D3/w/B0F40996/uploads/API/GC/GetAllocatedBytesForCurrentThread/output.txt
Raw output:
BEGIN EXECUTION
/datadisks/disk1/work/A71108D3/p/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true GetAllocatedBytesForCurrentThread.dll ''
allocating 117007480 bytes
iter 0 allocated 117008000 bytes
allocating 62403353 bytes
iter 1 allocated 62404041 bytes
allocating 48075703 bytes
iter 2 allocated 48076667 bytes
allocating 122546489 bytes
iter 3 allocated 122547106 bytes
allocating 108836908 bytes
iter 4 allocated 108837404 bytes
allocating 63562993 bytes
iter 5 allocated 63563361 bytes
allocating 63907165 bytes
iter 6 allocated 63907914 bytes
allocating 64314286 bytes
iter 7 allocated 64314593 bytes
allocating 74320065 bytes
iter 8 allocated 74320608 bytes
allocating 42015485 bytes
iter 9 allocated 42016014 bytes
allocating 102409902 bytes
iter 10 allocated 102410463 bytes
allocating 42235886 bytes
iter 11 allocated 42236098 bytes
allocating 124668801 bytes
iter 12 allocated 124669108 bytes
allocating 52711443 bytes
iter 13 allocated 52711597 bytes
allocating 103646683 bytes
iter 14 allocated 103647149 bytes
allocating 125768590 bytes
iter 15 allocated 125768600 bytes
allocating 98782761 bytes
iter 16 allocated 98782853 bytes
allocating 116576653 bytes
iter 17 allocated 116577280 bytes
allocating 77466498 bytes
iter 18 allocated 77466544 bytes
allocating 45360594 bytes
iter 19 allocated 45360845 bytes
allocating 122725185 bytes
iter 20 allocated 122725318 bytes
allocating 44323088 bytes
iter 21 allocated 44323129 bytes
allocating 44984829 bytes
iter 22 allocated 44984844 bytes
allocating 106634547 bytes
iter 23 allocated 106634772 bytes
allocating 99828451 bytes
iter 24 allocated 99829134 bytes
allocating 90613995 bytes
iter 25 allocated 90614602 bytes
allocating 70578348 bytes
iter 26 allocated 70578476 bytes
allocating 116071369 bytes
iter 27 allocated 116071830 bytes
allocating 81837505 bytes
iter 28 allocated 81837802 bytes
allocating 96369238 bytes
iter 29 allocated 96370016 bytes
allocating 107151796 bytes
iter 30 allocated 107152529 bytes
allocating 92040649 bytes
iter 31 allocated 92041142 bytes
allocating 108831680 bytes
iter 32 allocated 108832489 bytes
allocating 105476653 bytes
iter 33 allocated 105476662 bytes
allocating 44231032 bytes
iter 34 allocated 44231042 bytes
allocating 82061796 bytes
iter 35 allocated 82062041 bytes
allocating 107964484 bytes
iter 36 allocated 107964530 bytes
allocating 110677161 bytes
iter 37 allocated 110677401 bytes
allocating 95736033 bytes
iter 38 allocated 95736332 bytes
allocating 122797427 bytes
iter 39 allocated 122797597 bytes
allocating 116014807 bytes
iter 40 allocated 116015259 bytes
allocating 42735801 bytes
iter 41 allocated 42736466 bytes
allocating 80456282 bytes
iter 42 allocated 80456410 bytes
allocating 74724774 bytes
iter 43 allocated 74725392 bytes
allocating 107735143 bytes
iter 44 allocated 107735528 bytes
allocating 86691186 bytes
iter 45 allocated 86691806 bytes
allocating 107167922 bytes
iter 46 allocated 107168054 bytes
allocating 110081870 bytes
iter 47 allocated 110081872 bytes
allocating 89817535 bytes
iter 48 allocated 89818028 bytes
allocating 109096957 bytes
iter 49 allocated 109096963 bytes
allocating 83928496 bytes
iter 50 allocated 83928708 bytes
allocating 54082808 bytes
iter 51 allocated 54083310 bytes
allocating 119403509 bytes
iter 52 allocated 119404194 bytes
allocating 83940585 bytes
iter 53 allocated 83940868

Stack trace:

   at Xunit.Assert.True(Nullable`1 condition, String userMessage) in /_/src/arcade/src/Microsoft.DotNet.XUnitAssert/src/BooleanAsserts.cs:line 135
   at Program.<<Main>$>g__TestExecutor51|0_52(StreamWriter tempLogSw, StreamWriter statsCsvSw, <>c__DisplayClass0_0&)

Kusto query result:

Queued Pipeline Pipeline Configuration OS Arch Test Outcome Properties Build Reason
2026-03-29 14:05:31.665000+00:00 gc-standalone Checked-gcstandaloneserver azurelinux.3.amd64.open.rt x64 GC/API/GC/GetAllocatedBytesForCurrentThread/GetAllocatedBytesForCurrentThread.cmd Failed {"System.JobName":"__default","System.JobAttempt":"1","Reason":"Schedule","architecture":"x64","System.StageAttempt":"1","System.PhaseName":"run_test_p1_GCStandAloneServer_linux_x64_checked","operatingSystem":"AzureLinux.3.Amd64.Open","System.JobId":"112f63b4-fcd2-58bd-202f-bd8d8cf97c01","configuration":"Checked-gcstandaloneserver","AzurePipelinesTestRunId":"37919004","DefinitionName":"gc-standalone","System.PhaseAttempt":"1","DefinitionId":"146","BuildId":"1356972","BuildNumber":"20260329.1","System.StageName":"Build","CollectionUri":"https://dev.azure.com/dnceng-public/","Project":"public"} Schedule
2026-03-05 15:09:07.422000+00:00 gc-standalone Checked-gcstandaloneserver azurelinux.3.amd64.open.rt x64 GC/API/GC/GetAllocatedBytesForCurrentThread/GetAllocatedBytesForCurrentThread.cmd Failed {"BuildId":"1321937","DefinitionId":"146","architecture":"x64","System.StageName":"Build","Reason":"Schedule","System.StageAttempt":"1","configuration":"Checked-gcstandaloneserver","BuildNumber":"20260305.1","System.JobId":"112f63b4-fcd2-58bd-202f-bd8d8cf97c01","DefinitionName":"gc-standalone","operatingSystem":"AzureLinux.3.Amd64.Open","System.JobName":"__default","Project":"public","System.JobAttempt":"1","AzurePipelinesTestRunId":"36912056","CollectionUri":"https://dev.azure.com/dnceng-public/","System.PhaseName":"run_test_p1_GCStandAloneServer_linux_x64_checked","System.PhaseAttempt":"1"} Schedule
2026-02-22 15:08:15.807000+00:00 gc-standalone Checked-gcstandaloneserver azurelinux.3.amd64.open.rt x64 GC/API/GC/GetAllocatedBytesForCurrentThread/GetAllocatedBytesForCurrentThread.cmd Failed {"DefinitionName":"gc-standalone","System.StageAttempt":"1","BuildNumber":"20260222.1","System.PhaseAttempt":"1","DefinitionId":"146","CollectionUri":"https://dev.azure.com/dnceng-public/","AzurePipelinesTestRunId":"36436468","BuildId":"1304532","System.PhaseName":"run_test_p1_GCStandAloneServer_linux_x64_checked","configuration":"Checked-gcstandaloneserver","System.JobId":"112f63b4-fcd2-58bd-202f-bd8d8cf97c01","System.JobName":"__default","Project":"public","System.StageName":"Build","Reason":"Schedule","operatingSystem":"AzureLinux.3.Amd64.Open","System.JobAttempt":"1","architecture":"x64"} Schedule

Activity

  1. added
    untriaged
    on Jun 23, 2026
  2. dotnet-policy-service commented on Jun 23, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @anicka-net, @dotnet/gc
    See info in area-owners.md if you want to be subscribed.

  3. janvorli commented on Jun 25, 2026

    @janvorli
    Member

    A quick look at the dump reveals that the failure is due to the gc_heap::verify_soh_segment_list failing the following check for gen 0:

    #ifdef USE_REGIONS
    if (last_seg != generation_tail_region (gen))
    #else
    if (last_seg != ephemeral_heap_segment)
    #endif //USE_REGIONS
    {
    FATAL_GC_ERROR();
    }

  4. janvorli commented on Jun 25, 2026

    @janvorli
    Member

    It seems it might be a race between this check and adding a new segment to the list.

    • The loop starts at gen->start_segment, which is at 0x0000f6701de0af98.
    • The gen->start_segment->next is 0x0000f6701de0b040 -> this is what we got as last_seg in the comparison (reg x19)
    • The gen->start_segment->next->next is 0x0000f6701de0b190 -> this is what generation_tail_region (gen) gets and that we compare the last_seg with
    • The gen->start_segment->next->next->next is NULL

    So it seems that the loop terminated when the 0x0000f6701de0b040 was the last segment on the list, then another thread added 0x0000f6701de0b190 to the list and then the check failed.

  5. janvorli commented on Jun 25, 2026

    @janvorli
    Member

    I believe I was right with the analysis. Since this is a debugging feature and there is no real corruption of the list, it seems that detecting if this race is possible and exiting the gc_heap::verify_soh_segment_list in that case would be a sufficient fix.

  6. added a commit that references this issue on Jul 7, 2026
    5181654
  7. removed
    untriaged
    on Jul 7, 2026
  8. added a commit that references this issue on Jul 15, 2026
    fb37f52
  9. locked and limited conversation to collaborators on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions