5 messages in com.mysql.lists.plusplusRe: mysql connection close segmentati...
FromSent OnAttachments
Calin Vaida21 Sep 2004 08:42 
Chris Frey21 Sep 2004 09:15 
Warren Young21 Sep 2004 12:24 
Calin Vaida22 Sep 2004 01:03 
Calin Vaida22 Sep 2004 01:10 
Subject:Re: mysql connection close segmentation fault problem
From:Chris Frey (cdf@netdirect.ca)
Date:09/21/2004 09:15:23 AM
List:com.mysql.lists.plusplus

On Tue, Sep 21, 2004 at 06:43:00PM +0300, Calin Vaida wrote:

All have worked ok until i switch the sistem and the mysql++ driver to a new one. So my problem appear for the same application but running on a suse 9.1 with mysql++1.7.17 and using mysql-client-4.0.18-32 (that is the default on the suse 9.1 I guess). The problem appear when the mysql connection is closed and my whole application crash with SEG fault. The interesting thing is that on my sistem (suse 8.1) the same application with the mysql++1.7.17 is working properly.

Odd that mysql_close() seems to be called twice in the backtrace you posted.

Anyway, did you compile mysql++ fresh on each system, or use the RPM's? If you used the RPM, it might be worth trying compiling it from source to make sure it is not a compiler incompatibility between different versions of SuSe.

I found the sample code below at: http://bugs.mysql.com/bug.php?id=1424 If it really is a C lib bug, it should show up with this code.

- Chris

#include <mysql.h> #include <stdio.h>

int main() { int rc; int i; MYSQL *mysql;

mysql_server_init(0, NULL, NULL);

mysql = mysql_init(NULL); if (mysql_real_connect(mysql, NULL, NULL, NULL, "", 0, NULL, 0) == NULL) { printf("error\n"); } if (mysql_errno(mysql)) { printf("Error 1: %s\n", mysql_error(mysql)); mysql_close(mysql); exit(-1); } mysql_close(mysql); mysql_server_end(); }