Bug #64380 Conflict between Connector c++ and Boost 1.48.0 causing run failure
Submitted: 20 Feb 2012 14:44 Modified: 22 Nov 2022 19:49
Reporter: Joseph Cameron Email Updates:
Status: Won't fix Impact on me:
None 
Category:Connector / C++ Severity:S3 (Non-critical)
Version:1.1.0 OS:Linux (Debian 6)
Assigned to: CPU Architecture:Any
Tags: boost, connector, glibc detected

[20 Feb 2012 14:44] Joseph Cameron
Description:
75 views on forum and no help.

Must be a bug.

http://forums.mysql.com/read.php?167,515751,515751#msg-515751

Read that this was a problem relating to OO.o, but I am not using it. 

*** glibc detected *** /home/gdmps/NetBeansProjects/SymbolHistory/dist/Debug/GNU-Linux-x86/symbolhistory: free(): invalid pointer: 0x09ab92b8 *** 

--------------------------------------------------------------- 
This error is printed whenever I am accessing both mysql thru the connector and using the boost function: to_iso_extended_string(d). ( It still prints correct date, then bombs ). 

How to repeat:
in my case use Connect c++ binary and boost 1.48.0.
 
link to lib libmysqlcppconn.so.5.1.1.0 and boost.

Use boost function 'to_iso_extended_string'

see link for further details.
[20 Feb 2012 18:58] Sveta Smirnova
Thank you for the report.

Could you please provide complete test case demonstrating the problem?
[20 Feb 2012 20:16] Joseph Cameron
This is all that is required.
Just force a reference to connector c++

/* 
 * File:   main.cpp
 * Author: gdmps
 *
 * Created on February 13, 2012, 6:23 AM
 */

#include <cstdlib>
#include <stdlib.h>
#include <iostream>
#include <fstream>
//#include <string>

#include <boost/algorithm/string.hpp>
#include "boost/date_time.hpp"
#include "boost/date_time/gregorian/gregorian.hpp"

/* MySQL Connector/C++ specific headers */
#include <cppconn/driver.h>
#include <cppconn/connection.h>
#include <cppconn/statement.h>
#include <cppconn/prepared_statement.h>
#include <cppconn/resultset.h>
#include <cppconn/metadata.h>
#include <cppconn/resultset_metadata.h>
#include <cppconn/exception.h>
#include <cppconn/warning.h>

using namespace std;
using namespace sql;
using namespace boost::gregorian;

/*
 * 
 */

