List:MySQL++« Previous MessageNext Message »
From:Sebastien Darveau Date:February 7 2012 9:49pm
Subject:RE: Segmentation Fault after upgrading to MySQL 5.5
View as plain text  
Looks like it was already ignored.  This was just gdb stopping on the signal.

Please see other errors below, those are segmentation faults.

Thanks,
Sebastien

-----Original Message-----
From: Dino Korah [mailto:dino.korah@stripped] 
Sent: 7 février 2012 14:59
To: Sebastien Darveau; plusplus@stripped
Subject: RE: Segmentation Fault after upgrading to MySQL 5.5

Hi Sebastien,

Thread [16] 26141 (Suspended : Signal : SIGPIPE:Broken pipe)


That says a lot; your application should suppress/ignore SIGPIPE.
The way to do it is to add a dummy signal handler, when you startup in main().

- dk



________________________________________
From: Sebastien Darveau [SDarveau@stripped]
Sent: 07 February 2012 19:09
To: plusplus@stripped
Subject: RE: Segmentation Fault after upgrading to MySQL 5.5

I don't know if this is related but it's very easy to reproduce. Getting a connection from
a connection pool when mysql server has been shut down.  I get this:

Thread [16] 26141 (Suspended : Signal : SIGPIPE:Broken pipe)
        __kernel_vsyscall() at 0x772402
        write() at 0x48f08b
        vio_write() at viosocket.c:122 0xf19fab
        net_real_write() at net_serv.cc:632 0xf06ebb
        net_flush() at net_serv.cc:338 0xf07328
        net_write_command() at net_serv.cc:478 0xf074a3
        cli_advanced_command() at client.c:841 0xf045b6
        mysql_close() at client.c:3,740 0xf01643
        mysqlpp::DBDriver::disconnect() at dbdriver.cpp:143 0x3968b1
        mysqlpp::Connection::disconnect() at connection.cpp:155 0x39201a
        ~Connection() at connection.cpp:66 0x392060
        SimpleConnectionPool::destroy() at SimpleConnectionPool.cpp:46 0xe91a6c
        mysqlpp::ConnectionPool::remove() at cpool.cpp:187 0x394b44
        mysqlpp::ConnectionPool::remove_old_connections() at cpool.cpp:202 0x394c6c
        mysqlpp::ConnectionPool::grab() at cpool.cpp:129 0x394ed3
        SimpleConnectionPool::GetConnection() at SimpleConnectionPool.cpp:21 0xe91d90

Steps to reproduce:
        - grab a connection from the pool
        - stop mysql server
        - grab another connection from the pool

No exception are thrown, the program crashes.

Is this specific to version 3.1.0? Or can it be the same problem as the one mentioned
here:
http://grokbase.com/p/mysql/plusplus/119kb0gk0w/fixing-3-1-0-abi-breakage-re-problems-with-storein-and-template-queries

?

Thanks,
Sébastien Darveau


-----Original Message-----
From: Sebastien Darveau [mailto:SDarveau@stripped]
Sent: 6 février 2012 11:51
To: plusplus@stripped
Subject: Segmentation Fault after upgrading to MySQL 5.5

Hello,

I have recently upgraded from MySQL 5.0.77 to 5.5 and a few of my servers where the
program runs full time have crashed with a segmentation fault.  It takes some days to
happen and the multi-threaded program is running optimized in production environments so
I don't have a lot of information and it's hard to debug.

Is there a known incompatibility with newer versions of MySQL?

I've recompiled mysql++ 3.1.0 to link with libmysqlclient.so.18 and also recompiled my
program. All my threads are using:
mysqlpp::Connection::thread_start();

Interesting fact, MySQL 5.5 does not use a separated libmysqlclient_r.so library anymore
and the problem looks like a thread safety issue.

I can see that in all cases, it happened in mysqlpp object's destructor (double delete?):

Server 1
---------
2012-02-06 05:56:15: [ERROR] Query error: Lost connection to MySQL server during query
2012-02-06 05:56:16: [ERROR]  1: 0x2b3f35e39a67 <+47550487042663>
(/usr/lib64/libmysqlclient.so.18)
2012-02-06 05:56:16: [ERROR]  2: 0x2b3f35e39e34 <my_net_read+420>
(/usr/lib64/libmysqlclient.so.18)
2012-02-06 05:56:16: [ERROR]  3: 0x2b3f35e33d8a <cli_safe_read+42>
(/usr/lib64/libmysqlclient.so.18)
2012-02-06 05:56:16: [ERROR]  4: 0x2b3f35e344f7 <+47550487020791>
(/usr/lib64/libmysqlclient.so.18)
2012-02-06 05:56:16: [ERROR]  5: 0x2b3f35e31ce6 <mysql_real_query+38>
(/usr/lib64/libmysqlclient.so.18)
2012-02-06 05:56:16: [ERROR]  6: 0x2b3f34f6fdab <mysqlpp::Query::use(char const*,
unsigned long)+123> (/usr/lib64/libmysqlpp.so.3)
2012-02-06 05:56:16: [ERROR]  7: 0x9bf238 <vtable for mysqlpp::Query+56>
(bin/GalaxieAudioEngine)
2012-02-06 05:56:16: [ERROR]  8: 0x563b60 <mysqlpp::Query::~Query()+0>
(bin/GalaxieAudioEngine)
2012-02-06 05:56:16: [ERROR] End of stack trace.

Server 2
---------
2012-02-04 02:35:25: [ERROR]  1: 0x2b57d6e9754d
<mysqlpp::Connection::~Connection()+45> (/usr/lib64/libmysqlpp.so.3)

Server 3
----------
2012-02-06 06:25:10: [ERROR]  1: 0x2b9634aaf185 <mysqlpp::DBDriver::~DBDriver()+85>
(/usr/lib64/libmysqlpp.so.3)


I use CentOS 5.6.

Thanks,
Sebastien Darveau

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:    http://lists.mysql.com/plusplus


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:    http://lists.mysql.com/plusplus

Thread
Segmentation Fault after upgrading to MySQL 5.5Sebastien Darveau6 Feb
  • RE: Segmentation Fault after upgrading to MySQL 5.5Sebastien Darveau7 Feb
    • RE: Segmentation Fault after upgrading to MySQL 5.5Dino Korah7 Feb
      • RE: Segmentation Fault after upgrading to MySQL 5.5Sebastien Darveau7 Feb
    • Re: Segmentation Fault after upgrading to MySQL 5.5Warren Young9 Feb