Opened 15 years ago

Closed 15 years ago

Last modified 6 years ago

#56 closed defect (fixed)

On x86-64, libmysql segfaults if mysql_real_connect is called after mysql_options

Reported by: rainer Owned by: rainer
Priority: major Milestone: 2.3.3
Component: main Version: 2.3.2
Keywords: Cc:

Description

There is a segfault in the libmysql library (tested: 4.1.15-1ubuntu5) on x86-64 if mysql_real_connect() is called after mysql_options(). The segfault is within mysql_real_connect(). As a result, yule will not startup on x86-64 if compiled with mysql support.

Backtrace:

#0  0x00002aaaaaf12d30 in unpack_dirname () from /usr/lib/libmysqlclient.so.14
#1  0x00002aaaaaf14a33 in fn_format () from /usr/lib/libmysqlclient.so.14
#2  0x00002aaaaaf15cbc in free_defaults () from /usr/lib/libmysqlclient.so.14
#3  0x00002aaaaaf1656f in free_defaults () from /usr/lib/libmysqlclient.so.14
#4  0x00002aaaaaf16a0a in load_defaults () from /usr/lib/libmysqlclient.so.14
#5  0x00002aaaaaf31130 in mysql_read_default_options () from /usr/lib/libmysqlclient.so.14
#6  0x00002aaaaaf314f3 in mysql_real_connect () from /usr/lib/libmysqlclient.so.14
#7  0x000000000042cf5c in sh_database_entry (db_entry=0x56aee0, id=<value optimized out>) at x_sh_database.c:1107
...

Probably mysql_options() should be avoided on x86-64 (?).

Change History (2)

comment:1 Changed 15 years ago by rainer

A search on Google indicates that this problem has existed in earlier versions of libmysql as well, though apparently not specific to the x86-64 architecture.

The problem can be fixed by deleting or commenting out in src/sh_database.c the line:

 mysql_options(db_conn, MYSQL_READ_DEFAULT_GROUP, _("samhain"));

comment:2 Changed 15 years ago by rainer

Resolution: fixed
Status: newclosed

Fixed in changeset [97] (don't use mysql_options on x86-64).

Note: See TracTickets for help on using tickets.