List:MySQL++« Previous MessageNext Message »
From:Chris Frey Date:February 12 2005 7:58pm
Subject:Re: mysql++1.7.28 core dumps on solaris
View as plain text  
I think this is a bug in the resetdb.cpp example, where it doesn't turn
off exceptions inside the catch() handler.

Check the permissions of your login in your mysql database.  The crash
occurs because it can't select (and probably can't create) the sample
database, so I'm guessing it is a permission issue.

Below is a quick untested patch that should avoid the coredump, to give
an idea where the problem is.

- Chris

diff -u resetdb.cpp resetdb.cpp
--- resetdb.cpp 10 Dec 2004 01:00:35 -0000      1.1.1.1
+++ resetdb.cpp 12 Feb 2005 19:58:08 -0000
@@ -20,6 +20,12 @@
                        con.select_db(kpcSampleDatabase);
                }
                catch (mysqlpp::BadQuery &) {
+                       mysqlpp::Connection con(!mysqlpp::use_exceptions);
+                       if (!connect_to_db(argc, argv, con, "")) {
+                               cerr << "Failed to connect to sample database."
<< endl;
+                               return 1;
+                       }
+
                        // Couldn't switch to the sample database, so assume that it
                        // doesn't exist and create it.  If that doesn't work, exit
                        // with an error.
c


On Sat, Feb 12, 2005 at 01:34:09PM -0500, Alex Vishnev wrote:
> Hello,
> 
> I am using Solaris 2.8(32bit) with MySql-Standard 4.0.23 and mysql++.1.7.28.
> GCC version is 3.3.2. When I am running any of the examples application,  I
> get a core dump (trace below).mysql++ was recompiled from source using
> 4.0.23 include/lib references. Compilation did not produce any errors.
> 
> 
> #0  0xff09c4ac in _libc_kill () from /lib/libc.so.1
> #1  0xff035a84 in abort () from /lib/libc.so.1
> #2  0xff161acc in __cxxabiv1::__terminate (handler=0xff03597c <abort>) at
> ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:47
> #3  0xff161b04 in std::terminate () at
> ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:57
> #4  0xff161c74 in __cxa_throw (obj=0x2d340, tinfo=0x1af3c, dest=0x19b94
> <mysqlpp::BadQuery::~BadQuery()>)
>     at ../../../../libstdc++-v3/libsupc++/eh_throw.cc:80
> #5  0xff3288c4 in mysqlpp::Connection::select_db (this=0x0, db=0x1af3c "")
> at /usr/local/include/c++/3.3.2/bits/stl_alloc.h:652
> #6  0x00013b88 in main (argc=1, argv=0xffbef774) at resetdb.cpp:22
> (gdb)
> 
> Sincerely,
> 
> Alex
> 
> 
> 
> 
> -- 
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:    http://lists.mysql.com/plusplus?unsub=1
Thread
mysql++1.7.28 core dumps on solarisAlex Vishnev12 Feb
  • Re: mysql++1.7.28 core dumps on solarisChris Frey12 Feb
    • RE: mysql++1.7.28 core dumps on solarisAlex Vishnev12 Feb
      • Re: mysql++1.7.28 core dumps on solarisChris Frey13 Feb
        • RE: mysql++1.7.28 core dumps on solarisAlex Vishnev14 Feb
          • Re: mysql++1.7.28 core dumps on solarisWarren Young14 Feb
    • Re: mysql++1.7.28 core dumps on solarisWarren Young14 Feb
  • Re: mysql++1.7.28 core dumps on solarisWarren Young14 Feb
    • RE: mysql++1.7.28 core dumps on solarisAlex Vishnev14 Feb
      • Re: mysql++1.7.28 core dumps on solarisWarren Young14 Feb
        • mysql++1.7.28 thread safetyAlex Vishnev14 Feb
          • Re: mysql++1.7.28 thread safetyEarl Miles14 Feb
            • Re: mysql++1.7.28 thread safetyWarren Young14 Feb
              • Re: mysql++1.7.28 thread safetyEarl Miles14 Feb
              • RE: mysql++1.7.28 thread safetyAlex Vishnev15 Feb
                • Re: mysql++1.7.28 thread safetyWarren Young16 Feb