Skip to content

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIneeds-further-triageIssue has been initially triaged, but needs deeper consideration or reconsideration

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions