ID:2357448
 
BYOND Version:512.1416 on Linux
Operating System:Linux
Web Browser:Chrome 65.0.3325.181
Applies to:Dream Daemon
Status: Open

Issue hasn't been assigned a status value.
Backtrace:
Welcome BYOND! (5.0 Beta Version 512.1416)
BUG: Crashing due to an illegal operation!
proc name: Execute (/DBQuery/proc/Execute)
source file: MySQL2.dm,166
usr: null
src: /DBQuery (/DBQuery)
call stack:
/DBQuery (/DBQuery): Execute("UPDATE server SET players=0,ho...", null)
serverInfo()
world: New()

Backtrace for BYOND 512.1416 on Linux:
Generated at Thu Mar 29 22:31:07 2018

DreamDaemon [0x8048000, 0x0], [0x8048000, 0x804bb24]
(unknown) ??
linux-gate.so.1 [0xf77ad000, 0xf77adcb0], [0xf77ad000, 0xf77adcb0]

Recent proc calls:
/DBQuery/proc/Close
/DBQuery/proc/Execute
/DBQuery/New
/DBQuery/proc/(init)
/DBConnection/proc/NewQuery
/proc/serverInfo
/world/New
/world/proc/hora
/world/proc/hora
/world/proc/CarregarWorld
/proc/SaveObjects
/proc/LoadObjects
/obj/Grama/New
/obj/proc/(init)
/obj/Grama/New
/obj/proc/(init)

To help the BYOND developers debug this, please send the above trace as part
of a very detailed bug report: http://www.byond.com/members/?command=view_tracker&tracker=1


Expected Results: _dm_db_execute()
Windows Results: 100% functional
Linux Results: 100% fail, I Tried put the libmariadb.so in so many places, only in /usr/lib change the Backtrace to another.

Backtrace 2:
World opened on network port 443.
Welcome BYOND! (5.0 Beta Version 512.1416)
The BYOND hub reports that port 443 is reachable.
BUG: Crashing due to an illegal operation!
proc name: Execute (/DBQuery/proc/Execute)
source file: MySQL2.dm,166
usr: null
src: /DBQuery (/DBQuery)
call stack:
/DBQuery (/DBQuery): Execute("UPDATE server SET players=0,ho...", null)
serverInfo()
world: New()

Backtrace for BYOND 512.1416 on Linux:
Generated at Thu Mar 29 23:42:23 2018

DreamDaemon [0x8048000, 0x0], [0x8048000, 0x804bb24]
libmariadb.so [0xf6c24000, 0x0], 0x11cd7
linux-gate.so.1 [0xf77d7000, 0xf77d7cb0], [0xf77d7000, 0xf77d7cb0]
libmariadb.so [0xf6c24000, 0x0], 0x11cd7
libmariadb.so 0x11d30, 0x11d51 (mysql_real_query)
libmariadb.so 0x11e80, 0x11eb5 (mysql_query)
libbyond.so [0xf724a000, 0x0], 0x3b9396
libbyond.so [0xf724a000, 0x0], 0x3b9030
libbyond.so [0xf724a000, 0x0], 0x2cd1d2
libbyond.so [0xf724a000, 0x0], 0x272af7
libbyond.so [0xf724a000, 0x0], 0x28ad14
libbyond.so [0xf724a000, 0x0], 0x294773
libbyond.so [0xf724a000, 0x0], 0x297560
libbyond.so [0xf724a000, 0x0], 0x273bf4
libbyond.so [0xf724a000, 0x0], 0x28ad14
libbyond.so [0xf724a000, 0x0], 0x26b5e7
libbyond.so [0xf724a000, 0x0], 0x28ab55
libbyond.so [0xf724a000, 0x0], 0x28ce40
libbyond.so [0xf724a000, 0x0], 0x241519
libbyond.so 0x35e0f0, 0x35e20a
libbyond.so 0x324720, 0x324922
DreamDaemon [0x8048000, 0x0], [0x8048000, 0x804ae34]
libc.so.6 0x18190, 0x18286 (__libc_start_main)

Recent proc calls:
/DBQuery/proc/Close
/DBQuery/proc/Execute
/DBQuery/New
/DBQuery/proc/(init)
/DBConnection/proc/NewQuery
/proc/serverInfo
/world/New
/DBConnection/proc/ErrorMsg
/DBConnection/proc/IsConnected
/DBConnection/proc/Connect
/proc/setup_database_connection
/proc/connectDB
/world/New
/DBConnection/New


To help the BYOND developers debug this, please send the above trace as part
of a very detailed bug report: http://www.byond.com/members/?command=view_tracker&tracker=1
Unfortunately I can't do anything with that trace, since the crash is happening inside MariaDB itself.
In response to Lummox JR
Do you have any idea what I can try to do?
Offhand I can't think of anything at the moment, except maybe try looking at the query being run to see if there's anything about that in particular that could be a problem.

Also I would say the multiple world/New() calls are concerning; that means you've overridden the proc in multiple places instead of just doing it in one place, which is a lot more reliable. While I don't think a timing issue is in play, it's just not a good idea to split up your procs that way.

If you know which exact build of MariaDB you're using, it's possible that there's info about a crash at those offset positions floating around online.
In response to Lummox JR
I using this lib and the recommended file. http://www.byond.com/developer/Dantom/DB?tab=index

The operating system is 64 bits, but I can host the game normally because I've used the commands. I tried other .so files but none of them worked.
We need to know the exact and full version number of mariadb you have installed.
In response to MrStonedOne
I tried more than one version and more than 5 dirs (like xirre said in the Discussion of the lib )

2.0.0
2.0.16
2.3.5
debian and linux version
etc
I mean for the back trace(s) you pasted above. what version(s) of mariadb were you using there. Lummox can go cross reference what exactly maria-db was doing based on the offset in the stack trace, but he has to have the exact same version that the backtrace was generated from as the offsets change between versions.
In response to MrStonedOne
Using 2.0.0 in /usr/lib the result is the second trace, the unique trace that appears to have some interaction with DreamDaemon.

http://www.byond.com/download/db/ mariadb_client-2.0.0-linux.tgz
The same problem occurs in the stable version. I only have 64x operating systems available for testing.

centos-6
centos-7
coreos-alpha
coreos-beta
coreos-stable
cos-beta
cos-dev
cos-stable
cos-stable
debian-8
debian-9
rhel-6
rhel-7-sap-apps
rhel-7-sap-hana
rhel-7
sles-11
sles-12-sp2-sap
sles-12-sp3-sap
sles-12
ubuntu-1404-lts
ubuntu-1604-lts
ubuntu-1710
In response to YURIRAMOS
Er, it appears you copied that content from a site that uses relative URLs, and as a result none of those links work nor do any included images. You'll want to edit that. [edit: Looks like you just did.]

Although I don't know that it throws any useful light on this issue anyway. I'm not even sure what the table is for.

I did some quick Googling last night of the offsets that came up in your crash, but I found nothing. Ultimately if MariaDB is crashing, it's because it's being passed bad data or running in an environment it shouldn't. Since other games use it with no trouble, I don't think the bad data is coming from BYOND.

As a non-Linux guy I can't answer this question, but is it possible that /usr/lib isn't the right place to put this library since it's 32-bit? AFAIK, SS13 builds just leave it in the same directory as the .dmb. Maybe your system is trying to load it differently because of its location, and that could account for the trouble?
In response to Lummox JR
I tried more than 5 different locations, including the same directory + -trusted. When the file is in /usr/lib the error changes, showing that there is some interaction, even if it fails.

Similar problems:
http://www.byond.com/forum/?post=1887571
apt-get install libmysqlclient-dev:i386
don't solved the problem, I'd installed the i386 architecture. (change de backtrace too)
libmysqlclient.so 0x1a8b0, 0x1a8e2 (mysql_send_query)


http://www.byond.com/forum/?post=1878002
The /usr/lib32 folder did not exist, even creating and putting the file there did not happen.

http://www.byond.com/forum/?post=117576#comment16921941
Same to /lib

Ins't possible include and load natively in the next update? Already exist the secret proc _dm_db_execute()
libmariadb.so in /usr/lib
File: http://www.byond.com/developer/Dantom/DB?tab=index
Backtrace for BYOND 512.1416 on Linux:
Generated at Fri Mar 30 21:40:33 2018

DreamDaemon [0x8048000, 0x0], [0x8048000, 0x804bb24]
libmariadb.so [0xf727b000, 0x0], 0x11cd7
[0xf7f08000, 0xf7f08de0], [0xf7f08000, 0xf7f08de0]
libmariadb.so [0xf727b000, 0x0], 0x11cd7
libmariadb.so 0x11d30, 0x11d51 (mysql_real_query)
libmariadb.so 0x11e80, 0x11eb5 (mysql_query)
libbyond.so [0xf7976000, 0x0], 0x3b9396
libbyond.so [0xf7976000, 0x0], 0x3b9030
libbyond.so [0xf7976000, 0x0], 0x2cd1d2
libbyond.so [0xf7976000, 0x0], 0x272af7
libbyond.so [0xf7976000, 0x0], 0x28ad14
libbyond.so [0xf7976000, 0x0], 0x294773
libbyond.so [0xf7976000, 0x0], 0x297560
libbyond.so [0xf7976000, 0x0], 0x273bf4
libbyond.so [0xf7976000, 0x0], 0x28ad14
libbyond.so [0xf7976000, 0x0], 0x26b5e7
libbyond.so [0xf7976000, 0x0], 0x28ab55
libbyond.so [0xf7976000, 0x0], 0x28ce40
libbyond.so [0xf7976000, 0x0], 0x241519
libbyond.so 0x35e0f0, 0x35e20a
libbyond.so 0x324720, 0x324922
DreamDaemon [0x8048000, 0x0], [0x8048000, 0x804ae34]
libc.so.6 0x18890, 0x18986 (__libc_start_main)


Without libmariadb.so, after the command: apt-get install libmysqlclient-dev:i386
DreamDaemon [0x8048000, 0x0], [0x8048000, 0x804bb24]
libmysqlclient.so 0x1a8b0, 0x1a8e2 (mysql_send_query)
[0xf7f16000, 0xf7f16de0], [0xf7f16000, 0xf7f16de0]
libmysqlclient.so 0x1a8b0, 0x1a8e2 (mysql_send_query)
libmysqlclient.so 0x1a950, 0x1a972 (mysql_real_query)
libmysqlclient.so 0x10ed0, 0x10ef9 (mysql_query)
libbyond.so [0xf7984000, 0x0], 0x3b9396
libbyond.so [0xf7984000, 0x0], 0x3b9030
libbyond.so [0xf7984000, 0x0], 0x2cd1d2
libbyond.so [0xf7984000, 0x0], 0x272af7
libbyond.so [0xf7984000, 0x0], 0x28ad14
libbyond.so [0xf7984000, 0x0], 0x294773
libbyond.so [0xf7984000, 0x0], 0x297560
libbyond.so [0xf7984000, 0x0], 0x273bf4
libbyond.so [0xf7984000, 0x0], 0x28ad14
libbyond.so [0xf7984000, 0x0], 0x26b5e7
libbyond.so [0xf7984000, 0x0], 0x28ab55
libbyond.so [0xf7984000, 0x0], 0x28ce40
libbyond.so [0xf7984000, 0x0], 0x241519
libbyond.so 0x35e0f0, 0x35e20a
libbyond.so 0x324720, 0x324922
DreamDaemon [0x8048000, 0x0], [0x8048000, 0x804ae34]
libc.so.6 0x18890, 0x18986 (__libc_start_main)
DreamDaemon [0x8048000, 0x0], [0x8048000, 0x804a731]


Other cases (like libmariadb.so in the same directory as the .dmb or bin from byond):
DreamDaemon [0x8048000, 0x0], [0x8048000, 0x804bb24]
(unknown) ??
[0xf7f7d000, 0xf7f7dde0], [0xf7f7d000, 0xf7f7dde0]

or

DreamDaemon [0x8048000, 0x0], [0x8048000, 0x804bb24]
(unknown) ??
linux-gate.so.1 [0xf77ad000, 0xf77adcb0], [0xf77ad000, 0xf77adcb0]


call() may also be used to access third-party libraries (.DLL files on windows, .SO files on unix), as long as the one or more of the following conditions is met:
• The library is located in the BYOND user bin/ folder (~/.byond/bin on unix, typically "My Documents/BYOND/bin/" on windows). This is intended to allow the user to install permanently "trusted" libraries. -OR-
• The server is run in -trusted mode. -OR-
• The server grants permission to access the DLL at runtime, through a prompt query.