List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:June 17 2006 2:10am
Subject:Re: Destructor of the Connection fails
View as plain text  
mazah_82@stripped wrote:
> It crashes in the line "con.close()". GDB tells me the following story:
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000039d1068b85 in free () from /lib64/tls/

You're going to have to debug it more deeply than that to tell anyone 
something useful.  At the very least, we need a backtrace.

Try this modified program instead:

#include <mysql++.h>
#include <iostream>

using namespace std;
using namespace mysqlpp;

main(int argc, char *argv[])
     try {
         Connection con(use_exceptions);
         con.connect("db", "localhost", "user, "pass");
         if (!con.connected()) {
             cout << "Can't connect!" << endl;
             return 1;
         cout << "Closing connection.." << endl;
         cout << "Exiting.." << endl;
     catch (exception& e) {
         cout << "Exception caught: " << e.what() << endl;

     return 0;

Notice how it catches exceptions.  Your symptom could just be caused by 
an uncaught exception.
Destructor of the Connection failsmazah_8215 Jun
Re: Destructor of the Connection failsmazah_8216 Jun
  • Re: Destructor of the Connection failsWarren Young17 Jun
Re: Destructor of the Connection failsmazah_8219 Jun
  • Re: Destructor of the Connection failsWarren Young19 Jun