int main(int argc, char** argv) {
    
    bool new_db = true;
    bool verbose = true;
    bool update;
    int index;
    string start_date;

    Driver *driver;
	Connection *con;
	Statement *stmt;
	ResultSet *res;
	PreparedStatement *prep_stmt;
	Savepoint *savept;

    
    // Create history database tables "YYYY-mm".
    months single(1);
    date work_date(from_simple_string( "2000-01-01" ));
    date end_date = day_clock::local_day();

    std::string table_date;
    table_date = to_iso_extended_string( work_date );
    table_date = table_date.substr( 0, 7 );
    cout << "table_date: " << table_date << endl;

    return 0;
}
--------------------------
*** glibc detected *** /home/gdmps/NetBeansProjects/testboost/dist/Debug/GNU-Linux-x86/testboost: free(): invalid pointer: 0x08a5a288 ***
======= Backtrace: =========
/lib/libc.so.6(+0x6b19a)[0xb730419a]
/lib/libc.so.6(+0x6c9e8)[0xb73059e8]
/lib/libc.so.6(cfree+0x6d)[0xb7308b2d]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0xb74dd701]
/usr/lib/libstdc++.so.6(_ZNSs4_Rep10_M_destroyERKSaIcE+0x1d)[0xb74b96bd]
/usr/lib/libstdc++.so.6(_ZNSs6assignERKSs+0xa0)[0xb74bb1d0]
/usr/lib/libstdc++.so.6(_ZNSsaSERKSs+0x24)[0xb74bb234]
/home/gdmps/NetBeansProjects/testboost/dist/Debug/GNU-Linux-x86/testboost[0x804b17a]
/lib/libc.so.6(__libc_start_main+0xe6)[0xb72afc96]
/home/gdmps/NetBeansProjects/testboost/dist/Debug/GNU-Linux-x86/testboost[0x804af81]
======= Memory map: ========
08048000-08055000 r-xp 00000000 08:01 270821     /home/gdmps/NetBeansProjects/testboost/dist/Debug/GNU-Linux-x86/testboost
08055000-08056000 rw-p 0000c000 08:01 270821     /home/gdmps/NetBeansProjects/testboost/dist/Debug/GNU-Linux-x86/testboost
08a5a000-08a7b000 rw-p 00000000 00:00 0          [heap]
b7000000-b7021000 rw-p 00000000 00:00 0 
b7021000-b7100000 ---p 00000000 00:00 0 
b7171000-b7173000 rw-p 00000000 00:00 0 
b7173000-b7223000 r-xp 00000000 08:01 323812     /usr/lib/libstdc++.so.5.0.7
b7223000-b7228000 rw-p 000af000 08:01 323812     /usr/lib/libstdc++.so.5.0.7
b7228000-b722d000 rw-p 00000000 00:00 0 
b722d000-b7240000 r-xp 00000000 08:01 360455     /lib/libnsl-2.11.3.so
b7240000-b7241000 r--p 00012000 08:01 360455     /lib/libnsl-2.11.3.so
b7241000-b7242000 rw-p 00013000 08:01 360455     /lib/libnsl-2.11.3.so
b7242000-b7244000 rw-p 00000000 00:00 0 
b7244000-b724d000 r-xp 00000000 08:01 360456     /lib/libcrypt-2.11.3.so
b724d000-b724e000 r--p 00008000 08:01 360456     /lib/libcrypt-2.11.3.so
b724e000-b724f000 rw-p 00009000 08:01 360456     /lib/libcrypt-2.11.3.so
b724f000-b7277000 rw-p 00000000 00:00 0 
b7277000-b727e000 r-xp 00000000 08:01 360470     /lib/librt-2.11.3.so
b727e000-b727f000 r--p 00006000 08:01 360470     /lib/librt-2.11.3.so
b727f000-b7280000 rw-p 00007000 08:01 360470     /lib/librt-2.11.3.so
b7280000-b7294000 r-xp 00000000 08:01 360461     /lib/libpthread-2.11.3.so
b7294000-b7295000 ---p 00014000 08:01 360461     /lib/libpthread-2.11.3.so
b7295000-b7296000 r--p 00014000 08:01 360461     /lib/libpthread-2.11.3.so
b7296000-b7297000 rw-p 00015000 08:01 360461     /lib/libpthread-2.11.3.so
b7297000-b7299000 rw-p 00000000 00:00 0 
b7299000-b73d7000 r-xp 00000000 08:01 360471     /lib/libc-2.11.3.so
b73d7000-b73d8000 ---p 0013e000 08:01 360471     /lib/libc-2.11.3.so
b73d8000-b73da000 r--p 0013e000 08:01 360471     /lib/libc-2.11.3.so
b73da000-b73db000 rw-p 00140000 08:01 360471     /lib/libc-2.11.3.so
b73db000-b73de000 rw-p 00000000 00:00 0 
b73de000-b73fb000 r-xp 00000000 08:01 360451     /lib/libgcc_s.so.1
b73fb000-b73fc000 rw-p 0001c000 08:01 360451     /lib/libgcc_s.so.1
b73fc000-b7420000 r-xp 00000000 08:01 360453     /lib/libm-2.11.3.so
b7420000-b7421000 r--p 00023000 08:01 360453     /li
b/libm-2.11.3.so
b7421000-b7422000 rw-p 00024000 08:01 360453     /lib/libm-2.11.3.so
b7422000-b750b000 r-xp 00000000 08:01 280858     /usr/lib/libstdc++.so.6.0.13
b750b000-b750f000 r--p 000e9000 08:01 280858     /usr/lib/libstdc++.so.6.0.13
b750f000-b7510000 rw-p 000ed000 08:01 280858     /usr/lib/libstdc++.so.6.0.13
b7510000-b7518000 rw-p 00000000 00:00 0 
b7528000-b778a000 r-xp 00000000 08:01 257691     /usr/mysql-connector-c++-1.1.0/lib/libmysqlcppconn.so.5.1.1.0
b778a000-b77c9000 rw-p 00261000 08:01 257691     /usr/mysql-connector-c++-1.1.0/lib/libmysqlcppconn.so.5.1.1.0
b77c9000-b77ca000 rw-p 00000000 00:00 0 
b77ca000-b77d8000 r-xp 00000000 08:01 201938     /usr/boost_1_48_0/stage/lib/libboost_date_time.so.1.48.0
b77d8000-b77d9000 rw-p 0000d000 08:01 201938     /usr/boost_1_48_0/stage/lib/libboost_date_time.so.1.48.0
b77d9000-b77db000 rw-p 00000000 00:00 0 
b77db000-b77dc000 r-xp 00000000 00:00 0          [vdso]
b77dc000-b77f7000 r-xp 00000000 08:01 360464     /lib/ld-2.11.3.so
b77f7000-RUN FAILED (exit value 1, total time: 150ms)
[20 Feb 2012 20:52] Sveta Smirnova
Thank you for the feedback.

