box86 icon indicating copy to clipboard operation
box86 copied to clipboard

Can BOX86 run a Multi Theft Auto server?

Open hugoyervides opened this issue 5 years ago • 10 comments

Hi, I run a small MTA:SA server for development and I though it will be interesting to try to run it on my Raspberry Pi, I tried compiling the files on my local x86 vm and moving the binaries to the Pi and run it using BOX64, however I was unable to start the server, here is the log

box86 ./mta-server Dynarec for ARM, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA PageSize:4096 Using default BOX86_LD_LIBRARY_PATH: ./:lib/:lib32/:x86/ Using default BOX86_PATH: ./:bin/ Counted 25 Env var Looking for ./mta-server Using native(wrapped) libdl.so.2 Using native(wrapped) libpthread.so.0 Using native(wrapped) libc.so.6 Using native(wrapped) ld-linux.so.2 Using native(wrapped) librt.so.1 Using emulated ./core.so Using native(wrapped) libncursesw.so.5 Using native(wrapped) libtinfo.so.5 Error: Global Symbol LINES not found, cannot apply R_386_GLOB_DAT @0xb5ba7eac ((nil)) in ./core.so Error: Global Symbol COLS not found, cannot apply R_386_GLOB_DAT @0xb5ba7f10 ((nil)) in ./core.so 2734|SIGSEGV @0xb5bf80a0 (???) (x86pc=0x47504de/"./core.so/_ZN11CServerImpl3RunEiPPc + 2656"), for accessing (nil) (code=1), db=0x4816b68(0xb5b34610/./core.so/_ZN11CServerImpl3RunEiPPc + 2656) 2734|Double SIGSEGV! Segmentation fault

If someone knows what could be the problem let me know! Thanks

hugoyervides avatar Oct 03 '20 05:10 hugoyervides

Thanks @ptitSeb for this contribution! However the server still refuses to start, here its the new error

Error: PltReolver: Symbol printw not found, cannot apply R_386_JMP_SLOT @0xb5aea368 (0xb5a6d866) in ./core.so

Thanks.

hugoyervides avatar Oct 12 '20 00:10 hugoyervides

Thanks @ptitSeb, the error is gone, unfortunately the game server still refuses to start now throwing this error

27923|SIGSEGV @0x288e7a4 (???) (x86pc=0xffffffff/???:"???"), for accessing 0x74787c20 (code=1), db=(nil)((nil)/???) 27923|Double SIGSEGV! Segmentation fault If it helps, here its the official MTA:SA binaries for the game server.

https://linux.mtasa.com/

Thanks.

hugoyervides avatar Oct 19 '20 23:10 hugoyervides

Can you try again, check if it works (and close the ticket) or update the ticket with a new log.

ptitSeb avatar Dec 31 '20 15:12 ptitSeb

Hi.

This is the new log that is showing up when trying to run.

Box86 with Dynarec v0.2.5 5478879a built on Dec  2 2021 05:21:43
Error initializing native libncursesw.so.5 (last dlerror is libncursesw.so.5: cannot open shared object file: No such file or directory)
Cannot dlopen("./core.so"/0xf7ca5051, 2)

ERROR: Could not load ./core.so
Check installed data files.
Press enter to continue...

Thanks.

hugoyervides avatar Dec 02 '21 05:12 hugoyervides

install libncursesw5, with sudo apt install libncursesw5 if you are Debian/Ubuntu (add or libncursesw5:armhf if you are on 64bits version).

ptitSeb avatar Dec 02 '21 06:12 ptitSeb

Thanks @ptitSeb

After installing libncursesw5 the server runs but after some seconds crashes, here its the new log

Box86 with Dynarec v0.2.5 6d8e781c built on Dec  8 2021 17:41:13
Error: Symbol sched_getcpu not found, cannot apply R_386_JMP_SLOT 0xf713d474 (0x181e0) in ./core.so
Error: Symbol getwchar not found, cannot apply R_386_JMP_SLOT 0xf713d480 (0x18210) in ./core.so
Error: Symbol wprintw not found, cannot apply R_386_JMP_SLOT 0xf713d49c (0x18280) in ./core.so
MTA:BLUE Server for MTA:SA

Error: Symbol sched_getcpu not found, cannot apply R_386_JMP_SLOT 0xf601a36c (0x40dc0) in /home/ubuntu/mtasa/multitheftauto_linux/net.so
Error: Symbol sched_getcpu not found, cannot apply R_386_JMP_SLOT 0xf58897f0 (0x62fd0) in /home/ubuntu/mtasa/multitheftauto_linux/xmll.so
Error: Symbol sched_getcpu not found, cannot apply R_386_JMP_SLOT 0xf4c3ed90 (0xa1656) in /home/ubuntu/mtasa/multitheftauto_linux/mods/deathmatch/deathmatch.so

Thanks.

hugoyervides avatar Dec 09 '21 04:12 hugoyervides

I have added all the missing functions, but I'll need more log if it still crashes. Use BOX86_LOG=1 env. var. to have more logs.

ptitSeb avatar Dec 09 '21 07:12 ptitSeb

Thanks @ptitSeb!

Server runs and accepts connections, however, it only works if I redirect the output into a file $ box86 mta-server > file.txt

Here its the content of the file

Debug level is 1
Dynarec for ARM, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA PageSize:4096
Box86 with Dynarec v0.2.5 ed8e01ea built on Dec  9 2021 18:14:20
Using default BOX86_LD_LIBRARY_PATH: ./:lib/:lib32/:x86/
Using default BOX86_PATH: ./:bin/
Counted 26 Env var
Looking for mta-server
Using native(wrapped) libdl.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux.so.2
Using native(wrapped) librt.so.1
Using emulated ./core.so
Using native(wrapped) libncursesw.so.5
Using native(wrapped) libtinfo.so.5
Warning: Weak Symbol _ZGTtnaj not found, cannot apply R_386_JMP_SLOT 0xf70a4294 (0x17a60)
Warning: Weak Symbol _ZGTtdlPv not found, cannot apply R_386_JMP_SLOT 0xf70a4518 (0x18470)
MTA:BLUE Server for MTA:SA

Using emulated /home/ubuntu/mtasa/multitheftauto_linux/net.so
Using native(wrapped) libz.so.1
Using native(wrapped) libm.so.6
Warning: Weak Symbol _ZGTtnaj not found, cannot apply R_386_JMP_SLOT 0xf60030c8 (0x40330)
Warning: Weak Symbol _ZGTtdlPv not found, cannot apply R_386_JMP_SLOT 0xf600321c (0x40880)
Using emulated /home/ubuntu/mtasa/multitheftauto_linux/xmll.so
Warning: Weak Symbol _ZGTtnaj not found, cannot apply R_386_JMP_SLOT 0xf58f41b8 (0x616f0)
Warning: Weak Symbol _ZGTtdlPv not found, cannot apply R_386_JMP_SLOT 0xf58f44d8 (0x62370)
Using emulated /home/ubuntu/mtasa/multitheftauto_linux/mods/deathmatch/deathmatch.so
Warning: Weak Symbol _ZGTtdlPv not found, cannot apply R_386_JMP_SLOT 0xf4d2b5c8 (0x9f736)
Warning: Weak Symbol _ZGTtnaj not found, cannot apply R_386_JMP_SLOT 0xf4d2bd88 (0xa1636)
==================================================================
= Multi Theft Auto: San Andreas v1.5.9
==================================================================
= Server name      : Default MTA Server
= Server IP address: 192.168.15.50
= Server port      : 22003
=
= Log file         : ..tauto_linux/mods/deathmatch/logs/server.log
= Maximum players  : 32
= HTTP port        : 22005
= Voice Chat       : Disabled
= Bandwidth saving : Medium
==================================================================
[01:34:08] WARNING: Private IP '192.168.15.50' with ase enabled! Use: <serverip>auto</serverip>
[01:34:09] Resources: 194 loaded, 0 failed
[01:34:09] Starting resources...
[01:34:09] Server minclientversion is now 1.5.8-9.20927.0
[01:34:09] Gamemode 'play' started.
[01:34:09] Querying MTA master server... success! 
[01:34:09] Authorized serial account protection is enabled for the ACL group(s): `Admin`  See http://mtasa.com/authserial
[01:34:09] WARNING: <owner_email_address> not set
[01:34:09] Server started and is ready to accept connections!
[01:34:09] To stop the server, type 'shutdown' or press Ctrl-C
[01:34:09] Type 'help' for a list of commands.
[01:36:37] Closing SQLite3 database
Library libm.so.6 (0x638e43b0) needs 0x639fa510, but it was not found. Ignoring.
Library libm.so.6 (0x638e43b0) needs 0x638ba978, but it was not found. Ignoring.
Library libz.so.1 (0x638e2ec8) needs 0x638ba978, but it was not found. Ignoring.
Library libncursesw.so.5 (0x6388a2d8) needs 0x638220d8, but it was not found. Ignoring.
Library libc.so.6 (0x63801ed8) needs 0x639fa510, but it was not found. Ignoring.
Library libc.so.6 (0x63801ed8) needs 0x638fdff8, but it was not found. Ignoring.
Library libc.so.6 (0x63801ed8) needs 0x638ba978, but it was not found. Ignoring.
Library libc.so.6 (0x63801ed8) needs 0x638220d8, but it was not found. Ignoring.
Library ld-linux.so.2 (0x63807038) needs 0x639fa510, but it was not found. Ignoring.
Library ld-linux.so.2 (0x63807038) needs 0x638fdff8, but it was not found. Ignoring.
Library ld-linux.so.2 (0x63807038) needs 0x638ba978, but it was not found. Ignoring.
Library ld-linux.so.2 (0x63807038) needs 0x638220d8, but it was not found. Ignoring.
Library libpthread.so.0 (0x63801d68) needs 0x639fa510, but it was not found. Ignoring.
Library libpthread.so.0 (0x63801d68) needs 0x638ba978, but it was not found. Ignoring.
Library libpthread.so.0 (0x63801d68) needs 0x638220d8, but it was not found. Ignoring.

Thanks.

hugoyervides avatar Dec 10 '21 01:12 hugoyervides

What happens if you don't redirect the output? You can run with BOX86_LOG=1 BOX86_TRACE_FGILE=file.txt box86 ./mta-server to only redirect box86 log to a file.

ptitSeb avatar Dec 10 '21 08:12 ptitSeb

Hi @ptitSeb

I ran the server with the verbosity level mentioned and enabled trace to a file. The server crashes and BOX86 does not generate the file containing the trace/logs.

image

Looks like a problem related with ncurses. I try running the server without enabling ncurses and it runs great. However, when starting resources that uses dbconmy.so for MySQL server connections It crashes with the following logs.

==================================================================
= Multi Theft Auto: San Andreas v1.5.9
==================================================================
= Server name      : mtasa server
= Server IP address: 192.168.15.15
= Server port      : 22003
=
= Log file         : ../servers/dm/mods/deathmatch/logs/server.log
= Maximum players  : 1024
= HTTP port        : 22005
= Voice Chat       : Disabled
= Bandwidth saving : Medium
==================================================================
[01:21:40] WARNING: Private IP '192.168.15.15' with ase enabled! Use: <serverip>auto</serverip>
[01:28:13] Resources: 2001 loaded, 0 failed
[01:28:13] Server password set to 'pswd'
[01:28:13] Starting resources...Error: Symbol OPENSSL_init_crypto not found, cannot apply R_386_JMP_SLOT 0xe354e06c (0x8a1c0) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol SSL_set_quiet_shutdown not found, cannot apply R_386_JMP_SLOT 0xe354e124 (0x8a4a0) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol SSL_CTX_get0_param not found, cannot apply R_386_JMP_SLOT 0xe354e1c0 (0x8a710) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol BIO_set_callback_ex not found, cannot apply R_386_JMP_SLOT 0xe354e23c (0x8a900) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol SSL_CTX_set_options not found, cannot apply R_386_JMP_SLOT 0xe354e2d8 (0x8ab70) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol RSA_public_encrypt not found, cannot apply R_386_JMP_SLOT 0xe354e2f8 (0x8abf0) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol TLS_server_method not found, cannot apply R_386_JMP_SLOT 0xe354e32c (0x8acc0) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol EVP_MD_CTX_reset not found, cannot apply R_386_JMP_SLOT 0xe354e360 (0x8ad90) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol EVP_CIPHER_iv_length not found, cannot apply R_386_JMP_SLOT 0xe354e474 (0x8b1e0) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol OPENSSL_init_ssl not found, cannot apply R_386_JMP_SLOT 0xe354e610 (0x8b850) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol SSL_get_rbio not found, cannot apply R_386_JMP_SLOT 0xe354e6a8 (0x8bab0) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol X509_VERIFY_PARAM_set1_host not found, cannot apply R_386_JMP_SLOT 0xe354e8f4 (0x8c3e0) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol X509_VERIFY_PARAM_set1_ip_asc not found, cannot apply R_386_JMP_SLOT 0xe354e934 (0x8c4e0) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol FIPS_mode_set not found, cannot apply R_386_JMP_SLOT 0xe354e944 (0x8c520) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol BIO_set_callback_arg not found, cannot apply R_386_JMP_SLOT 0xe354ea68 (0x8c9b0) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol EVP_EncryptFinal not found, cannot apply R_386_JMP_SLOT 0xe354eb14 (0x8cc60) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol EVP_DecryptFinal_ex not found, cannot apply R_386_JMP_SLOT 0xe354ec20 (0x8d090) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol FIPS_mode not found, cannot apply R_386_JMP_SLOT 0xe354ec30 (0x8d0d0) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol DH_set0_pqg not found, cannot apply R_386_JMP_SLOT 0xe354ed1c (0x8d480) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol EVP_MD_CTX_new not found, cannot apply R_386_JMP_SLOT 0xe354f03c (0x8e100) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol BIO_new_bio_pair not found, cannot apply R_386_JMP_SLOT 0xe354f098 (0x8e270) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol SSL_CTX_set_ciphersuites not found, cannot apply R_386_JMP_SLOT 0xe354f278 (0x8e9f0) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol EVP_DecryptUpdate not found, cannot apply R_386_JMP_SLOT 0xe354f2fc (0x8ec00) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol EVP_CIPHER_CTX_set_padding not found, cannot apply R_386_JMP_SLOT 0xe354f300 (0x8ec10) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol EVP_DecryptInit not found, cannot apply R_386_JMP_SLOT 0xe354f37c (0x8ee00) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol EVP_CIPHER_CTX_free not found, cannot apply R_386_JMP_SLOT 0xe354f438 (0x8f0f0) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol X509_STORE_load_locations not found, cannot apply R_386_JMP_SLOT 0xe354f458 (0x8f170) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol SSL_SESSION_set_timeout not found, cannot apply R_386_JMP_SLOT 0xe354f498 (0x8f270) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol BIO_get_callback_arg not found, cannot apply R_386_JMP_SLOT 0xe354f500 (0x8f410) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol SSL_get_fd not found, cannot apply R_386_JMP_SLOT 0xe354f544 (0x8f520) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol SSL_get_wbio not found, cannot apply R_386_JMP_SLOT 0xe354f588 (0x8f630) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol SSL_set_options not found, cannot apply R_386_JMP_SLOT 0xe354f5d0 (0x8f750) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol EVP_CIPHER_CTX_new not found, cannot apply R_386_JMP_SLOT 0xe354f5f0 (0x8f7d0) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol EVP_MD_CTX_free not found, cannot apply R_386_JMP_SLOT 0xe354f654 (0x8f960) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol EVP_EncryptInit not found, cannot apply R_386_JMP_SLOT 0xe354f69c (0x8fa80) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol TLS_client_method not found, cannot apply R_386_JMP_SLOT 0xe354f7f4 (0x8ffe0) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol EVP_EncryptUpdate not found, cannot apply R_386_JMP_SLOT 0xe354f808 (0x90030) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol EVP_CIPHER_block_size not found, cannot apply R_386_JMP_SLOT 0xe354f848 (0x90130) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol SSL_CTX_set_session_id_context not found, cannot apply R_386_JMP_SLOT 0xe354f90c (0x90440) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
Error: Symbol PEM_read_RSA_PUBKEY not found, cannot apply R_386_JMP_SLOT 0xe354f91c (0x90480) in /home/victoroy/mtasa/servers/dm/mods/deathmatch/dbconmy.so
malloc_consolidate(): unaligned fastbin chunk detected
Aborted (core dumped)

Thanks.

hugoyervides avatar Jan 16 '22 01:01 hugoyervides