jart / blink

tiniest x86-64-linux emulator
ISC License
7k stars 224 forks source link

SIGKILL Error When Running .NET Runtime in Alpine Minirootfs #169

Open mnixry opened 6 months ago

mnixry commented 6 months ago

Issue Details:

The .NET runtime encounters an error and crashes when executed within an Alpine Linux minirootfs environment set up via chroot. The crash occurs when attempting to run the .NET runtime with specific commands and settings.

I2024-05-13T10:09:22.014597:blink/syscall.c:5722:8377 missing syscall 0x144
I2024-05-13T10:09:22.034004:blink/syscall.c:5722:8377 missing syscall 0x144
I2024-05-13T10:09:22.101524:blink/syscall.c:5722:8377 missing syscall 0x144
I2024-05-13T10:09:22.129108:blink/syscall.c:5722:8377 missing syscall 0x144
I2024-05-13T10:09:22.130746:blink/syscall.c:1022:262144 unsupported prctl op 0xf
I2024-05-13T10:09:22.131926:blink/syscall.c:4096:8377 sigaltstack ss_sp=0x7c18591ab000 ss_size=0x4000 didn't exist with read+write permission
Failed to create CoreCLR, HRESULT: 0x8007FF06
I2024-05-13T10:09:22.647401:blink/memorymalloc.c:301:8377 kill9'd thread after 10 tries
fish: Job 1, 'o/blink/blink -eC ./alpine-mini…' terminated by signal SIGKILL (Forced quit)

Steps to Reproduce:

  1. Download the alpine-minirootfs package and extract its contents into a designated folder.
  2. Use chroot to switch into the extracted root filesystem.
  3. Install the .NET runtime using the official installation script provided by Microsoft.
  4. Exit the chroot, execute .NET runtime using the command: o/blink/blink -eC ./alpine-minirootfs/ /root/.dotnet/dotnet --help.

Additional Information:

I2024-05-13T10:09:17.451802:blink/syscall.c:5722:8330 missing syscall 0x144
I2024-05-13T10:09:17.482985:blink/syscall.c:5722:8330 missing syscall 0x144
I2024-05-13T10:09:17.668653:blink/syscall.c:5722:8330 missing syscall 0x144
E2024-05-13T10:09:17.726247:blink/blink.c:158:8330 terminating due to SIGSEGV (rip=0x110000025d10 code=2 faultaddr=0x20000046492d)
E2024-05-13T10:09:17.753814:blink/blink.c:142:8330 additional information
         PC 110000025d10 cmpb $0,-3(%rax) 80 78 fd 00 48 8d 74 10
         AX 0000200000464930  CX 0000000000000008  DX 0000000000000010  BX 0000000000000064
         SP 00004fffffffde90  BP 0000000000000004  SI 0000000000000000  DI 0000000000000000
         R8 0000000000000001  R9 0000110001017e1c R10 000000000000001f R11 0000000000407d30
        R12 0000000000000015 R13 0000000000000150 R14 00001100000a1f98 R15 00001100010174c8
         FS 00001100000a1b08  GS 0000000000000000 OPS 56638            FLG ..Z..C
        /root/.dotnet/dotnet
        000000000004 110000025d10 UNKNOWN [STRAY] [CORRUPT FRAME POINTER]
110000000000-110000013fff   80k  95% r   /lib/ld-musl-x86_64.so.1
110000014000-110000067fff  336k  53% rx  /lib/ld-musl-x86_64.so.1
110000068000-11000009efff  220k  17% r   /lib/ld-musl-x86_64.so.1
11000009f000-1100000a2fff   16k 100% rw  /lib/ld-musl-x86_64.so.1
110001000000-110001005fff   24k 100% r   /root/.dotnet/dotnet
110001006000-110001011fff   48k  92% rx  /root/.dotnet/dotnet
110001012000-110001012fff  4096 100% r   /root/.dotnet/dotnet
110001013000-110001013fff  4096 100% rw  /root/.dotnet/dotnet
110001014000-110001014fff  4096   0%     
110001015000-110001017fff   12k 100% rw  [heap]
1fff814dc000-2000004cbfff*2032m   1%     
2000004cc000-200000673fff 1696k  69% r   /root/.dotnet/shared/Microsoft.NETCore.App/8.0.4/libcoreclr.so
200000674000-200000b2dfff 4840k   6% rx  /root/.dotnet/shared/Microsoft.NETCore.App/8.0.4/libcoreclr.so
200000b2e000-200000b4bfff  120k 100% r   /root/.dotnet/shared/Microsoft.NETCore.App/8.0.4/libcoreclr.so
200000b4c000-200000b68fff  116k 100% rw  /root/.dotnet/shared/Microsoft.NETCore.App/8.0.4/libcoreclr.so
200000b69000-200000bc6fff  376k  19% rw  
200000ca6000-200000cbefff  100k  88% rw  
4fffff800000-4fffffffffff 8192k   1% rw  [stack]
blink backtrace
        5694608ed162 TerminateSignal+337
        569460926e52 DeliverSignalToUser+193
        569460926fe7 HaltMachine+255
        5694609270e2 ThrowSegmentationFault+37
        569460901672 ReserveAddress+994
        56946097dac9 <unknown>
        5694608fe7d8 ExecuteInstruction+256
        5694608feb10 Actor+49
        5694608febc4 Blink+67
        5694608ecef5 Exec+541
        5694608ec8e1 main+849
        792d11734d4a <unknown>
        792d11734e0c __libc_start_main+140
        5694608ecaa5 _start+37
fish: Job 1, 'o/blink/blink -meC ./alpine-min…' terminated by signal SIGSEGV (Address boundary error)