GC heap initialization failed (0x8007000E) on ARM64 Linux (Ubuntu 24.04 via Termux/proot-distro)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- android, linux
- Domain
- operating-systems
Research direction
Reproduce the failure in the documented Termux, proot-distro Ubuntu 24.04, ARM64 environment by running dotnet --info, then compare the result with a native Linux ARM64 environment. Use the reported memory, swap, SDK version, and GC initialization output to determine whether this is an environment limitation or a runtime defect; done requires a confirmed cause and an actionable workaround or fix direction.
Written by the indexing model from the issue text.
Description
Environment
- .NET SDK Version: 10.0.100-preview.4.25258.110
- Operating System: Android 15 (via Termux) running Ubuntu 24.04 (Noble Numbat) via
proot-distro - Architecture: ARM64 (aarch64)
- Host Device: Samsung SM-F956B (Galaxy Z Fold 6)
- Termux Version:
googleplay.2025.01.18 - proot-distro Version:
v4.25.0 - Wasmtime Version: Not yet installed (N/A for this specific issue)
Description
I am attempting to set up a .NET development environment on my ARM64 Android device (Samsung SM-F956B, Galaxy Z Fold 6) using Termux and proot-distro (to host Ubuntu 24.04). My long-term goal is to explore the feasibility of running ASP.NET Core SignalR Hubs within a WebAssembly (WASM) / WebAssembly System Interface (WASI) environment, potentially for serverless or edge compute solutions.
After successfully downloading and extracting the .NET 10 Preview 4 SDK for linux-arm64 into the Ubuntu environment (which runs inside proot-distro), I consistently encounter a GC heap initialization failed with error 0x8007000E (E_OUTOFMEMORY) when running any dotnet command (e.g., dotnet --info, dotnet new console).
Steps to Reproduce
- Install Termux from F-Droid.
- Inside Termux, install
proot-distro:pkg install proot-distro -y - Install Ubuntu 24.04 LTS:
proot-distro install ubuntu - Log in to the Ubuntu environment:
proot-distro login ubuntu - Inside Ubuntu, update packages and install essential tools:
apt update && apt upgrade -y apt install curl wget git -y - Verify architecture (output was
arm64):dpkg --print-architecture - Download .NET 10.0.100-preview.4 SDK for Linux ARM64:
mkdir -p ~/dotnet wget [https://builds.dotnet.microsoft.com/dotnet/Sdk/10.0.100-preview.4.25258.110/dotnet-sdk-10.0.100-preview.4.25258.110-linux-arm64.tar.gz](https://builds.dotnet.microsoft.com/dotnet/Sdk/10.0.100-preview.4.25258.110/dotnet-sdk-10.0.100-preview.4.25258.110-linux-arm64.tar.gz) -O dotnet-sdk.tar.gz - Extract the SDK:
tar -xzf dotnet-sdk.tar.gz -C ~/dotnet - Add .NET to PATH:
echo 'export DOTNET_ROOT=$HOME/dotnet' >> ~/.bashrc echo 'export PATH=$PATH:$HOME/dotnet' >> ~/.bashrc source ~/.bashrc - Attempt to verify installation (this is where the error occurs):
dotnet --info
Expected Behavior
dotnet --info should display the SDK information without any errors, indicating a successful initialization of the .NET CoreCLR runtime.
Actual Behavior
The command consistently fails with the following output:
GC heap initialization failed with error 0x8007000E
Failed to create CoreCLR, HRESULT: 0x8007000E
This error suggests an OutOfMemory condition or a failure to allocate necessary memory segments.
Troubleshooting Performed
- Verified sufficient storage:
df -h /data/data/com.termux/files/homeshows ample free space (291Gavailable). - Verified successful SDK download: The
wgetoperation completed 100% with no errors. - Attempted Termux/device restart: Performed a full restart of the Android device and the Termux app.
- Attempted to add swap space within the
proot-distroUbuntu environment:
Despitefallocate -l 8G /swapfile # or dd if=/dev/zero... chmod 600 /swapfile mkswap /swapfile swapon /swapfile # Fails with "swapon failed: Function not implemented"swaponfailing (due toproot-distrolimitations for direct kernel interaction),free -hcommand's output shows significant available RAM (Mem: 10Gi total,3.5Gi available) and active Swap space (Swap: 8.0Gi total,4.7Gi used). This suggests that system-level swap is active (possibly via Android's ZRAM or similar mechanisms) and that the0x8007000Eerror is likely not a simple total memory exhaustion, but rather a failure to allocate specific types of memory or to initialize the GC heap within theproot-distro's emulated environment, potentially due to underlying kernel/syscall compatibility issues or specific memory management semantics that CoreCLR expects.
Potential Root Cause (Hypothesis)
Given the ample memory resources reported by free -h and the swapon failure, it is hypothesized that the issue might be related to:
- CoreCLR's specific memory allocation requirements: The runtime may be trying to allocate memory segments (e.g., for its GC heap) in a way that is not fully compatible with the memory management layer provided by
proot-distroor the Android Bionic linker's specificTLSsegment alignment. proot-distro/ Android kernel limitations: Despiteproot-distroproviding a Linux user-space environment, there might be underlying kernel-level syscalls or memory mapping features that are either not fully implemented or have different behaviors compared to a native Linux kernel.- Preview build instability: As this is a preview version of .NET 10, it might contain bugs or new features that are less stable in highly specialized environments like Termux/proot-distro.
Request
I am seeking engineering guidance and insights into how to resolve this GC heap initialization failed issue. My primary goal is to establish a functional .NET development and execution environment on ARM64 Android devices to validate the feasibility of running complex .NET workloads (such as ASP.NET Core SignalR Hubs) in WASM/WASI for serverless or edge compute scenarios. Resolving this foundational issue is crucial for my research.
I am open to:
- Trying specific environment variables for CoreCLR (
COMPlus_variables). - Exploring alternative
proot-distroconfigurations or Linux distributions. - Any insights into CoreCLR's memory allocation patterns or requirements in such emulated/constrained environments.
Your expertise in this area would be highly appreciated. Thank you.
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/runtime
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
area-System.Reflection blocking-clean-ci-optional Known Build Error os-mac-os-x untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area-CodeGen-coreclr untriaged
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
agentic-workflows untriaged
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
area-VM-meta-mono untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
Create parent directories only after the containment check in InstallHelper.TryExtractToDirectory Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PowerShell/PSResourceGet#2056 ·