Skip to content
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

Missing libc symbols with glibc 2.39 on Fedora 40 #1517

Closed
teohhanhui opened this issue May 22, 2024 · 5 comments
Closed

Missing libc symbols with glibc 2.39 on Fedora 40 #1517

teohhanhui opened this issue May 22, 2024 · 5 comments

Comments

@teohhanhui
Copy link

Running with:

export BOX64_LD_LIBRARY_PATH=./:lib/:lib64/:x86_64/:bin64/:libs64/:/x86_64/usr/lib64/
export BOX64_PATH=./:bin/:/x86_64/usr/bin/
export BOX64_BASH=/x86_64/usr/bin/bash
$ box64 bash
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT PageSize:4096 Running on Avalanche-M2 Blizzard-M2 Avalanche-M2 with 4 Cores
Will use Hardware counter measured at 24.0 MHz emulating 3.0 GHz
Params database has 69 entries
Using bash "/x86_64/usr/bin/bash"
Box64 with Dynarec v0.2.7 nogit built on May 19 2024 00:00:00
BOX64: Detected 48bits at least of address space
Counted 31 Env var
BOX64 LIB PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/:/x86_64/usr/lib64/
BOX64 BIN PATH: ./:bin/:/x86_64/usr/bin/:/tmp/krun-run-1000-FJuH3M/fnm_multishells/326_1716357045752/bin/:/home/teohhanhui/.local/share/fnm/:/run/user/1000/fnm_multishells/86626_1716354130254/bin/:/home/teohhanhui/.local/share/fnm/:/usr/lib64/ccache/:/run/user/1000/fnm_multishells/86366_1716354125744/bin/:/home/teohhanhui/.local/share/fnm/:/run/user/1000/fnm_multishells/1984_1716339232015/bin/:/home/teohhanhui/.local/share/fnm/:/home/teohhanhui/.juliaup/bin/:/home/teohhanhui/.cargo/bin/:/home/teohhanhui/.local/bin/:/home/teohhanhui/bin/:/usr/local/bin/:/usr/local/sbin/:/usr/bin/:/usr/sbin/:/var/lib/flatpak/exports/bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/sbin/:/bin/
Looking for bash
bash detected, disabling banner
Apply RC params for bash
Error: Symbol __wcsrtombs_chk not found, cannot apply R_X86_64_JUMP_SLOT @0x100149960 (0x221f0) in /x86_64/usr/bin/bash
Error: Symbol __isoc23_strtoumax not found, cannot apply R_X86_64_JUMP_SLOT @0x100149c30 (0x22790) in /x86_64/usr/bin/bash
Error: Symbol __confstr_chk not found, cannot apply R_X86_64_JUMP_SLOT @0x100149f38 (0x22da0) in /x86_64/usr/bin/bash
Segmentation fault
$ sudo dnf --installroot=/x86_64 --forcearch=x86_64 repoquery --installed glibc
glibc-0:2.39-13.fc40.x86_64
@ptitSeb
Copy link
Owner

ptitSeb commented May 22, 2024

I haven't migrated my m1 to Fedora 40 yet. I'll add those symbols soon.

Note that box64 will not use x86_64 glibc, it will only use arm64 version (but it will use other libs, like libgcc_s or libstdc++.so.6)

@ptitSeb
Copy link
Owner

ptitSeb commented May 29, 2024

Ok, I have added the symbols.

@teohhanhui
Copy link
Author

teohhanhui commented May 29, 2024

Unfortunately, hitting a segfault.

With BOX64_JITGDB=1:

(gdb) set waiting=0
(gdb) backtrace full
#0  my_box64signalhandler (sig=11, info=<optimized out>, ucntx=<optimized out>)
    at /usr/src/debug/box64-0.2.8^20240529git4744534-1.fc40.aarch64/src/libtools/signals.c:1655
        waiting = 0
        pid = 325
        v = <optimized out>
        name = 0x0
        x64pc = 156384
        x64name = 0x0
        elfname = 0x0
        log_minimum = <optimized out>
        p = 0xffffd4900cb0
        addr = 0x262e0
        rsp = 0xffff927bf0e8
        emu = <optimized out>
        pc = 0x353a2edc <Run.isra.0+188>
        fpsimd = <optimized out>
        Locks = 0
        prot = 135
        db = 0x0
        db_searched = <optimized out>
        tid = 325
        mapped = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--c
        signame = 0x353b6510 "SIGSEGV"
        old_pc = {0x0, 0x0}
        old_pc_i = 0
        repeated_page = 0
        repeated_count = 0
        glitch_pc = 0x0
        glitch_addr = 0x0
        glitch_prot = 0
        glitch2_pc = 0x0
        glitch2_addr = 0x0
        glitch2_prot = 0
        old_code = 1
        old_pc = 0x353a2edc <Run.isra.0+188>
        old_addr = 0x262e0
        old_tid = 325
        old_prot = 135
        old_addr = 0