I can not repeat described behavior:

[sveta@delly bugs]$ g++ bug64380.cpp -o bug64380  -I/home/sveta/build/mysql-connector-c++-1.1.0/include -L/home/sveta/build/mysql-connector-c++-1.1.0/lib -lboost_date_time
[sveta@delly bugs]$ ./bug64380
table_date: 2000-01
[sveta@delly bugs]$ 

So looks like this is environment-specific. Please indicate exact package name of Connector/C++ you use (file name you downloaded), boost version and specify your platform details.
[20 Feb 2012 21:38] Joseph Cameron
Win Vista running -

Oracle Vitual Box - Ver: 4.1.8r75457

Guest -
Debian release 6.0.4
Kernal Linux 2.6.32-5-686
Mem 2.0gb
Proc AMD Athlon II X2 245 proc.

NetBeans 7.1

From
http://dev.mysql.com/downloads/connector/cpp/#downloads
mysql-connector-c++-1.1.0-linux-glibc2.3-x86-32bit.tar.gz

From http://sourceforge.net/projects/boost/files/boost/1.48.0/boost_1_48_0.tar.gz/
boost_1_48_0.tar.gz ( self built, defaults )

Linking to:
boost_date_time
libmysqlcppconn.so (short cut to) libmysqlcppconn.so.5.1.1.0

===
dont know what else to give you.
[21 Feb 2012 20:00] Sveta Smirnova
Thank you for the feedback.

Verified as described on Debian. Not repeatable with self-compiled package on Oracle Linux.

I did typo in my description of how-to-repeat:

[sveta@delly bugs]$ g++ bug64380.cpp -o bug64380 -I/home/sveta/build/mysql-connector-c++-1.1.0/include -L/home/sveta/build/mysql-connector-c++-1.1.0/lib -lboost_date_time -lmysqlcppconn
[22 Feb 2012 17:11] Joseph Cameron
Also have the same error when running under VMware Player.
[9 Jan 2015 11:51] Hemant Dangi
Not able to reproduce with C/C++ 1.1.5 on Debian 6 and 7.
[16 Jan 2015 11:56] Hemant Dangi
Joseph,
Can you please verify if this is still a issue on newer C/C++ releases?
[17 Feb 2015 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[22 Nov 2022 19:49] Luis Silva
Posted by developer:
 
Can't be replicated using recent builds.
Closing it.