Skip to content

Segmentation fault in ilc when building native code for System.Reflection.Tests (NativeAOT, ARM64, Ubuntu 18.04)  #71270

Closed

Description

@Beau-Gosse-dev

Notes

  • This only seems to reproduce with the Release configuration, not Debug.
  • This is just a targeted reproduction that was originally found when running this command from the repo root: ./build.sh clr.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs+libs.tests -rc Release -lc Release /p:TestNativeAot=true
  • Originally found when trying to reproduce another issue: [NativeAOT] Enable Reflection library tests in Linux-ARM64 #70010

Reproduction Steps

  1. On ARM64 Ubuntu 18.04
  2. Make sure bin artifacts are cleared out to rebuild rm -rf /home/ubuntu/code/runtime/artifacts/bin/System.Reflection.Tests/
  3. Make sure obj artifacts are cleared out to rebuild rm -rf /home/ubuntu/code/runtime/artifacts/obj/System.Reflection.Tests/
  4. Navigate to reflection tests cd ~/code/runtime/src/libraries/System.Reflection/tests
  5. Run tests for NativeAOT ../../../../dotnet.sh build /t:Test /p:TestNativeAot=true -c Release -v d

Debugging Steps (after running Reproduction Steps):

  1. Setup symbols for debugging cp /home/ubuntu/code/runtime/artifacts/bin/coreclr/Linux.arm64.Release/*.dbg /home/ubuntu/code/runtime/artifacts/bin/coreclr/Linux.arm64.Release/ilc
  2. Point gdb to ilc gdb /home/ubuntu/code/runtime/artifacts/bin/coreclr/Linux.arm64.Release/ilc/ilc
  3. Tell gdb where symbols are set debug-file-directory /home/ubuntu/code/runtime/artifacts/bin/coreclr/Linux.arm64.Release/ilc
  4. Run against reflection tests r @"/home/ubuntu/code/runtime/artifacts/obj/System.Reflection.Tests/Release/net7.0/native/System.Reflection.Tests.ilc.rsp"

Error

Thread 37 ".NET ThreadPool" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xffbe66ffd1c0 (LWP 18899)]
GenTreeUseEdgeIterator::AdvanceCall<0> (this=0xffbe66ffb508) at /home/ubuntu/code/runtime/src/coreclr/jit/gentree.cpp:9650
9650                    m_statePtr = arg->GetLateNext();
(gdb) bt
#0  GenTreeUseEdgeIterator::AdvanceCall<0> (this=0xffbe66ffb508) at /home/ubuntu/code/runtime/src/coreclr/jit/gentree.cpp:9650
#1  GenTreeUseEdgeIterator::GenTreeUseEdgeIterator (this=0xffbe66ffb508, node=0xffbe5c036db0) at /home/ubuntu/code/runtime/src/coreclr/jit/gentree.cpp:9357
#2  0x0000ffbe88221e44 in Compiler::fgGetFirstNode (tree=0xffbe5c036db0) at /home/ubuntu/code/runtime/src/coreclr/jit/flowgraph.cpp:4119
#3  0x0000ffbe882e6e30 in Rationalizer::RewriteNodeAsCall (this=0xffbe66ffb768, use=0xffbe5c037d08, parents=..., callHnd=<optimized out>, entryPoint=..., arg1=0xffbe5c031e50, arg2=0x0) at /home/ubuntu/code/runtime/src/coreclr/jit/rationalize.cpp:163
#4  0x0000ffbe882e81fc in Rationalizer::RewriteIntrinsicAsUserCall (this=0xffbe66ffb508, use=<optimized out>, parents=...) at /home/ubuntu/code/runtime/src/coreclr/jit/rationalize.cpp:244
#5  Rationalizer::DoPhase()::RationalizeVisitor::PreOrderVisit(GenTree**, GenTree*) (this=<optimized out>, use=<optimized out>, user=<optimized out>) at /home/ubuntu/code/runtime/src/coreclr/jit/rationalize.cpp:818
#6  GenTreeVisitor<Rationalizer::DoPhase()::RationalizeVisitor>::WalkTree(GenTree**, GenTree*) (this=<optimized out>, use=<optimized out>, user=<optimized out>) at /home/ubuntu/code/runtime/src/coreclr/jit/compiler.h:10673
#7  0x0000ffbe882e831c in GenTreeVisitor<Rationalizer::DoPhase()::RationalizeVisitor>::WalkTree(GenTree**, GenTree*) (this=<optimized out>, use=<optimized out>, user=<optimized out>) at /home/ubuntu/code/runtime/src/coreclr/jit/compiler.h:11013
#8  0x0000ffbe882e8048 in Rationalizer::DoPhase (this=0xffbe66ffb768) at /home/ubuntu/code/runtime/src/coreclr/jit/rationalize.cpp:888
#9  0x0000ffbe882e1fe0 in Phase::Run (this=0xffbe66ffb768) at /home/ubuntu/code/runtime/src/coreclr/jit/phase.cpp:61
#10 0x0000ffbe881f2110 in Compiler::compCompile (this=<optimized out>, methodCodePtr=<optimized out>, methodCodeSize=<optimized out>, compileFlags=<optimized out>) at /home/ubuntu/code/runtime/src/coreclr/jit/compiler.cpp:5029
#11 0x0000ffbe881f3658 in Compiler::compCompileHelper (this=0xffbe5c02e3b8, classPtr=<optimized out>, compHnd=<optimized out>, methodInfo=0xffbe66ffbe40, methodCodePtr=0xffbe66ffbc10, methodCodeSize=0xffbe66ffbe20, compileFlags=0xffbe66ffbc28)
    at /home/ubuntu/code/runtime/src/coreclr/jit/compiler.cpp:6753
#12 0x0000ffbe881f2e10 in Compiler::compCompile(CORINFO_MODULE_STRUCT_*, void**, unsigned int*, JitFlags*)::$_11::operator()(Compiler::compCompile(CORINFO_MODULE_STRUCT_*, void**, unsigned int*, JitFlags*)::__JITParam*) const (this=<optimized out>, __JITpParam=<optimized out>)
    at /home/ubuntu/code/runtime/src/coreclr/jit/compiler.cpp:5899
#13 Compiler::compCompile (this=0xffbe5c02e3b8, classPtr=0x436d80, methodCodePtr=0xffbe66ffbc10, methodCodeSize=0xffbe66ffbe20, compileFlags=0xffbe66ffbc28) at /home/ubuntu/code/runtime/src/coreclr/jit/compiler.cpp:5918
#14 0x0000ffbe881f3f2c in jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::$_13::operator()(jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::__JITParam*) const::{lambda(jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::$_13::operator()(jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::__JITParam*) const::__JITParam*)#1}::operator()(jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::$_13::operator()(jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::__JITParam*) const::__JITParam*) const (this=<optimized out>, __JITpParam=<optimized out>)
    at /home/ubuntu/code/runtime/src/coreclr/jit/compiler.cpp:7399
#15 jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::$_13::operator()(jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::__JITParam*) const (this=<optimized out>, __JITpParam=<optimized out>) at /home/ubuntu/code/runtime/src/coreclr/jit/compiler.cpp:7424
#16 jitNativeCode (methodHnd=0x436d78, classPtr=0x436d80, compHnd=0xffbe66ffbc70, methodInfo=0xffbe66ffbe40, methodCodePtr=0xffbe66ffbc10, methodCodeSize=0xffbe66ffbe20, compileFlags=0xffbe66ffbc28, inlineInfoPtr=0x0)
    at /home/ubuntu/code/runtime/src/coreclr/jit/compiler.cpp:7426
#17 0x0000ffbe881f80a8 in CILJit::compileMethod (this=<optimized out>, compHnd=0xffbe66ffbc70, methodInfo=0xffbe66ffbe40, flags=<optimized out>, entryAddress=<optimized out>, nativeSizeOfCode=0x420968) at /home/ubuntu/code/runtime/src/coreclr/jit/ee_il_dll.cpp:276
#18 0x0000ffbe8846f4d4 in JitCompileMethod (ppException=0xffbe66ffbe30, pJit=0xffbe884310d0 <operator new(unsigned long, CILJitSingletonAllocator const&)::CILJitBuff>, thisHandle=0xffbe66ffbe38, callbacks=<optimized out>, methodInfo=<optimized out>, flags=<optimized out>,
    entryAddress=0xffbe66ffbe28, nativeSizeOfCode=0xffbe66ffbe20) at /home/ubuntu/code/runtime/src/coreclr/tools/aot/jitinterface/jitwrapper.cpp:34
#19 0x0000ffff8075ae1c in ?? ()
#20 0x0000fffff7a45328 in ?? () from /home/ubuntu/code/runtime/artifacts/bin/coreclr/Linux.arm64.Release/ilc/libcoreclr.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Activity

  1. ghost added
    area-Infrastructure-coreclr
    on Jun 24, 2022
  2. ghost added
    untriaged
    on Jun 24, 2022
  3. jkotas commented on Jun 24, 2022

    @jkotas
    Member

    Could you please get a stacktrace of the crash with symbols? You may need to tell the gdb to load the symbols from /home/ubuntu/code/runtime/artifacts/bin/coreclr/Linux.arm64.Release, or copy the *.dbg files from /home/ubuntu/code/runtime/artifacts/bin/coreclr/Linux.arm64.Release to /home/ubuntu/code/runtime/artifacts/bin/coreclr/Linux.arm64.Release/ilc.

  4. Beau-Gosse-dev commented on Jun 24, 2022

    @Beau-Gosse-dev
    ContributorAuthor

    Thanks, @jkotas I was wondering how to get the symbols. I've updated the original issue with the symbol filled bt.

    When running in gdb, I did see warning: the debug information found in "/home/ubuntu/code/runtime/artifacts/bin/coreclr/Linux.arm64.Release/ilc/libclrjit.so.dbg" does not match "/home/ubuntu/code/runtime/artifacts/bin/coreclr/Linux.arm64.Release/ilc/libclrjit.so" (CRC mismatch).

    Is that actually an issue?

  5. added
    area-CodeGen-coreclr
    and removed on Jun 24, 2022
  6. added this to the 7.0.0 milestone on Jun 24, 2022
  7. ghost removed
    untriaged
    on Jun 24, 2022
  8. jkotas commented on Jun 24, 2022

    @jkotas
    Member

    JIT crash in Rationalizer. cc @dotnet/jit-contrib

  9. added and removed
    area-CodeGen-coreclr
    on Jun 24, 2022
  10. 28 remaining items

  11. am11 commented on Jul 5, 2022

    @am11
    Member

    We can also detect if the argument is missing and adjust the condition accordingly. e.g. this is how we detect if dsymutil supports --minimizeon macOS:

    execute_process(
    COMMAND ${DSYMUTIL} --help
    OUTPUT_VARIABLE DSYMUTIL_HELP_OUTPUT
    )
    set(DSYMUTIL_OPTS "--flat")
    if ("${DSYMUTIL_HELP_OUTPUT}" MATCHES "--minimize")
    list(APPEND DSYMUTIL_OPTS "--minimize")
    endif ()

  12. hoyosjs commented on Jul 5, 2022

    @hoyosjs
    Member

    This was llvm-objcopy 8, we probably need to check dynamically if we are going to support using RedHat's version of clang for RHEL7 (llvm 7)

  13. jakobbotsch commented on Jul 21, 2022

    @jakobbotsch
    Member

    Assuming the above is resolved now. Are you still able to reproduce the issue and can you share a dump if so @Beau-Gosse-dev?

  14. added
    needs-author-action
    and removed
    needs-further-triage
    on Jul 21, 2022
  15. Beau-Gosse-dev commented on Jul 21, 2022

    @Beau-Gosse-dev
    ContributorAuthor

    So it seems like the second issue, not being able to build clr.alljits, is fixed. However, the original issue still reproduces. Here is the new BT from gdb (seems the same as the original issue).

    @jakobbotsch When you say you want the dump is that generated in gdb with generate-core-file ~/dumpfile ? When call that, the output file is 4.6G, is that what you want me to upload? I may need to find a new place to host it, I'm not sure GitHub allows files that big.

    Thread 25 ".NET ThreadPool" received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 0xffbed95301c0 (LWP 12746)]
    GenTreeUseEdgeIterator::AdvanceCall<0> (this=0xffbed952e4b8) at /home/ubuntu/runtime/src/coreclr/jit/gentree.cpp:9660
    9660                    m_statePtr = arg->GetLateNext();
    (gdb) bt
    #0  GenTreeUseEdgeIterator::AdvanceCall<0> (this=0xffbed952e4b8) at /home/ubuntu/runtime/src/coreclr/jit/gentree.cpp:9660
    #1  GenTreeUseEdgeIterator::GenTreeUseEdgeIterator (this=0xffbed952e4b8, node=0xffbe8c0276f0) at /home/ubuntu/runtime/src/coreclr/jit/gentree.cpp:9367
    #2  0x0000ffff7d4746b4 in Compiler::fgGetFirstNode (tree=0xffbe8c0276f0) at /home/ubuntu/runtime/src/coreclr/jit/flowgraph.cpp:4222
    #3  0x0000ffff7d53a028 in Rationalizer::RewriteNodeAsCall (this=0xffbed952e718, use=0xffbe8c028760, parents=..., callHnd=<optimized out>, entryPoint=..., arg1=0xffbe8c022640, arg2=0x0) at /home/ubuntu/runtime/src/coreclr/jit/rationalize.cpp:163
    #4  0x0000ffff7d53b3f4 in Rationalizer::RewriteIntrinsicAsUserCall (this=0xffbed952e4b8, use=<optimized out>, parents=...) at /home/ubuntu/runtime/src/coreclr/jit/rationalize.cpp:244
    #5  Rationalizer::DoPhase()::RationalizeVisitor::PreOrderVisit(GenTree**, GenTree*) (this=<optimized out>, use=<optimized out>, user=<optimized out>) at /home/ubuntu/runtime/src/coreclr/jit/rationalize.cpp:818
    #6  GenTreeVisitor<Rationalizer::DoPhase()::RationalizeVisitor>::WalkTree(GenTree**, GenTree*) (this=<optimized out>, use=<optimized out>, user=<optimized out>) at /home/ubuntu/runtime/src/coreclr/jit/compiler.h:10668
    #7  0x0000ffff7d53b608 in GenTreeVisitor<Rationalizer::DoPhase()::RationalizeVisitor>::WalkTree(GenTree**, GenTree*) (this=<optimized out>, use=<optimized out>, user=<optimized out>) at /home/ubuntu/runtime/src/coreclr/jit/compiler.h:11010
    #8  0x0000ffff7d53b240 in Rationalizer::DoPhase (this=0xffbed952e718) at /home/ubuntu/runtime/src/coreclr/jit/rationalize.cpp:888
    #9  0x0000ffff7d5351e8 in Phase::Run (this=0xffbed952e718) at /home/ubuntu/runtime/src/coreclr/jit/phase.cpp:61
    #10 0x0000ffff7d44466c in Compiler::compCompile (this=<optimized out>, methodCodePtr=<optimized out>, methodCodeSize=<optimized out>, compileFlags=<optimized out>) at /home/ubuntu/runtime/src/coreclr/jit/compiler.cpp:5061
    #11 0x0000ffff7d445cbc in Compiler::compCompileHelper (this=0xffbe8c01ec28, classPtr=<optimized out>, compHnd=<optimized out>, methodInfo=0xffbed952edf0, methodCodePtr=0xffbed952ebc0, methodCodeSize=0xffbed952edd0, compileFlags=0xffbed952ebd8)
        at /home/ubuntu/runtime/src/coreclr/jit/compiler.cpp:6785
    #12 0x0000ffff7d4453c8 in Compiler::compCompile(CORINFO_MODULE_STRUCT_*, void**, unsigned int*, JitFlags*)::$_11::operator()(Compiler::compCompile(CORINFO_MODULE_STRUCT_*, void**, unsigned int*, JitFlags*)::__JITParam*) const (this=<optimized out>, __JITpParam=<optimized out>)
        at /home/ubuntu/runtime/src/coreclr/jit/compiler.cpp:5931
    #13 Compiler::compCompile (this=0xffbe8c01ec28, classPtr=0x4381e8, methodCodePtr=0xffbed952ebc0, methodCodeSize=0xffbed952edd0, compileFlags=0xffbed952ebd8) at /home/ubuntu/runtime/src/coreclr/jit/compiler.cpp:5950
    #14 0x0000ffff7d446590 in jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::$_13::operator()(jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::__JITParam*) const::{lambda(jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::$_13::operator()(jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::__JITParam*) const::__JITParam*)#1}::operator()(jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::$_13::operator()(jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::__JITParam*) const::__JITParam*) const (this=<optimized out>, __JITpParam=<optimized out>)
        at /home/ubuntu/runtime/src/coreclr/jit/compiler.cpp:7431
    #15 jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::$_13::operator()(jitNativeCode(CORINFO_METHOD_STRUCT_*, CORINFO_MODULE_STRUCT_*, ICorJitInfo*, CORINFO_METHOD_INFO*, void**, unsigned int*, JitFlags*, void*)::__JITParam*) const (this=<optimized out>, __JITpParam=<optimized out>) at /home/ubuntu/runtime/src/coreclr/jit/compiler.cpp:7456
    #16 jitNativeCode (methodHnd=0x4381e0, classPtr=0x4381e8, compHnd=0xffbed952ec20, methodInfo=0xffbed952edf0, methodCodePtr=0xffbed952ebc0, methodCodeSize=0xffbed952edd0, compileFlags=0xffbed952ebd8, inlineInfoPtr=0x0) at /home/ubuntu/runtime/src/coreclr/jit/compiler.cpp:7458
    #17 0x0000ffff7d44a8a0 in CILJit::compileMethod (this=<optimized out>, compHnd=0xffbed952ec20, methodInfo=0xffbed952edf0, flags=<optimized out>, entryAddress=<optimized out>, nativeSizeOfCode=0x421210) at /home/ubuntu/runtime/src/coreclr/jit/ee_il_dll.cpp:276
    #18 0x0000ffff7d6c4584 in JitCompileMethod (ppException=0xffbed952ede0, pJit=0xffff7d686178 <operator new(unsigned long, CILJitSingletonAllocator const&)::CILJitBuff>, thisHandle=0xffbed952ede8, callbacks=<optimized out>, methodInfo=<optimized out>, flags=<optimized out>,
        entryAddress=0xffbed952edd8, nativeSizeOfCode=0xffbed952edd0) at /home/ubuntu/runtime/src/coreclr/tools/aot/jitinterface/jitwrapper.cpp:34
    #19 0x0000ffff8078c5e4 in ?? ()
    #20 0x0000fffff7a45328 in ?? () from /home/ubuntu/runtime/artifacts/bin/coreclr/Linux.arm64.Release/ilc/libcoreclr.so
    Backtrace stopped: previous frame inner to this frame (corrupt stack?)
    
  16. ghost added
    needs-further-triage
    on Jul 21, 2022
  17. ghost removed
    needs-author-action
    on Jul 21, 2022
  18. jakobbotsch commented on Jul 21, 2022

    @jakobbotsch
    Member

    @jakobbotsch When you say you want the dump is that generated in gdb with generate-core-file ~/dumpfile ? When call that, the output file is 4.6G, is that what you want me to upload?

    Yes, that and the ilc folder contents would be helpful. You might be able to make a smaller repro using --singlemethodtypename and --singlemethodname args to ilc, if you can dig out the exact function it is compiling that is causing the problem (that is probably visible in the log if you do a run with --verbose and --parallelism 1 first).

  19. jakobbotsch commented on Jul 22, 2022

    @jakobbotsch
    Member

    Looking at the dump clang's codegen for AdvanceCall looks incorrect. it is skipping a null check that is present in the source code. In fact, it is missing a lot of code present in the source code due to assuming this null check always passes.

    I can see that the JIT in the dump you sent me is built with clang-6. Can you try a newer version of clang? The codegen for this function looks completely different for me using clang-9.

  20. jakobbotsch commented on Jul 22, 2022

    @jakobbotsch
    Member

    Pseudocode from clang-6 from your dump (without symbols):

        case 0x6F:
          v11 = *(_QWORD **)(a2 + 48);
          result = vdupq_n_s64(0LL);
          result.n128_u64[0] = (unsigned __int64)sub_FFFF7CC2BC54;
          *(_QWORD *)(a1 + 32) = v11;
          *(int64x2_t *)a1 = result;
          if ( !v11 )
            goto LABEL_27;
          while ( 1 )
          {
            *(_QWORD *)(a1 + 24) = v11;
            v12 = (_QWORD *)v11[2];
            *(_QWORD *)(a1 + 32) = v12;
            if ( *v11 )
              break;
            v11 = v12;
            if ( !v12 )
            {
    LABEL_27:
              v13 = *(_QWORD *)(a2 + 56);
              result = vdupq_n_s64(0LL);
              result.n128_u64[0] = (unsigned __int64)sub_FFFF7CC2CA98;
              *(int64x2_t *)a1 = result;
              *(_QWORD *)(a1 + 24) = v13 + 8;
              *(_QWORD *)(a1 + 32) = *(_QWORD *)(v13 + 24); // segfault here
              return result;
            }
          }
          return result;

    Pseudocode from clang-9 (with symbols):

        case 0x6F:
          v14 = *(__int64 **)(a2 + 48);
          *(_QWORD *)(result + 32) = v14;
          *(_OWORD *)result = (unsigned __int64)GenTreeUseEdgeIterator::AdvanceCall<0>;
          while ( v14 )
          {
            *(_QWORD *)(result + 24) = v14;
            v15 = (__int64 *)v14[2];
            *(_QWORD *)(result + 32) = v15;
            v16 = *v14;
            v14 = v15;
            if ( v16 )
              return result;
          }
          v17 = *(_QWORD *)(a2 + 56);
          *((_QWORD *)&v18 + 1) = 0LL;
          *(_QWORD *)(result + 32) = v17;
          *(_OWORD *)result = (unsigned __int64)GenTreeUseEdgeIterator::AdvanceCall<1>;
          if ( v17 ) // clang-6 codegen is missing this check and assumes it passes
          {
            *(_QWORD *)(result + 24) = v17 + 8;
            *(_QWORD *)(result + 32) = *(_QWORD *)(v17 + 24);
          }
          else
          {
            *(_QWORD *)&v18 = GenTreeUseEdgeIterator::AdvanceCall<2>;
            *(_OWORD *)result = v18;
            v19 = *(_BYTE *)(a2 + 92) & 7;
            if ( *(_QWORD *)(a2 + 120) )
            {
              v20 = (__int64 (__fastcall *)())GenTreeUseEdgeIterator::Terminate;
              if ( v19 == 2 )
                v20 = GenTreeUseEdgeIterator::AdvanceCall<3>;
              *(_QWORD *)result = v20;
              *(_QWORD *)(result + 8) = 0LL;
              *(_QWORD *)(result + 24) = a2 + 120;
            }
            else if ( v19 == 2 )
            {
              *(_OWORD *)result = (unsigned __int64)GenTreeUseEdgeIterator::AdvanceCall<4>;
              *((_QWORD *)&v21 + 1) = 0LL;
              if ( *(_QWORD *)(a2 + 112) )
              {
                *v2 = a2 + 112;
              }
              else
              {
                *(_QWORD *)&v21 = GenTreeUseEdgeIterator::Terminate;
                *(_OWORD *)result = v21;
                v23 = *(_QWORD *)(a2 + 128);
                v22 = a2 + 128;
                if ( v23 )
                  *v2 = v22;
              }
            }
            else
            {
    LABEL_43:
              *(_DWORD *)(result + 40) = -1;
            }
          }
          return result;
  21. Beau-Gosse-dev commented on Jul 22, 2022

    @Beau-Gosse-dev
    ContributorAuthor

    Thanks! I created a new VM and installed clang-9 instead of just "clang" and that fixed the issue. I see that in the Linux Requirements it says clang-9. I must have just installed the default clang after seeing an error that clang was not found.

  22. ghost locked as resolved and limited conversation to collaborators on Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-CodeGen-coreclrneeds-further-triage

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions