Bug #2170 MySQL Connector/C++ crashes while reading the my.cnf
Submitted: 19 Dec 2003 5:28 Modified: 19 Dec 2003 8:10
Reporter: René Möhring Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL++ Severity:S2 (Serious)
Version:1.7.9 OS:Linux (Linux Redhat 7.2)
Assigned to: Sinisa Milivojevic CPU Architecture:Any

[19 Dec 2003 5:28] René Möhring
Description:
Applications linked to the C++ API of MySQL crash when trying to read the client section in the my.cnf. Below is backtrace given by gdb.

(gdb) bt
#0  0x40053920 in strcend () at string_util.cc:48
#1  0x4004a15e in mysql_read_default_options () at string_util.cc:48
#2  0x4004a9dc in mysql_real_connect () at string_util.cc:48
#3  0x40037b7b in MysqlConnection::connect (this=0xbffff4d8, db=0x8065ed8 "mysql", host=0x8065ef8 "localhost", user=0x8065e58 "acd", 
    passwd=0x8065e98 "14juni") at connection.cc:96

Without this section there is no problem.

How to repeat:
Just copy for example my-huge.cnf to /etc/my.cnf and try to read something from the database with an application linked to the C++ API.
[19 Dec 2003 6:51] Sinisa Milivojevic
I tried and it worked.

What compiler and version are you using ???
[19 Dec 2003 7:23] René Möhring
I used gcc-2.96.
[19 Dec 2003 8:10] Sinisa Milivojevic
Sorry, but as MySQL++ documentation points out, GCC 2.96 is not supported
and was not supported.

As you may be aware of, Red Hat has meanwhile shifted to GCC 3.*, which is
fully supported on MySQL++.

You can see on MySQL++ page patches for many GCC 3.* versions.