From: Liu, Y. <Yig...@an...> - 2004-08-10 14:23:04
|
Hi Jonathan, Thanks for your reply. It happens during connection setup. I added a pair of printout statements before and after each line in the code. Here are what I got: bash-2.03$ ./simple1 before mysqlcppapi::Connection con;... after mysqlcppapi::Connection con;... before con.connect();... Bus Error (core dumped) bash-2.03$ And I got the stack trace here: #0 0xff0422f0 in _free_unlocked () from /usr/lib/libc.so.1 (gdb) bt #0 0xff0422f0 in _free_unlocked () from /usr/lib/libc.so.1 #1 0xff0422a8 in free () from /usr/lib/libc.so.1 #2 0xff307490 in mysql_close () from /usr/local/lib/libmysqlclient.so.10 (gdb) q And exception handling works for my c++ program. I can throw and catch exceptions. Thanks a lot for your kind help! Yigong -----Original Message----- From: Jonathan Wakely [mailto:co...@co...]=20 Sent: Tuesday, August 10, 2004 7:36 AM To: Liu, Yigong Cc: mys...@li... Subject: Re: [Mysqlcppapi-main] where to find libmysqlclient.so for Solaris 2.8 with gcc 3.3 On Thu, Aug 05, 2004 at 11:16:43AM -0400, Liu, Yigong wrote: > Hi there, hi again, yigong > Thanks for the reply. >=20 > Another question, I tried simple1 (the first example) and I have no > database server running locally, so it fails. However, it will crash the > whole program, not close down gracely. I check simple1.cc, although > there are catch statement for exceptions and I also add catch(...) to > catch all other exceptions, it still crashes. Does exception-handling > work in mysqlcppapi? It works for me - if the connection is not opened an exception is thrown and caught by the first catch() block. Have you debugged the program to see where the crash is? It could be before the exception is even thrown, or it could be a problem with exception-handling in your environment. If you can send a stacktrace I might be able to figure it out. jon --=20 "Nothing is true. Everything is permissible." - Hassan i Sabbah ---------------------------------------------------------------------------= --------------------- This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. =20 If you have received it in error, please notify the sender immediately and delete the original. Any unauthorized use of this email is prohibited. ---------------------------------------------------------------------------= --------------------- [mf2] |