#1  <signal handler called>
No symbol table info available.
#2  Run.isra.0 (emu=emu@entry=0x53950310, step=<optimized out>, step@entry=1)
    at /usr/src/debug/box64-0.2.8^20240529git4744534-1.fc40.aarch64/src/emu/x64run.c:85
        opcode = <optimized out>
        nextop = <optimized out>
        oped = <optimized out>
        opgd = <optimized out>
        tmp8u = <optimized out>
        tmp8u2 = <optimized out>
        tmp8s = <optimized out>
        tmp16u = <optimized out>
        tmp32s = <optimized out>
        tmp32u = <optimized out>
        tmp32u2 = <optimized out>
        tmp64s = <optimized out>
        tmp64u = <optimized out>
        tmp64u2 = <optimized out>
        tmp64u3 = <optimized out>
        addr = 156385
        rex = <optimized out>
        rep = <optimized out>
        unimp = 0
        is32bits = 0
        tf_next = 0
        x64emurun = <optimized out>
#3  0x00000000349e4598 in DynaRun (emu=emu@entry=0x53950310)
    at /usr/src/debug/box64-0.2.8^20240529git4744534-1.fc40.aarch64/src/dynarec/dynarec.c:192
        is32bits = <optimized out>
        block = <optimized out>
        jmpbuf = {{__jmpbuf = {0, 0, 0, 0, 281470681743360, 0, 0, 0, 196627, 
              1, 281474247958720, 1321496060546185898, 0, 1321272496223200242, 
              0, 0, 0, 0, 0, 0, 0, 0}, __mask_was_saved = 1, __saved_mask = {
              __val = {0 <repeats 16 times>}}}}
        skip = 0
        old_jmpbuf = 0x0
#4  0x00000000349e48a8 in DynaCall (emu=0x53950310, addr=<optimized out>)
    at /usr/src/debug/box64-0.2.8^20240529git4744534-1.fc40.aarch64/src/dynarec/dynarec.c:113
        old_rsp = <optimized out>
        old_rbx = <optimized out>
        old_rdi = 1
        old_rsi = <optimized out>
        old_rbp = <optimized out>
        old_rip = 196627
        old_df = d_none
        old_op1 = <optimized out>
        old_op2 = <optimized out>
        old_res = <optimized out>
        old_op1_sav = <optimized out>
        old_res_sav = <optimized out>
        old_df_sav = d_none
        old_uc_link = 0x0
#5  0x0000000035142048 in RunFunctionWithEmu.constprop.0 (
    emu=emu@entry=0x53950310, QuitOnLongJump=0, fnc=<optimized out>, 
    nargs=nargs@entry=3, QuitOnLongJump=0)
    at /usr/src/debug/box64-0.2.8^20240529git4744534-1.fc40.aarch64/src/tools/callback.c:255
        align = 0
        stackn = 0
        p = <optimized out>
        va = {__stack = 0xffffd4902200, __gr_top = 0xffffd4902200, 
          __vr_top = 0xffffd49021e0, __gr_offs = -32, __vr_offs = 0}
        oldip = 196627
        old_quit = 0
        oldlong = <optimized out>
#6  0x00000000349e03b8 in RunElfInit (h=0x53951320, emu=0x53950310)
    at /usr/src/debug/box64-0.2.8^20240529git4744534-1.fc40.aarch64/src/elfs/elfloader.c:1116
        i = 0
        p = <optimized out>
        addr = <optimized out>
#7  0x00000000349f00ac in RunElfInit (h=<optimized out>, emu=0x53950310)
    at /usr/src/debug/box64-0.2.8^20240529git4744534-1.fc40.aarch64/src/emu/x64run_private.c:108
        p = <optimized out>
        addr = <optimized out>
        p = <optimized out>
        addr = <optimized out>
        i = <optimized out>
        lib = <optimized out>
        lib_elf = <optimized out>
        i = <optimized out>
#8  my___libc_start_main (emu=0x53950310, 
    emu@entry=<error reading variable: value has been optimized out>, 
    main=0x100024670, 
    main@entry=<error reading variable: value has been optimized out>, 
    argc=<error reading variable: value has been optimized out>, 
    ubp_av=<error reading variable: value has been optimized out>, 
    init=<error reading variable: value has been optimized out>, 
    fini=<error reading variable: value has been optimized out>, 
    rtld_fini=<error reading variable: value has been optimized out>, 
    stack_end=<error reading variable: value has been optimized out>)
    at /usr/src/debug/box64-0.2.8^20240529git4744534-1.fc40.aarch64/src/emu/x64run_private.c:83
No locals.
#9  0x0000000034a31814 in iFEpippppp (emu=0x53950310, fcn=<optimized out>)
    at /usr/src/debug/box64-0.2.8^20240529git4744534-1.fc40.aarch64/src/wrapped/generated/wrapper.c:5673
        fn = <optimized out>
#10 0x00000000353a4d68 in Run.isra.0 (emu=emu@entry=0x53950310, 
    step=<optimized out>, step@entry=0)
    at /usr/src/debug/box64-0.2.8^20240529git4744534-1.fc40.aarch64/src/emu/x64run.c:1494
        opcode = 204 '\314'
        nextop = <optimized out>
        oped = <optimized out>
        opgd = <optimized out>
        tmp8u = <optimized out>
        tmp8u2 = <optimized out>
        tmp8s = <optimized out>
        tmp16u = <optimized out>
        tmp32s = <optimized out>
        tmp32u = <optimized out>
        tmp32u2 = <optimized out>
        tmp64s = <optimized out>
        tmp64u = <optimized out>
        tmp64u2 = <optimized out>
        tmp64u3 = <optimized out>
        addr = 196627
        rex = <optimized out>
        rep = <optimized out>
        unimp = 0
        is32bits = 0
        tf_next = 0
        x64emurun = <optimized out>
#11 0x00000000349d2e74 in emulate (emu=0x53950310, elf_header=<optimized out>)
    at /usr/src/debug/box64-0.2.8^20240529git4744534-1.fc40.aarch64/src/core.c:2229
        ret = <optimized out>
        ret = <optimized out>
#12 main (argc=<optimized out>, argv=<optimized out>, env=<optimized out>)
    at /usr/src/debug/box64-0.2.8^20240529git4744534-1.fc40.aarch64/src/main.c:11
        emu = 0x53950310
        elf_header = <optimized out>

Let me know if you need me to try something...

@teohhanhui
Copy link
Author

teohhanhui commented May 29, 2024

$ box64 wine64 SteamSetup.exe
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT PageSize:4096 Running on Avalanche-M2 Blizzard-M2 with 4 Cores
Will use Hardware counter measured at 24.0 MHz emulating 3.0 GHz
Params database has 69 entries
Using bash "/x86_64/usr/bin/bash"
Box64 with Dynarec v0.2.9 nogit built on May 29 2024 00:00:00
BOX64: Wine64 detected, WINEPRELOADRESERVE=""
BOX64: Detected 48bits at least of address space
BOX64: Detected running wine with "SteamSetup.exe"
Counted 15 Env var
BOX64 LIB PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/:/x86_64/usr/lib64/
BOX64 BIN PATH: ./:bin/:/x86_64/usr/bin/:/run/user/1000/fnm_multishells/143870_1717009708102/bin/:/home/teohhanhui/.local/share/fnm/:/usr/lib64/ccache/:/run/user/1000/fnm_multishells/137850_1717009535639/bin/:/home/teohhanhui/.local/share/fnm/:/run/user/1000/fnm_multishells/1962_1716991177090/bin/:/home/teohhanhui/.local/share/fnm/:/home/teohhanhui/.juliaup/bin/:/home/teohhanhui/.cargo/bin/:/home/teohhanhui/.local/bin/:/home/teohhanhui/bin/:/usr/local/bin/:/usr/local/sbin/:/usr/bin/:/usr/sbin/:/var/lib/flatpak/exports/bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/sbin/:/bin/
Looking for wine64
Apply RC params for wine64
Applying BOX64_MAXCPU=64
argv[1]="SteamSetup.exe"
Rename process to "wine64"
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libutil.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
FillBlock triggered a segfault at 0x1460 from 0x35142ce8
FillBlock at 0x1460 triggered a segfault, canceling
0262|SIGSEGV @0x353a2edc (???(wine64+0xba2edc)) (x64pc=0x1460/???:"???", rsp=0xffffa694fa48, stack=0xffffa6150000:0xffffa6950000 own=(nil) fp=0xffffa694fa50), for accessing 0x1460 (code=1/prot=87), db=(nil)((nil):(nil)/(nil):(nil)/???:clean, hash:0/0) handler=(nil)
RSP-0x20:0x0000000000000000 RSP-0x18:0x0000000000000000 RSP-0x10:0x0000000000000000 RSP-0x08:0x0000000000000000
RSP+0x00:0x0000000000020080 RSP+0x08:0x0000000000000000 RSP+0x10:0x00000001000013a5 RSP+0x18:0x0000ffffa694fa68
RAX:0x0000000000000000 RCX:0x0000000000000000 RDX:0x0000ffffa694fa90 RBX:0x0000000000000000 
RSP:0x0000ffffa694fa48 RBP:0x0000ffffa694fa50 RSI:0x0000ffffa694fa78 RDI:0x0000000000000002 
 R8:0x0000000000000000  R9:0x0000000000020080 R10:0x0000000000000000 R11:0x0000000000000000 
