SuperiorServers / gm_tmysql4

MySQL connection module for Garry's Mod servers - SUP has picked up and maintained the module since it was abandoned years ago - Original author: @bkacjios
31 stars 7 forks source link

Problem with: Couldn't load module library! #8

Closed JarosLucky closed 4 years ago

JarosLucky commented 4 years ago

I am using the latest tmysql4 release, along with dash. But I cannot find a module with a known correct dll installation.

[dash] addons/dash/lua/dash/libraries/server/mysql.lua:1: Couldn't load module library!

image mysqloo module works fine, although it works fine from tmysql4 version 4.1+

Maybe I need some additional dependencies that I don't have on a dedicated debian 9 server?

JarosLucky commented 4 years ago

Installed packages at VDS here https://pastebin.com/XZ4LjZJn

KingofBeast commented 4 years ago

Run ldd on the binary, see what it tells you

JarosLucky commented 4 years ago

Result of running ldd -d https://pastebin.com/zwMpPJbU

undefined symbol: pthread_create        (./gmsv_tmysql4_linux.dll)
undefined symbol: gnutls_free   (./gmsv_tmysql4_linux.dll)
KingofBeast commented 4 years ago

pthread_create is fixed by linking to pthread

I haven't found a solution for gnutls_free yet, still working on it

KingofBeast commented 4 years ago

@JarosLucky try the newest releases (and delete caching_sha2_password.so it isn't needed anymore)

JarosLucky commented 4 years ago

Now

ldd -d gmsv_tmysql4_linux.dll
        linux-gate.so.1 (0xf7f78000)
        libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf7ecc000)
        libcrypto.so.1.1 => not found
        libssl.so.1.1 => not found
        librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xf7ec1000)
        libstdc++.so.6 => /lib32/libstdc++.so.6 (0xf7d42000)
        libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7c3c000)
        libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7c1e000)
        libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7a40000)
        /lib/ld-linux.so.2 (0xf7f7a000)
KingofBeast commented 4 years ago

You'll need to install libssl-dev:i386.

JarosLucky commented 4 years ago

install libssl1.1:i386 is quite enough

JarosLucky commented 4 years ago

still cannot be used in gmod

linux-gate.so.1 (0xf7fa1000)
        libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf7ef5000)
        libcrypto.so.1.1 => /lib/i386-linux-gnu/libcrypto.so.1.1 (0xf7c32000)
        libssl.so.1.1 => /lib/i386-linux-gnu/libssl.so.1.1 (0xf7b9b000)
        librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xf7b90000)
        libstdc++.so.6 => /lib32/libstdc++.so.6 (0xf7a11000)
        libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf790b000)
        libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf78ed000)
        libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf770f000)
        /lib/ld-linux.so.2 (0xf7fa3000)
        libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7709000)
KingofBeast commented 4 years ago

Linux binary is working fine for me now, run export LD_DEBUG=all before starting srcds, when it loads the module you'll see it spit out symbols that it couldn't load

JarosLucky commented 4 years ago

It is difficult for me to use the way you propose to find the error because of the linux game servers manager(lgsm) and it turns out that I have a huge data stream in the terminal.

JarosLucky commented 4 years ago

Well i just try to compile by youself module. And after resolving some missed packages i see this

gm_tmysql4/linux-gmake$ make
==== Building tmysql4 (release_x86) ====
database.cpp
../src/database.cpp: In member function ‘void Database::RunQuery(Query*)’:
../src/database.cpp:156:25: warning: converting to non-pointer type ‘unsigned int’ from NULL [-Wconversion-null]  
  unsigned int errorno = NULL;
                         ^~~~
databaseaction.cpp
main.cpp
result.cpp
../src/result.cpp: In constructor ‘Result::Result(PStatement*)’:
../src/result.cpp:157:21: warning: deleting ‘void*’ is undefined [-Wdelete-incomplete]
   delete[] binds[i].buffer;
                     ^~~~~~
statement.cpp
../src/statement.cpp: In function ‘void deleteBinds(MYSQL_BIND*, int)’:
../src/statement.cpp:16:22: warning: deleting ‘void*’ is undefined [-Wdelete-incomplete]
    delete[] binds[l].buffer;
                      ^~~~~~
../src/statement.cpp:19:20: warning: deleting ‘void*’ is undefined [-Wdelete-incomplete]
    delete binds[l].buffer;
                    ^~~~~~
../src/statement.cpp: In member function ‘void PStatement::Execute(MYSQL_BIND*, DatabaseAction*)’:
../src/statement.cpp:57:25: warning: converting to non-pointer type ‘unsigned int’ from NULL [-Wconversion-null]  
  unsigned int errorno = NULL;
                         ^~~~
timer.cpp
tmysql.cpp
adler32.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
compress.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
crc32.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
deflate.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
gzclose.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
gzlib.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
../src/zlib/gzlib.c: In function ‘gz_open’:
../src/zlib/gzlib.c:14:17: warning: implicit declaration of function ‘lseek’; did you mean ‘fseek’? [-Wimplicit-function-declaration]
 #  define LSEEK lseek
                 ^~~~~
../src/zlib/gzlib.c:252:9: note: in expansion of macro ‘LSEEK’
         LSEEK(state->fd, 0, SEEK_END);  /* so gzoffset() is correct */
         ^~~~~
gzread.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
In file included from ../src/zlib/gzread.c:6:
../src/zlib/gzread.c: In function ‘gz_load’:
../src/zlib/gzguts.h:57:17: warning: implicit declaration of function ‘read’; did you mean ‘fread’? [-Wimplicit-function-declaration]
 #  define _read read
                 ^~~~
../src/zlib/gzread.c:35:15: note: in expansion of macro ‘_read’
         ret = _read(state->fd, buf + *have, get);
               ^~~~~
../src/zlib/gzread.c: In function ‘gzclose_r’:
../src/zlib/gzguts.h:59:18: warning: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration]
 #  define _close close
                  ^~~~~
../src/zlib/gzread.c:651:11: note: in expansion of macro ‘_close’
     ret = _close(state->fd);
           ^~~~~~
gzwrite.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
In file included from ../src/zlib/gzwrite.c:6:
../src/zlib/gzwrite.c: In function ‘gz_comp’:
../src/zlib/gzguts.h:58:18: warning: implicit declaration of function ‘write’; did you mean ‘fwrite’? [-Wimplicit-function-declaration]
 #  define _write write
                  ^~~~~
../src/zlib/gzwrite.c:89:20: note: in expansion of macro ‘_write’
             writ = _write(state->fd, strm->next_in, put);
                    ^~~~~~
../src/zlib/gzwrite.c: In function ‘gzclose_w’:
../src/zlib/gzguts.h:59:18: warning: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration]
 #  define _close close
                  ^~~~~
../src/zlib/gzwrite.c:661:9: note: in expansion of macro ‘_close’
     if (_close(state->fd) == -1)
         ^~~~~~
infback.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
inffast.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
inflate.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
inftrees.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
trees.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
uncompr.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
zutil.c
cc1: warning: command line option ‘-std=c++17’ is valid for C++/ObjC++ but not for C
Creating ../bin/linux
Linking tmysql4
KingofBeast commented 4 years ago

That's a successful compile.

You need to use the LD_DEBUG variable to get any more meaningful information. Just use srcds_run instead of lgsm and watch the output. The moment you call require("tmysql4") from Lua, you'll see it start spewing out searching for symbols. And when it can't find a symbol, it'll output it.

JarosLucky commented 4 years ago

Okay, I will go look for how to do it. I hope it doesn't hurt that a few more dlls are used.

JarosLucky commented 4 years ago

Unfortunately, I have an endless flow of information. It seems necessary to make an empty server, for Debug.

JarosLucky commented 4 years ago

So, I made an empty server on the same machine, without using DASH and the problem is gone, I do not understand what the hell is going on here.

JarosLucky commented 4 years ago

well some error taked bin/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/gmod/serverfiles/garrysmod/lua/bin/gmsv_tmysql4_linux.dll)

JarosLucky commented 4 years ago

I have solved the question. Turns out in my root in the bin folder, there was a file above, which was taken when installing cstrike over gmod, because of which there was an incorrect file.

KingofBeast commented 4 years ago

Ah, makes sense. Good deal that you found the issue

JarosLucky commented 4 years ago

Thank you for help

сб, 5 сент. 2020 г., 02:26 KingofBeast notifications@github.com:

Ah, makes sense. Good deal that you found the issue

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/SuperiorServers/gm_tmysql4/issues/8#issuecomment-687337368, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEUDZMEZUWC3F6OVQEDQJOLSEE5OXANCNFSM4QTEXP4Q .