Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dash Mysql Segmentation fault. #3778

Closed
ghdqh1515 opened this issue Oct 16, 2020 · 1 comment
Closed

Dash Mysql Segmentation fault. #3778

ghdqh1515 opened this issue Oct 16, 2020 · 1 comment

Comments

@ghdqh1515
Copy link

ghdqh1515 commented Oct 16, 2020

I am trying to link mysql to dashd
When dashd runs mysql_init function, I get an error
In another process mysql_init runs without problem

1.dashd.cpp (Code modification)
int main(int argc, char* argv[])
{
MYSQL conn;
mysql_init(&conn);

  1. $/configure LIBS="-L/usr/lib64/mysql -lmysqlclient -lm" LDFLAGS="-L/usr/lib64/mysql -lmysqlclient -lm" CFLAGS="-I/usr/include/mysql" CPPFLAGS="-I/usr/include/mysql" CXX="-g -std=c++11 -L/usr/lib64/mysql -lmysqlclient -lm -I/usr/include/mysql -lmysqlclient" CC="-L/usr/lib64/mysql -lmysqlclient -lm -I/usr/include/mysql -lmysqlclient" --with-gui=no --prefix=$(pwd)/depends/x86_64-pc-linux-gnu
  2. $make
  3. $./src/dashd

Segmentation fault when running dashd. I get an error

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff67d8b5e in __strcmp_avx2 () from /usr/lib64/libc.so.6
Missing separate debuginfos, use: yum debuginfo-install Percona-Server-shared-57-5.7.28-31.1.el8.x86_64 libgcc-8.3.1-5.el8.0.2.x86_64 libstdc++-8.3.1-5.el8.0.2.x86_64 openssl-libs-1.1.1c-15.el8.x86_64 zlib-1.2.11-16.el8_2.x86_64
(gdb) bt
#0 0x00007ffff67d8b5e in _strcmp_avx2 () from /usr/lib64/libc.so.6
#1 0x000055555600c7ec in getrn ()
#2 0x000055555600ca64 in lh_insert ()
#3 0x000055555601abc2 in OBJ_NAME_add ()
#4 0x00007ffff6422cc2 in ossl_init_ssl_base_ossl
() from /usr/lib64/libssl.so.1.1
#5 0x00007ffff760fe67 in __pthread_once_slow () from /usr/lib64/libpthread.so.0
#6 0x00007ffff60f9dad in CRYPTO_THREAD_run_once () from /usr/lib64/libcrypto.so.1.1
#7 0x00007ffff6422f3b in OPENSSL_init_ssl () from /usr/lib64/libssl.so.1.1
#8 0x00007ffff7879c14 in ssl_start () from /usr/lib64/mysql/libmysqlclient.so.20
#9 0x00007ffff7841fdf in mysql_server_init () from /usr/lib64/mysql/libmysqlclient.so.20
#10 0x00007ffff784ad0b in mysql_init () from /usr/lib64/mysql/libmysqlclient.so.20
#11 0x0000555555782d2e in main () at dashd.cpp:195

Why does mysql_init get an error?

$ldd ./src/dashd
linux-vdso.so.1 (0x00007fff31933000)
libmysqlclient.so.20 => /usr/lib64/mysql/libmysqlclient.so.20 (0x00007fb099c6c000)
libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007fb099a4c000)
libz.so.1 => /usr/lib64/libz.so.1 (0x00007fb099835000)
librt.so.1 => /usr/lib64/librt.so.1 (0x00007fb09962c000)
libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007fb099428000)
libm.so.6 => /usr/lib64/libm.so.6 (0x00007fb0990a6000)
libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007fb098e8e000)
libc.so.6 => /usr/lib64/libc.so.6 (0x00007fb098acc000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb09b456000)
libssl.so.1.1 => /usr/lib64/libssl.so.1.1 (0x00007fb098838000)
libcrypto.so.1.1 => /usr/lib64/libcrypto.so.1.1 (0x00007fb098355000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fb097fc0000)

$mysql_config
Usage: /usr/bin/mysql_config-64 [OPTIONS]
Compiler: GNU 8.3.1
Options:
--cflags [-I/usr/include/mysql -m64 ]
--cxxflags [-I/usr/include/mysql -m64 ]
--include [-I/usr/include/mysql]
--libs [-L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -lrt -lcoredumper -lssl -lcrypto -ldl]
--libs_r [-L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -lrt -lcoredumper -lssl -lcrypto -ldl]
--plugindir [/usr/lib64/mysql/plugin]
--socket [/var/lib/mysql/mysql.sock]
--port [0]
--version [5.7.31-34]
--libmysqld-libs [-L/usr/lib64/mysql -l ]
--variable=VAR VAR is one of:
pkgincludedir [/usr/include/mysql]
pkglibdir [/usr/lib64/mysql]
plugindir [/usr/lib64/mysql/plugin]

Machine specs:

  • OS:CentOS8
@PastaPastaPasta
Copy link
Member

@UdjinM6 Do you have thoughts on this? I didn't know we had any support for MySQL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants