ptitSeb / box64

Box64 - Linux Userspace x86_64 Emulator with a twist, targeted at ARM64 Linux devices
https://box86.org
MIT License
3.49k stars 247 forks source link

geekbench6 jemalloc crash on M1 (Asahi) #1266

Open JuniorJPDJ opened 5 months ago

JuniorJPDJ commented 5 months ago
juniorjpdj@lizak-macbook-asahi:~/Downloads/Geekbench-6.2.2-Linux$ ./geekbench6
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT PageSize:16384 Running on Icestorm-M1 Firestorm-M1 with 8 Cores
Params database has 57 entries
Box64 with Dynarec v0.2.7 f4fd01c7 built on Feb 16 2024 03:56:54
BOX64: Detected 48bits at least of address space
Counted 93 Env var
BOX64 LIB PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/
BOX64 BIN PATH: ./:bin/:/home/juniorjpdj/.local/bin/:/home/juniorjpdj/bin/:/usr/local/bin/:/usr/bin/:/bin/:/usr/local/sbin/:/usr/sbin/:/sbin/
Looking for ./geekbench6
Apply RC params for geekbench6
Applying BOX64_ENV=BOX64_DYNAREC_STRONGMEM=3
Rename process to "geekbench6"
Using native(wrapped) libdl.so.2
Using native(wrapped) libm.so.6
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
Using emulated /lib/x86_64-linux-gnu/libgcc_s.so.1
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libutil.so.1
Using native(wrapped) libbsd.so.0
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
NativeBT: ./geekbench6() [0x3485937c]
NativeBT: linux-vdso.so.1(__kernel_rt_sigreturn+0) [0xffff53b68800]
NativeBT: /lib64/libc.so.6(+0x92280) [0xffff539c2280]
NativeBT: /lib64/libc.so.6(raise+0x20) [0xffff53975800]
NativeBT: /lib64/libc.so.6(abort+0xf8) [0xffff53960288]
NativeBT: [0xffff51eaef84]
EmulatedBT: box64(abort+0) [0x60080]
29226|SIGABRT @0xffff539c2280 (???(/lib64/libc.so.6+0x92280)) (x64pc=0x60080/???:"???", rsp=0xffff53776158, stack=0xffff52f78000:0xffff53778000 own=(nil) fp=0x35642cc0), for accessing 0x3e80000722a (code=-6/prot=0), db=(nil)((nil):(nil)/(nil):(nil)/???:clean, hash:0/0) handler=(nil)
RSP-0x20:0x00000001006bf058 RSP-0x18:0x0000000035642cc0 RSP-0x10:0x000000005190e960 RSP-0x08:0x0000000000000016
RSP+0x00:0x00000001001f1865 RSP+0x08:0x0000000000000030 RSP+0x10:0xb229bab891314800 RSP+0x18:0x0000000051924ad0
RAX:0x000000005193bcc0 RCX:0x0000ffff53af1460 RDX:0x0000000000000001 RBX:0x0000000100245dc9 
RSP:0x0000ffff53776158 RBP:0x0000000035642cc0 RSI:0x0000ffff539b7390 RDI:0x0000000051924a80 
 R8:0x00000000ffffffff  R9:0x0000ffff53775be0 R10:0x00007fff00023220 R11:0x0000ffff537759a0 
R12:0x000000005190d340 R13:0x0000000000040000 R14:0x0000000000000030 R15:0x00000001006bf058 
ES:0x002b CS:0x0033 SS:0x002b DS:0x002b FS:0x0043 GS:0x0053 
Aborted (core dumped)

Fresh build of box64 f4fd01c77705b31c4525e66dcbc7dfe966456006 with params for M1 from wiki.

ptitSeb commented 5 months ago

Well:jemalloc doesn't like the 16k pagesize of the M1: <jemalloc>: Unsupported system page size box64 doesn't emulate a 4k pagesize.

JuniorJPDJ commented 5 months ago

Oh, I was sure it does emulate 4k pages. Is there a way to dynamically remove jemalloc from the binary?