R12:0x0000000000000000 R13:0x0000000000000000 R14:0x0000000000000000 R15:0x0000000000000000 
ES:0x002b CS:0x0033 SS:0x002b DS:0x002b FS:0x0043 GS:0x0053

I think this is #1393, #1449

Using my build of wine with new wow64 mode: https://download.copr.fedorainfracloud.org/results/teohhanhui/wine/fedora-40-x86_64/07475303-wine/

@alyssarosenzweig
Copy link
Contributor

Hitting similar symptoms on f40:

alyssa@blossom ~/b/build (main)> box64 ~/.fex-emu/RootFS/Fedora_40/usr/bin/whoami
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
Will use Hardware counter measured at 24.0 MHz emulating 3.0 GHz
Params database has 69 entries
Box64 with Dynarec v0.2.9 d1703b9b built on May 30 2024 12:05:12
BOX64: Detected 48bits at least of address space
Counted 57 Env var
BOX64 LIB PATH: /usr/local/lib64/:/usr/local/lib/:./:lib/:lib64/:x86_64/:bin64/:libs64/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/
BOX64 BIN PATH: ./:bin/:/home/alyssa/.cargo/bin/:/home/alyssa/pavolume/:/home/alyssa/.cabal/bin/:/home/alyssa/.cargo/bin/:/usr/lib64/ccache/:/home/alyssa/bin/:/home/alyssa/bin/bin/:/home/alyssa/.local/bin/:/usr/local/bin/:/usr/lib64/ccache/:/usr/local/bin/:/usr/bin/:/usr/local/sbin/:/usr/sbin/:/home/alyssa/.cabal/bin/
Looking for /home/alyssa/.fex-emu/RootFS/Fedora_40/usr/bin/whoami
Rename process to "whoami"
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libdl.so.2
Using native(wrapped) libutil.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
Error: Symbol error not found, cannot apply R_X86_64_JUMP_SLOT @0x100007f48 (0x2230) in /home/alyssa/.fex-emu/RootFS/Fedora_40/usr/bin/whoami
FillBlock triggered a segfault at 0x28c0 from 0x34dc5f90
FillBlock at 0x28c0 triggered a segfault, canceling
62662|SIGSEGV @0x34d76ed0 (???(/home/alyssa/.fex-emu/RootFS/Fedora_40/usr/bin/whoami+0x576ed0)) (x64pc=0x28c0/???:"???", rsp=0xffff6789ed38, stack=0xffff670a0000:0xffff678a0000 own=(nil) fp=0xffff6789ed40), for accessing 0x28c0 (code=1/prot=87), db=(nil)((nil):(nil)/(nil):(nil)/???:clean, hash:0/0) handler=(nil)
RSP-0x20:0x0000000000000000 RSP-0x18:0x0000000000000000 RSP-0x10:0x0000000000000000 RSP-0x08:0x0000000000000000
RSP+0x00:0x0000000000010080 RSP+0x08:0x0000000000000000 RSP+0x10:0x0000000100002805 RSP+0x18:0x0000ffff6789ed58
RAX:0x0000000000000000 RCX:0x0000000000000000 RDX:0x0000ffff6789ed70 RBX:0x0000000000000000 
RSP:0x0000ffff6789ed38 RBP:0x0000ffff6789ed40 RSI:0x0000ffff6789ed60 RDI:0x0000000000000001 
 R8:0x0000000000000000  R9:0x0000000000010080 R10:0x0000000000000000 R11:0x0000000000000000 
R12:0x0000000000000000 R13:0x0000000000000000 R14:0x0000000000000000 R15:0x0000000000000000 
ES:0x002b CS:0x0033 SS:0x002b DS:0x002b FS:0x0043 GS:0x0053 
fish: Job 1, 'box64 ~/.fex-emu/RootFS/Fedora_…' terminated by signal SIGSEGV (Address boundary error)

the whoami from fedora 38 (x86_64) works with box, but fedora 40 (x86_64) does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants