Skip to content

Test failure JIT\\Regression\\JitBlue\\Runtime_45557\\Runtime_45557\\Runtime_45557.cmd #79518

Closed

Description

@v-wenyuxu

Run: runtime-coreclr gcstress-extra 20221210.1

Failed test:

coreclr windows arm64 Checked gcstress0xc_zapdisable_jitstress2 @ Windows.10.Arm64v8.Open

- JIT\\Regression\\JitBlue\\Runtime_45557\\Runtime_45557\\Runtime_45557.cmd

Error message:

Assert failure(PID 3328 [0x00000d00], Thread: 16148 [0x3f14]): (GetComponentSize() <= 2) || IsArray()

CORECLR! MethodTable::SanityCheck + 0x54 (0x00007ffe2d95e4dc) CORECLR! MethodTable::Validate + 0x1C (0x00007ffe2d9603b4)
CORECLR! Object::ValidateInner + 0x15C (0x00007ffe2d967634) CORECLR! Object::Validate + 0xA4 (0x00007ffe2d96741c)
CORECLR! GcInfoDecoder::ReportStackSlotToGC + 0x138 (0x00007ffe2db7cd98) CORECLR! GcInfoDecoder::EnumerateLiveSlots + 0x1390 (0x00007ffe2db7b7a8)
CORECLR! EECodeManager::EnumGcRefs + 0x2D0 (0x00007ffe2d8da450) CORECLR! GcStackCrawlCallBack + 0x434 (0x00007ffe2da39994)
CORECLR! Thread::StackWalkFramesEx + 0x240 (0x00007ffe2d994700) CORECLR! Thread::StackWalkFrames + 0x158 (0x00007ffe2d994418)
File: D:\a_work\1\s\src\coreclr\vm\methodtable.cpp Line: 6566
Image: D:\h\w\AF6B09BE\p\corerun.exe

Return code:      1
Raw output file:      D:\h\w\AF6B09BE\w\BF0D0A63\uploads\Reports\JIT.Regression\JitBlue\Runtime_45557\Runtime_45557\Runtime_45557.output.txt
Raw output:
BEGIN EXECUTION
"D:\h\w\AF6B09BE\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  Runtime_45557.dll
Expected: 100
Actual: -1073740286
END EXECUTION - FAILED
FAILED
Test Harness Exitcode is : 1
To run the test:

set CORE_ROOT=D:\h\w\AF6B09BE\p
D:\h\w\AF6B09BE\w\BF0D0A63\e\JIT\Regression\JitBlue\Runtime_45557\Runtime_45557\Runtime_45557.cmd
Expected: True
Actual:   False


Stack trace
   at JIT_Regression._JitBlue_Runtime_45557_Runtime_45557_Runtime_45557_._JitBlue_Runtime_45557_Runtime_45557_Runtime_45557_cmd()
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

Activity

  1. ghost added
    area-CodeGen-coreclr
    on Dec 12, 2022
  2. ghost added
    untriaged
    on Dec 12, 2022
  3. added this to the 8.0.0 milestone on Dec 13, 2022
  4. ghost removed
    untriaged
    on Dec 13, 2022
  5. v-wenyuxu commented on Dec 19, 2022

    @v-wenyuxu
    Author

    Failed again in: runtime-coreclr gcstress-extra 20221217.1

    Failed test:

    coreclr windows arm64 Checked gcstress0xc_zapdisable_jitstress2 @ Windows.10.Arm64v8.Open
    
    - JIT\\Regression\\JitBlue\\Runtime_45557\\Runtime_45557\\Runtime_45557.cmd
    

    Error message:

    Assert failure(PID 3152 [0x00000c50], Thread: 13928 [0x3668]): (GetComponentSize() <= 2) || IsArray()
    
    CORECLR! MethodTable::SanityCheck + 0x54 (0x00007ffb1491e50c) CORECLR! MethodTable::Validate + 0x1C (0x00007ffb149203e4)
    CORECLR! Object::ValidateInner + 0x15C (0x00007ffb14927664) CORECLR! Object::Validate + 0xA4 (0x00007ffb1492744c)
    CORECLR! GcInfoDecoder::ReportStackSlotToGC + 0x138 (0x00007ffb14b3cdc8) CORECLR! GcInfoDecoder::EnumerateLiveSlots + 0x1390 (0x00007ffb14b3b7d8)
    CORECLR! EECodeManager::EnumGcRefs + 0x2D0 (0x00007ffb1489a480) CORECLR! GcStackCrawlCallBack + 0x434 (0x00007ffb149f99c4)
    CORECLR! Thread::StackWalkFramesEx + 0x240 (0x00007ffb14954730) CORECLR! Thread::StackWalkFrames + 0x158 (0x00007ffb14954448)
    File: D:\a_work\1\s\src\coreclr\vm\methodtable.cpp Line: 6566
    Image: D:\h\w\A47108F4\p\corerun.exe
    
    Return code:      1
    Raw output file:      D:\h\w\A47108F4\w\AD04096C\uploads\Reports\JIT.Regression\JitBlue\Runtime_45557\Runtime_45557\Runtime_45557.output.txt
    Raw output:
    BEGIN EXECUTION
    "D:\h\w\A47108F4\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  Runtime_45557.dll
    Expected: 100
    Actual: -1073740286
    END EXECUTION - FAILED
    FAILED
    Test Harness Exitcode is : 1
    To run the test:
    
    set CORE_ROOT=D:\h\w\A47108F4\p
    D:\h\w\A47108F4\w\AD04096C\e\JIT\Regression\JitBlue\Runtime_45557\Runtime_45557\Runtime_45557.cmd
    Expected: True
    Actual:   False
    
    
    Stack trace
       at JIT_Regression._JitBlue_Runtime_45557_Runtime_45557_Runtime_45557_._JitBlue_Runtime_45557_Runtime_45557_Runtime_45557_cmd()
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
       at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    
  6. BruceForstall commented on Dec 22, 2022

    @BruceForstall
    Contributor

    The failure looks like a variation of #45557 that led to this unit test.

    After morph, we have a struct copy of a promoted field that is a struct of a single GC pointer:

    STMT00031 ( INL05 @ 0x018[E-] ... ??? ) <- INLRT @ 0x01C[E-]
                   [000149] -ACXG+-----                         *  ASG       struct (copy)
                   [000148] D----+-N---                         +--*  LCL_FLD   struct<System.Collections.Immutable.ImmutableArray`1, 8> V33 tmp29        [+0]
                   [000145] --CXG+-----                         \--*  CALL      struct System.Collections.Immutable.ImmutableArray:ToImmutableArray[System.__Canon](System.Collections.Generic.IEnumerable`1[System.__Canon]):System.Collections.Immutable.ImmutableArray`1[System.__Canon]
                   [000144] -----+----- arg1 in x1                 +--*  LCL_VAR   ref    V12 tmp8
                   [000146] H----+----- gctx in x0                 \--*  CNS_INT(h) long   0x7ff8eb060388 method
    

    In Lower, in the middle of processing, we have:

    N005 ( 22, 11) [000145] --CXG------                  t145 = *  CALL      ref    System.Collections.Immutable.ImmutableArray:ToImmutableArray[System.__Canon](System.Collections.Generic.IEnumerable`1[System.__Canon]):System.Collections.Immutable.ImmutableArray`1[System.__Canon] $104
                                                                /--*  t145   ref
    N007 ( 32, 20) [000149] DA-XG------                         *  STORE_LCL_FLD struct<System.Collections.Immutable.ImmutableArray`1, 8> V33 tmp29        d:2[+0]
    

    and then convert the STORE_LCL_FLD to:

    N005 ( 22, 11) [000145] --CXG------                  t145 = *  CALL      ref    System.Collections.Immutable.ImmutableArray:ToImmutableArray[System.__Canon](System.Collections.Generic.IEnumerable`1[System.__Canon]):System.Collections.Immutable.ImmutableArray`1[System.__Canon] $104
                   [000646] Dc---------                  t646 =    LCL_FLD_ADDR byref  V33 tmp29        [+0]
                                                                /--*  t646   byref
                                                                +--*  t145   ref
    N007 ( 32, 20) [000149] -A---------                         *  STOREIND  ref
    

    When we generate code for the STOREIND, we get:

    IN0076:                           str     x0, [fp, #0x60]   // [V33 tmp29]
    

    but we don't get the corresponding GC reference change of ; GC ptr vars +{V33}. So our codegen GC tracking sets are incorrect. This is because when we generate code, we call genUpdateLife() which calls UpdateLife() which calls fgIsIndirOfAddrOfLocal() on the LCL_FLD_ADDR, and fgIsIndirOfAddrOfLocal() does not know about LCL_FLD_ADDR. Thus, no codegen GC info is updated.

  7. BruceForstall commented on Dec 22, 2022

    @BruceForstall
    Contributor

    Previously, we had:

    N011 ( 37, 31) [000149] -ACXG---R--                         *  ASG       struct (copy) $VN.Void
    N010 (  9,  7) [000148] n---G--N---                         +--*  OBJ       struct<System.Collections.Immutable.ImmutableArray`1, 8> $VN.Void
    N009 (  3,  3) [000147] -----------                         |  \--*  ADDR      byref  $3c1
    N008 (  3,  2) [000146] D------N---                         |     \--*  LCL_VAR   ref    V41 tmp37        d:2 $VN.Void
    N007 ( 27, 23) [000143] -ACXG------                         \--*  CALL      struct System.Collections.Immutable.ImmutableArray:ToImmutableArray[System.__Canon](System.Collections.Generic.IEnumerable`1[System.__Canon]):System.Collections.Immutable.ImmutableArray`1[System.__Canon] $1c1
    N001 (  3,  2) [000142] ----------- arg1 in x1                 +--*  LCL_VAR   ref    V11 tmp7         u:2 (last use) <l:$2ca, c:$382>
    N006 ( 10, 17) [000643] -A--------- gctx in x0                 \--*  COMMA     long   $351
    N004 (  7, 15) [000641] -A------R--                               +--*  ASG       long   $VN.Void
    N003 (  3,  2) [000640] D------N---                               |  +--*  LCL_VAR   long   V61 cse4         d:1 $VN.Void
    N002 (  3, 12) [000144] H----------                               |  \--*  CNS_INT(h) long   0x7ff8c5313368 method $351
    N005 (  3,  2) [000642] -----------                               \--*  LCL_VAR   long   V61 cse4         u:1 $351
    

    which got rewritten in lower as:

    N007 ( 27, 23) [000143] --CXG------                  t143 = *  CALL      struct System.Collections.Immutable.ImmutableArray:ToImmutableArray[System.__Canon](System.Collections.Generic.IEnumerable`1[System.__Canon]):System.Collections.Immutable.ImmutableArray`1[System.__Canon] $1c1
    N008 (  3,  2) [000146] D------N---                  t146 =    LCL_VAR_ADDR byref  V41 tmp37        d:2
                                                                /--*  t146   byref
                                                                +--*  t143   struct
    N010 (  9,  7) [000148] nACXG------                         *  STORE_OBJ struct<System.Collections.Immutable.ImmutableArray`1, 8> (copy) $VN.Void
    

    which would be further rewritten as:

    N008 (  3,  2) [000146] Dc-----N---                  t146 =    LCL_VAR_ADDR byref  V41 tmp37        d:2
                                                                /--*  t146   byref
                                                                +--*  t143   ref
    N010 (  9,  7) [000148] -ACXG------                         *  STOREIND  ref
    

    so there was no LCL_FLD_ADDR involved.

  8. BruceForstall commented on Dec 22, 2022

    @BruceForstall
    Contributor

    Maybe fgIsIndirOfAddrOfLocal() and TreeLifeUpdater<ForCodeGen>::UpdateLifeVar() should handle LCL_VAR_ADDR?

    Lowering::LowerStoreSingleRegCallStruct() converts from STORE_OBJ to STOREIND. Maybe it shouldn't if the addr is a LCL_FLD_ADDR?

  9. BruceForstall commented on Dec 22, 2022

    @BruceForstall
    Contributor

    This regression is due to #78131.

    @SingleAccretion Can you take a look?

  10. SingleAccretion commented on Dec 22, 2022

    @SingleAccretion
    Contributor

    Of course; this is quite the old bug. I've been wondering how we haven't hit it until now. The fix is that tree life updater needs to handle LCL_FLD_ADDR as well.

  11. BruceForstall commented on Dec 22, 2022

    @BruceForstall
    Contributor

    Of course; this is quite the old bug. I've been wondering how we haven't hit it until now. The fix is that tree life updater needs to handle LCL_FLD_ADDR as well.

    I'm not sure that is correct: GC info only knows about registers or stack slots. Stack slots are GC/byref variables, not struct fields -- I believe structs are reported as untracked.

    It seems like maybe when we decide to convert a STORE_LCL_FLD to a STOREIND(LCL_FLD_ADDR), we should actually convert it to a STOREIND(LCL_VAR_ADDR). When we do the conversion to STOREIND(LCL_FLD_ADDR), what are the guarantees? In the case I'm looking at, it's a single-reg TYP_REF gc register struct, at offset zero. Can that be asserted? In that case, it seems converting to LCL_VAR_ADDR seems safe.

  12. SingleAccretion commented on Dec 22, 2022

    @SingleAccretion
    Contributor

    I'm not sure that is correct: GC info only knows about registers or stack slots.

    Yes, but GC info is just one user of liveness in codegen (the most prominent of course, but, e. g. debug info also uses it). The model is that whatever tree life updater does must match whatever the liveness pass has computed, which definitely means handling LCL_FLD_ADDR.

    Stack slots are GC/byref variables, not struct fields -- I believe structs are reported as untracked.

    That is true, and, I suspect, is the reason we haven't seen this kind of bug surface yet. But the reason it is true is also just a limitation of our liveness tracking implementation (we fail to do proper liveness updates for block stores, basically). There are TODO-CQs (and issues) which say we should improve it. Whether that's worth it is a separate topic, but it is definitely not a fundamental limitation.

    LCL_FLD_ADDR and LCL_VAR_ADDR

    LCL_FLD_ADDR at a zero offset must be equivalent to LCL_VAR_ADDR or illegal. I don't think making it illegal is a good idea, it would just make some code more complicated for no benefit. In fact, I think we should delete LCL_VAR_ADDR completely and use LCL_FLD_ADDR [0] as the representation for it, making things a little more canonical by default.

  13. ghost added
    in-pr
    on Dec 22, 2022
  14. ghost removed
    in-pr
    on Dec 27, 2022
  15. ghost locked as resolved and limited conversation to collaborators on Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

GCStressarch-arm64area-CodeGen-coreclrblocking-clean-ci-optionalos-windows

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions