Answer the question
In order to leave comments, you need to log in
How to deal with SIGSEGV in MariaDB?
There is such a program:
#include <iostream>
#include "include/mysql.h"
#include <Poco/Data/Session.h>
#include <Poco/Data/SQLite/Connector.h>
#include "include/Server.h"
#include "src/DBConnector.cpp"
void show_error(MYSQL *mysql)
{
printf("Error(%d) [%s] \"%s\"", mysql_errno(mysql),
mysql_sqlstate(mysql),
mysql_error(mysql));
mysql_close(mysql);
exit(-1);
}
int main(int i,char* args[]){
MYSQL *mysql;
const char *query;
mysql_debug("d:t:O");
mysql= mysql_init(NULL);
if (!mysql_real_connect(mysql, "localhost", "stats", "q1w2e3r4",
"example_db", 0, "/var/run/mysqld/mysqld.sock", 0))
show_error(mysql);
mysql_close(mysql);
return 0;
}
Program received signal SIGSEGV, Segmentation fault.
__strcmp_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:173
173 ../sysdeps/x86_64/multiarch/../strcmp.S: Нет такого файла или каталога.
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
Answer the question
In order to leave comments, you need to log in
The problem is that you are not reading the error.
173 ../sysdeps/x86_64/multiarch/../strcmp.S: No such file or directory.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question