Skip to content

coreclr_initialize failed on RISC-V (error 0x8007000E) #85650

@mateusrodrigues

Description

@mateusrodrigues

Description

I am investigating the current state of .NET on RISC-V and started by trying to build CoreCLR on a board. So I created a simple Hello World .NET app and tried to run it with corerun. I am currently getting the following error:

GC heap initialization failed with error 0x8007000E                                        
BEGIN: coreclr_initialize failed - Error: 0x8007000e                                       
Exe path: /home/ubuntu/git/runtime/artifacts/bin/coreclr/linux.riscv64.Debug/corerun
Properties:                                                                                
    TRUSTED_PLATFORM_ASSEMBLIES = /home/ubuntu/git/runtime/artifacts/bin/coreclr/linux.risc
v64.Debug//System.Private.CoreLib.dll:                                                     
    APP_PATHS = /home/ubuntu/hello-world/                                                  
    NATIVE_DLL_SEARCH_DIRECTORIES = /home/ubuntu/hello-world/:                             
    HOST_RUNTIME_CONTRACT = 0x3fcdc1f718                                                   
Managed assembly: /home/ubuntu/hello-world/HelloWorld.dll                                 
Arguments (0):                                                                             
END: coreclr_initialize failed - Error: 0x8007000e

As the error code indicates an OOM error, I ran strace on this and got the following output:

36823 sysinfo({uptime=1576, loads=[66528, 43648, 29120], totalram=7523438592, freeram=6651424768, sharedram=1163264, bufferram=39895040, totalswap=0, freeswap=0, procs=131, totalhigh=0, freehigh=0, mem_unit=1}) = 0
36823 mmap(NULL, 274877911040, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)

Apparently, it's trying to allocate 274 GB of memory if I understood this correctly?

Reproduction Steps

  1. ./src/coreclr/build-runtime.sh
  2. On an amd64 machine, built the CoreCLR managed parts from inside the System.Private.CoreLib directory with ../../../.dotnet/dotnet build -r linux-riscv64 -c Debug --no-self-contained /p:PlatformTarget=AnyCpu System.Private.CoreLib.csproj
  3. Created a Hello World app on another machine (with .NET 8 latest preview):
    2.1. dotnet new console -o HelloWorld
    2.2. dotnet build
    2.3. Copied the HelloWorld.dll file over to the board
  4. Went into the artifacts folder and ran ./corerun HelloWorld.dll
  5. Error happened

Expected behavior

Should output Hello, World!

Actual behavior

Outputs the error included in the description.

Regression?

No response

Known Workarounds

No response

Configuration

  • corerun built from the main branch CoreCLR
  • StarFive VisionFive v1 board
  • lscpu output
Architecture:          riscv64
  Byte Order:          Little Endian
CPU(s):                2
  On-line CPU(s) list: 0,1
NUMA:                  
  NUMA node(s):        1
  NUMA node0 CPU(s):   0,1
  • /etc/os-release info
PRETTY_NAME="Ubuntu 23.04"
NAME="Ubuntu"
VERSION_ID="23.04"
VERSION="23.04 (Lunar Lobster)"
VERSION_CODENAME=lunar
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=lunar
LOGO=ubuntu-logo
  • ulimit -v output
unlimited
  • Specs:
OS: Ubuntu 23.04 riscv64 
Host: StarFive VisionFive V1 
Kernel: 5.19.0-1014-starfive 
Uptime: 1 hour, 49 mins 
Packages: 801 (dpkg), 5 (snap) 
Shell: bash 5.2.15 
Terminal: tmux 
CPU: (2) 
Memory: 173MiB / 7174MiB

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions