box64 icon indicating copy to clipboard operation
box64 copied to clipboard

Braid with box32: Stack is corrupted

Open ben-willmore opened this issue 11 months ago • 1 comments

I've been trying to get Braid working via box32. I'm currently testing on an Ubuntu VM on an M1 Mac. In addition to the i386 libraries that come with the game (libCg, libCgGL, libfltk.so.1.3, libSDL), I've provided an i386 libXft.so.2. The game launcher crashes on startup with the following log, which suggests that IO_2_1_stdout can't be found, which is strange given that libc.so.6 is loaded a few lines earlier.

I'm using the box64 from current github. Thanks for any insight!

$ box64 ./launcher.bin.x86 
[BOX64] Box64 with Dynarec v0.3.5  built on Mar 20 2025 13:41:48
[BOX64] Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT
[BOX64] Running on unknown aarch64 cpu with 2 cores, pagesize: 4096
[BOX64] Will use hardware counter measured at 24.0 MHz emulating 3.0 GHz
[BOX64] Detected 48bits at least of address space
[BOX64] Counted 56 Env var
[BOX64] BOX64 trying to Preload libCg.so libCgGL.so 
[BOX64] Library search path: 
[BOX64] Binary search path: ./:bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/games/:/usr/local/games/:/snap/bin/
[BOX64] Looking for ./launcher.bin.x86
[BOX32] Using Box32 to load 32bits elf
[BOX32] Memory higher than 32bits reserved
[BOX32] Rename process to "launcher.bin.x86"
[BOX32] Using emulated libCg.so
[BOX32] Using native(wrapped) libm.so.6
[BOX32] Using native(wrapped) libpthread.so.0
[BOX32] Using native(wrapped) libc.so.6
[BOX32] Using native(wrapped) ld-linux.so.2
[BOX32] Using native(wrapped) librt.so.1
[BOX32] Using native(wrapped) libdl.so.2
[BOX32] Error: Symbol sym=_IO_2_1_stdout_(_IO_2_1_stdout_@GLIBC_2.1/version 7) not found, cannot apply R_386_32 0x40b3140c ((nil)) in libCg.so
[BOX32] Using emulated libCgGL.so
[BOX32] Using native(wrapped) libSDL2-2.0.so.0
[BOX32] Using emulated /home/ben/.hgfs/shared/braid/Braid/game/lib/libfltk.so.1.3
[BOX32] Using native(wrapped) libX11.so.6
[BOX32] Using emulated /usr/lib/box64-i386-linux-gnu/libstdc++.so.6
[BOX32] Using emulated /usr/lib/box64-i386-linux-gnu/libgcc_s.so.1
[BOX32] Using native(wrapped) libXcursor.so.1
[BOX32] Using native(wrapped) libXfixes.so.3
[BOX32] Using native(wrapped) libXrender.so.1
[BOX32] Using native(wrapped) libXext.so.6
[BOX32] Using emulated /home/ben/.hgfs/shared/braid/Braid/game/lib/libXft.so.2
[BOX32] Using native(wrapped) libfontconfig.so.1
[BOX32] Using native(wrapped) libexpat.so.1
[BOX32] Using native(wrapped) libfreetype.so.6
[BOX32] Using native(wrapped) libXinerama.so.1
No XIM style found
[BOX32] Using native(wrapped) libXrandr.so.2
[BOX32] 0x40eded28: Stack is corrupted, aborting ESP=0x3080ebfc /home/ben/.hgfs/shared/braid/Braid/game/lib/libXft.so.2 + 0x11d28
[BOX32] ==== CPU Registers ====
ES=0x002b CS=0x0023 SS=0x002b DS=0x002b FS=0x0000 GS=0x0033
RAX=d1694800 RCX=00000000 RDX=00000001 RBX=40ee6000 FLAGS=---Z---
RSP=3080ebfc RBP=40edf01c RSI=58366130 RDI=40edf073 EIP=30818053 
[BOX32] ======== Stack ========
Stack is from 40EDF01C to 3080EBFC
[BOX32] Old IP: 0

ben-willmore avatar Mar 20 '25 14:03 ben-willmore

With export BOX86_LOG=3:

$ box64 ./launcher.bin.x86
[BOX64] Box64 with Dynarec v0.3.5  built on Mar 20 2025 13:41:48
[BOX64] Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT
[BOX64] Running on unknown aarch64 cpu with 2 cores, pagesize: 4096
[BOX64] Will use hardware counter measured at 24.0 MHz emulating 3.0 GHz
[BOX64] Detected 48bits at least of address space
[BOX64] Counted 56 Env var
[BOX64] BOX64 trying to Preload libCg.so libCgGL.so 
[BOX64] Library search path: 
[BOX64] Binary search path: ./:bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/games/:/usr/local/games/:/snap/bin/
[BOX64] Looking for ./launcher.bin.x86
[BOX32] Using Box32 to load 32bits elf
[BOX32] Memory higher than 32bits reserved
[BOX32] Rename process to "launcher.bin.x86"
[BOX32] Using emulated libCg.so
[BOX32] Using native(wrapped) libm.so.6
[BOX32] Using native(wrapped) libpthread.so.0
[BOX32] Using native(wrapped) libc.so.6
[BOX32] Using native(wrapped) ld-linux.so.2
[BOX32] Using native(wrapped) librt.so.1
[BOX32] Using native(wrapped) libdl.so.2
[BOX32] Error: Symbol sym=_IO_2_1_stdout_(_IO_2_1_stdout_@GLIBC_2.1/version 7) not found, cannot apply R_386_32 0x40b3140c ((nil)) in libCg.so
[BOX32] Using emulated libCgGL.so
[BOX32] Using native(wrapped) libSDL2-2.0.so.0
[BOX32] Using emulated /home/ben/.hgfs/shared/braid/Braid/game/lib/libfltk.so.1.3
[BOX32] Using native(wrapped) libX11.so.6
[BOX32] Using emulated /usr/lib/box64-i386-linux-gnu/libstdc++.so.6
[BOX32] Using emulated /usr/lib/box64-i386-linux-gnu/libgcc_s.so.1
[BOX32] Using native(wrapped) libXcursor.so.1
[BOX32] Using native(wrapped) libXfixes.so.3
[BOX32] Using native(wrapped) libXrender.so.1
[BOX32] Using native(wrapped) libXext.so.6
[BOX32] Using emulated /home/ben/.hgfs/shared/braid/Braid/game/lib/libXft.so.2
[BOX32] Using native(wrapped) libfontconfig.so.1
[BOX32] Using native(wrapped) libexpat.so.1
[BOX32] Using native(wrapped) libfreetype.so.6
[BOX32] Using native(wrapped) libXinerama.so.1
[BOX32] 10608|SIGILL @0x10045ff38 (???(0x10045ff38)) (x64pc=0x402f6221/"libCg.so + 0x2f6221", rsp=0x3080efd4, stack=0x30010000:0x30810000 own=(nil) fp=0x3080f10c), for accessing 0x10045ff38 (code=1/prot=7), db=0x10087ff20(0x10045ff38:0x10045ffa9/0x402f6221:0x402f622f/libCg.so + 0x2f6221:clean, hash:5655fd12/5655fd12) handler=(nil)
RAX:0x0000000040b49d38 RCX:0x0000000040b49d38 RDX:0x0000000040790140 RBX:0x0000000040b2fcf4 
RSP:0x000000003080efd4 RBP:0x000000003080f00c RSI:0x0000000040b49d38 RDI:0x0000000040b49514 
 R8:0x0000000000000000  R9:0x0000000000000000 R10:0x0000000000000000 R11:0x0000000000000000 
R12:0x0000000000000000 R13:0x0000000000000000 R14:0x0000000000000000 R15:0x0000000000000000 
ES:0x002b CS:0x0023 SS:0x002b DS:0x002b FS:0x0000 GS:0x0033 
RSP-0x20:0x0000000000000000 RSP-0x18:0x40373e5f00000020 RSP-0x10:0x40b2fcf400000008 RSP-0x08:0x402f62213080f00c
RSP+0x00:0x0000000840b49d38 RSP+0x08:0x402e90ec3080eff8 RSP+0x10:0x0000002040b4951c RSP+0x18:0x402f60f640b49d38 opcode=EC 01 5E B8 F1 81 40 B8 (8B 55 E0 8B 7D)
No XIM style found
[BOX32] Using native(wrapped) libXrandr.so.2
[BOX32] 0x40eded28: Stack is corrupted, aborting ESP=0x3080ebfc /home/ben/.hgfs/shared/braid/Braid/game/lib/libXft.so.2 + 0x11d28
[BOX32] ==== CPU Registers ====
ES=0x002b CS=0x0023 SS=0x002b DS=0x002b FS=0x0000 GS=0x0033
RAX=d1694800 RCX=00000000 RDX=00000001 RBX=40ee6000 FLAGS=---Z---
RSP=3080ebfc RBP=40edf01c RSI=63ecb670 RDI=40edf073 EIP=30818053 
[BOX32] ======== Stack ========
Stack is from 40EDF01C to 3080EBFC
[BOX32] Old IP: 0

ben-willmore avatar Mar 20 '25 14:03 ben-willmore