-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to create CoreCLR, HRESULT: 0x8007000E
on linux-musl-x86
#83509
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
@ayakael, I have only tried building runtime, didn't test the binaries.
I don't have permission to download it. :)
BTW, were you testing under VM / baremetal install or QEMU? CoreCLR-PAL has some issues with QEMU (even on 64-bit archs). |
From @ayakael #77667 (comment) Woops, here is a functional link: dotnet-sdk-8.0.100-preview.2.23157.25-r1-linux-musl-x86.tar.xz I tested first within a chroot of alpine-x86 that was in LXC, and then within a chroot in a qemu based env. Both behave the same. |
Thanks @ayakael. I created a HyperV VM on Windows x64 and installed alpine 32 bit to rule out the emulation factor:
@janvorli, this seems like a memory mapping issue on 32-bit Alpine, where
$ cat /proc/meminfo
MemTotal: 308524 kB
MemFree: 218152 kB
MemAvailable: 108400 kB
Buffers: 1020 kB
Cached: 29348 kB
SwapCached: 180 kB
Active: 5804 kB
Inactive: 21904 kB
Active(anon): 68 kB
Inactive(anon): 344 kB
Active(file): 5736 kB
Inactive(file): 21560 kB
Unevictable: 3072 kB
Mlocked: 0 kB
HighTotal: 151072 kB
HighFree: 94044 kB
LowTotal: 157452 kB
LowFree: 124108 kB
SwapTotal: 4194300 kB
SwapFree: 4191476 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 344 kB
Mapped: 2344 kB
Shmem: 3072 kB
KReclaimable: 7992 kB
Slab: 19800 kB
SReclaimable: 7992 kB
SUnreclaim: 11808 kB
KernelStack: 640 kB
PageTables: 284 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 4348560 kB
Committed_AS: 7956 kB
VmallocTotal: 122880 kB
VmallocUsed: 26060 kB
VmallocChunk: 0 kB
Percpu: 328 kB
DirectMap4k: 20472 kB
DirectMap4M: 868352 kB
$ ulimit -a
core file size (blocks) (-c) 0
data seg size (kb) (-d) unlimited
scheduling priority (-e) 0
file size (blocks) (-f) unlimited
pending signals (-i) 31256
max locked memory (kb) (-l) 64
max memory size (kb) (-m) unlimited
open files (-n) 1024
POSIX message queues (bytes) (-q) 819200
real-time priority (-r) 0
stack size (kb) (-s) 8192
cpu time (seconds) (-t) unlimited
max user processes (-u) 31256
virtual memory (kb) (-v) unlimited
file locks (-x) unlimited |
Awesome, thank you for creating the issue. Note that this is the product of a crossbuild from Alpine x86_64 to Alpine x86 via a rootfs dir. I use this method to build the s390x and ppc64le bootstraps, so it is a tested methdology. But as usually crossbuilding to x86 is done via -m32 (which for some reason didn't work when attempted), maybe some bits are being built in 64-bit mode? |
Turns out setting
|
Nice, can we remove conditions around -m32 from #83464 since it doesn't break the build? Another difference is linkage of libucontext library on linux-musl-x86 for libunwind, which we don't need on linux-musl-x64. But that too seem unrelated to memory map issue. I think the issue is that PAL doesn't handle some case and we run into infinite recursion (the strace posted above is way too many > 10 MB of |
Yeah, we could. The following patch after toolchain changes works: diff --git a/src/runtime/eng/common/cross/toolchain.cmake b/src/runtime/eng/common/cross/toolchain.cmake
index 2bb1e0845..fed3b0fad 100644
--- a/src/runtime/eng/common/cross/toolchain.cmake
+++ b/src/runtime/eng/common/cross/toolchain.cmake
@@ -284,8 +284,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86")
add_toolchain_linker_flag("--target=${TOOLCHAIN}")
add_toolchain_linker_flag("-Wl,--rpath-link=${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN}")
- else()
- add_toolchain_linker_flag(-m32)
endif()
+ add_toolchain_linker_flag(-m32)
if(TIZEN)
add_toolchain_linker_flag("-B${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
add_toolchain_linker_flag("-L${CROSS_ROOTFS}/lib")
@@ -324,9 +323,8 @@ if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$")
elseif(TARGET_ARCH_NAME STREQUAL "x86")
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/i586-alpine-linux-musl)
add_compile_options(--target=${TOOLCHAIN})
- else()
- add_compile_options(-m32)
endif()
+ add_compile_options(-m32)
add_compile_options(-Wno-error=unused-command-line-argument)
endif() edit Updated both PRs with above change |
Circling back on this, I now get the following error on 8.0.0-preview.7:
|
.NET requires SSE/SSE2 and cmov (on x86/x64 based CPUs), which have been around for well over 20 years now and are guaranteed available on any 64-bit capable CPU (regardless of whether the OS is running as 32-bit or 64-bit). |
Right, so why would running an x86 SDK in a x86 Alpine chroot on x86_64 hardware cause this error, when indeed the CPU has it? |
If you're running in an emulator, its possible it has it disabled. You could always manually check CPUID or |
It's very much available:
I can't find the piece of code that detects sse, but something doesn't seem right. |
I had this error too - with the same HRESULT. After many (many) hours of searching and testing, I discovered it was nothing to do with memory or CPUs and everything to do with permissions on Using
Turns out my I don't know if this will help you but it's lifted my mood that's been rather poor for the last two days trying to track this one down! |
From @ayakael #77667 (comment)
I'm getting an execution failure when trying to run the resulting SDK. Running dotnet --info with the following SDK in linux-musl-x86 chroot yields a freeze, and then eventually a Failed to create CoreCLR, HRESULT: 0x8007000E. It seems like CoreCLR tries to allocate all of the available memory for some reason. @am11 I see that you got the build-rootfs.sh script working for linux-musl-x86, have you managed a successful crossbuild to linux-musl-x86?
I tried stracing it, but could only attach the process after execution.
strace.txt
Edit: The following patchset is used to build the SDK: https://lab.ilot.io/ayakael/dotnet-stage0
The text was updated successfully, but these errors were encountered: