box86 icon indicating copy to clipboard operation
box86 copied to clipboard

rust-g missing symbols

Open plusnb opened this issue 2 years ago • 5 comments

arm64 to i686 cross compiled rust-g (v0.6.0) leads to missing symbols and a subsequent hang. This behavior may be a regression as the precompiled box86 i used on feb 11 didn't have this issue, but I was also using a precompiled rust-g (v1.2.0). Attempts to use 1.2.0 now (precompiled or built from source) exhibit different yet similar issues. This was also tested on a built from source box86, and just to note the issue is isolated to rust-g, BYOND 514.1589 seems to work fine with box86.

Debug level is 1
Dynarec for ARMv8, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA PageSize:4096 Cores:3
Params database has 21 entries
Box86 with Dynarec v0.2.9 7682cdce built on Feb 19 2023 01:15:43
BOX86_LD_LIBRARY_PATH: /usr/local/byond/bin/
Using default BOX86_PATH: ./:bin/
Counted 26 Env var
Looking for /usr/local/byond/bin/DreamDaemon
argv[1]="tgstation.dmb"
argv[2]="1337"
argv[3]="-trusted"
Rename process to "DreamDaemon"
Using emulated /usr/local/byond/bin/libbyond.so
Using emulated /usr/local/byond/bin/libext.so
Using native(wrapped) librt.so.1
Using emulated /lib/i386-linux-gnu/libstdc++.so.6
Using native(wrapped) libm.so.6
Using emulated /lib/i386-linux-gnu/libgcc_s.so.1
Using native(wrapped) libpthread.so.0
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux.so.2
Using native(wrapped) libdl.so.2
Wed Feb 22 06:56:27 2023
World opened on network port 1337.
Welcome BYOND! (5.0 Public Version 514.1589)
Using emulated ./librust_g.so
Using emulated /lib/i386-linux-gnu/libssl.so.1.1
Using emulated /lib/i386-linux-gnu/libcrypto.so.1.1
Using native(wrapped) libz.so.1
Error: Global Symbol statx not found, cannot apply R_386_GLOB_DAT @0xf1f62fc8 ((nil)) in ./librust_g.so
Look for __clock_gettime64 in loaded elfs
Warning, function __clock_gettime64 not found in lib libc.so.6
Look for __clock_gettime64 in loaded elfs
Warning, function __clock_gettime64 not found in lib libc.so.6
Look for __clock_gettime64 in loaded elfs
Warning, function __clock_gettime64 not found in lib libc.so.6
Look for __clock_gettime64 in loaded elfs
Warning, function __clock_gettime64 not found in lib libc.so.6
Look for __clock_gettime64 in loaded elfs
Warning, function __clock_gettime64 not found in lib libc.so.6
Error: Global Symbol __clock_gettime64 not found, cannot apply R_386_GLOB_DAT @0xf1f62fe0 ((nil)) in ./librust_g.so
Error: Symbol pwrite not found, cannot apply R_386_JMP_SLOT 0xf1f62e6c (0x2aa46) in ./librust_g.so
Warning, call to __cxa_thread_atexit_impl(0xf19d9660, 0x64031d90, 0xf1f6308c) ignored
Warning, call to __cxa_thread_atexit_impl(0xf19d94b0, 0x64031d00, 0xf1f6308c) ignored
640 global variables
World loaded at 06:56:46!
Warning, call to __cxa_thread_atexit_impl(0xf19d9600, 0x64031d74, 0xf1f6308c) ignored
Warning: Unsupported libc Syscall 0x17F (383)
Running /tg/ revision: 2022-02-13
origin/master: 22f4465d60a9d3bcf0d13c3d4da3c73972f429e0
Loading config file config.txt...
Loading config file game_options.txt...
Loading config file dbconfig.txt...
Loading config file comms.txt...
Loading config file antag_rep.txt...
Loading config file maps.txt...
Loading config file in_character_filter.txt...
Warning: call to partially implemented dl_iterate_phdr(0xf6f01b70, 0xf6ee61a8)
Warning: call to partially implemented dl_iterate_phdr(0xf6f01b70, 0xf6ee62a8)
Warning: call to partially implemented dl_iterate_phdr(0xf6f01b70, 0xf6ee62a8)
Warning: call to partially implemented dl_iterate_phdr(0xf6f01b70, 0xf6ee62a8)
Warning: call to partially implemented dl_iterate_phdr(0xf6f01b70, 0xf6ee61b8)
Warning: call to partially implemented dl_iterate_phdr(0xf6f01b70, 0xf6ee61b8)
Warning: call to partially implemented dl_iterate_phdr(0xf6f01b70, 0xf6ee61b8)
[06:56:46] Runtime in ,: bad arg name 'confidential'
  proc name: to chat (/proc/to_chat)
  src: null
  call stack:
  to chat(null, "<span class=\'danger\'>Failed ...", null)
  load poll data()
  world: New()
The BYOND hub reports that port 1337 is reachable.
[hang]

plusnb avatar Feb 22 '23 07:02 plusnb

the missing symbols doesn't seems to be the issue here. I suspect some bad Dynarec code, as the error [06:56:46] Runtime in ,: bad arg name 'confidential' doesn't seems normal. Can you run with BOX86_DYNAREC=0 to see if it behave correctly (but more slowly) without the dynarec?

ptitSeb avatar Feb 22 '23 07:02 ptitSeb

I think the warning message is a bug within the application im running on top of BYOND (yes the error messages / language are that bad) as it appears with the dynarec off, but the issue does seem to be within the dynarec then as BYOND/rust-g is able to load normally after that point instead of hanging

... [same as before]
[07:25:22] Runtime in ,: bad arg name 'confidential'
  proc name: to chat (/proc/to_chat)
  src: null
  call stack:
  to chat(null, "<span class=\'danger\'>Failed ...", null)
  load poll data()
  world: New()
The BYOND hub reports that port 1337 is reachable.
Initialized Title Screen subsystem within 0 seconds!
Initialized Database subsystem within 0 seconds!
Initialized Blackbox subsystem within 0 seconds!
Initialized Server Tasks subsystem within 0 seconds!
Initialized Input subsystem within 0 seconds!
Initialized Vis contents overlays subsystem within 0 seconds!
Initialized Materials subsystem within 0 seconds!
Initialized Research subsystem within 0.6 seconds!
Initialized Events subsystem within 0 seconds!
Initialized Jobs subsystem within 0 seconds!
Initialized Quirks subsystem within 0 seconds!
Initialized Ticker subsystem within 0 seconds!
Loading Box Station...
Loaded Station in 32s!
Loaded Lavaland in 22.8s!
Ruin loader finished with 0 left to spend.
Ruin loader finished with 0 left to spend.
Initialized Mapping subsystem within 134.1 seconds!
Initialized Networks subsystem within 0 seconds!
Initialized Economy subsystem within 0 seconds!
...

plusnb avatar Feb 22 '23 07:02 plusnb

Ok. Debugging Dynarec issue is a bit tricky. Can you give me the binaries (and the minium needed data files) so I can debug myself?

ptitSeb avatar Feb 22 '23 08:02 ptitSeb

this is the best i can do at the moment https://send.vis.ee/download/3e0d8fb398dd9164/#WcVY7imk8-suBmZSBCI7yQ setup enviromemt variables with byondexport and start with start.sh, the only dependency box86 has to emulate would be openssl1.1, i haven't tested the setup fully but everything should be there

plusnb avatar Feb 22 '23 08:02 plusnb

Ok, I reproduce localy, thanks. I'll debug the issue and keep you posted (it may take a few days...)

ptitSeb avatar Feb 22 '23 09:02 ptitSeb