lunarmodules / luasql

LuaSQL is a simple interface from Lua to a DBMS.
http://lunarmodules.github.io/luasql
535 stars 192 forks source link

Segmentation Fault on env:connect #119

Closed Dimentio closed 1 year ago

Dimentio commented 4 years ago

I used to have no issues until I updated my ubuntu's packages now I am no longer able to use this at all, I'm using the example from the website for mysql connection.

My server is using Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-70-generic x86_64) and i'm using luvit to run the example. My server also use MariaDB.

Here's the core dump

coredump.zip

Core was generated by luvit ./test.lua.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f084b681e8a in ?? ()
[Current thread is 1 (LWP 15440)]
#0  __strcmp_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S:31
#1  0x00000000005ffe1d in lh_insert ()
#2  0x000000000060a377 in OBJ_NAME_add ()
#3  0x00007f08489a0e5e in ?? () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#4  0x00007f084c192827 in __pthread_once_slow (once_control=0x7f0848bf9928,
    init_routine=0x7f08489a0d70) at pthread_once.c:116
#5  0x00007f08486818f9 in CRYPTO_THREAD_run_once () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
#6  0x00007f08489a107b in OPENSSL_init_ssl () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#7  0x00007f0848e72224 in ?? () from /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20
#8  0x00007f0848e37c27 in mysql_server_init () from /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20
#9  0x00007f0848e40397 in mysql_init () from /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20
#10 0x00007f08493d1ec3 in env_connect () from /usr/local/lib/lua/5.1/luasql/mysql.so
#11 0x00000000004e781a in lj_BC_FUNCC ()
#12 0x00000000004d652d in lua_pcall ()
#13 0x000000000044918b in main ()
Dimentio commented 4 years ago

Using libmysqlclient from one of my other servers (Ubuntu 16.04.6 LTS) fix the issue. I guess it's safe to assume that the newer mysqlclient has trouble with luasql.

tomasguisasola commented 4 years ago

Or there were some issue with the linker?