crash with libmysqld
Posted by: Jean-Michel Leon
Date: October 21, 2010 03:55PM


I'm trying to run the following program with libmysqld (5.0.91), and it is crashing on the mysql_library_end(); call with

Program terminated with signal 11, Segmentation fault.
#0 0x000000000058fbcd in innobase_release_stat_resources (trx=0xcdcdcdcdcdcdcdcd) at third_party/mysql50/sql/
394 if (trx->has_search_latch) {
(gdb) bt
#0 0x000000000058fbcd in innobase_release_stat_resources (trx=0xcdcdcdcdcdcdcdcd) at third_party/mysql50/sql/
#1 0x0000000000584ebc in innobase_release_temporary_latches (thd=0x7f5e7f850418) at third_party/mysql50/sql/
#2 0x0000000000587244 in ha_innobase::close (this=0x7f5e84159b60) at third_party/mysql50/sql/
#3 0x0000000000713b33 in closefrm (table=0x7f5e8415da18) at third_party/mysql50/sql/
#4 0x000000000060f446 in intern_close_table (table=0x7f5e8415da18) at third_party/mysql50/sql/
#5 0x000000000060f465 in free_cache_entry (table=0x7f5e8415da18) at third_party/mysql50/sql/
#6 0x0000000000744357 in hash_delete (hash=0xe11020, record=0x7f5e8415da18 "\340\341\025\204^\177")
at third_party/mysql50/mysys/hash.c:539
#7 0x000000000060f58e in close_cached_tables (thd=0x0, if_wait_for_refresh=false, tables=0x0) at third_party/mysql50/sql/
#8 0x000000000060f009 in table_cache_free () at third_party/mysql50/sql/
#9 0x0000000000573fa9 in clean_up (print_message=false) at third_party/mysql50/libmysqld/../sql/
#10 0x000000000057986a in end_embedded_server () at third_party/mysql50/libmysqld/
#11 0x000000000056ab96 in mysql_server_end () at third_party/mysql50/libmysqld/libmysql.c:202
#12 0x000000000056aa3f in main (argc=6, argv=0x7fffc184a9b8) at storage/speckle/server/mysql/

static MYSQL* Connect(const char* database) {
MYSQL* db = mysql_init(NULL);
assert(db != NULL);
assert(db == mysql_real_connect(db, NULL, "mysql_test", NULL, database,
0, NULL, 0));
mysql_autocommit(db, true);
return db;

int main(int argc, char* argv[]) {
assert(0 == mysql_library_init(argc, argv, 0));
assert(1 == mysql_thread_safe());
assert(0 == mysql_thread_init());

// Create the database.
MYSQL* db = Connect(NULL);
assert(0 == mysql_query(db, "create database if not exists d"));

// Open a connection to the new database.
MYSQL* db = Connect("d");

// Create the table.
assert(0 == mysql_query(
db, "create table if not exists t (i integer) engine=innodb"));
assert(0 == mysql_query(db, "insert into t values (1);"));

Any idea what's going on?



Options: ReplyQuote

Written By
crash with libmysqld
October 21, 2010 03:55PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.