dbTalk Databases Forums  

I am crashing once in a while @ similar points (multi threading)

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss I am crashing once in a while @ similar points (multi threading) in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ankur G35 Saxena
 
Posts: n/a

Default I am crashing once in a while @ similar points (multi threading) - 09-28-2006 , 07:02 PM






Hi

I have a program which uses multiple threads, each thread has its
own connection object, so no sharing is happening there. Now I have a
library called DBAccess which is basically all the functions I need to
run, these functions use char* as their parameters and I have
istringstream objects where i am creating queries and passing my
function as instance.str().c_str(). Anyhow When I get from a row I do
, string x = row["field"].get_string(). These are the only things I
do, I dont know if I am doing anything wrong, but here is the gdb
output, but i cant figure what it is saying about the MySQL++ lib.

Thanks for any help.

(gdb) bt
#0 0x4025e276 in std::__default_alloc_template<true, 0>::allocate(unsigned) ()
from /usr/lib/libstdc++.so.5
#1 0x402642a8 in std::string::_Rep::_S_create(unsigned,
std::allocator<char> const&) () from /usr/lib/libstdc++.so.5
#2 0x402643d9 in std::string::_Rep::_M_clone(std::allocator<char>
const&, unsigned) () from /usr/lib/libstdc++.so.5
#3 0x40260e3d in std::string::_Rep::_M_grab(std::allocator<char>
const&, std::allocator<char> const&) () from /usr/lib/libstdc++.so.5
#4 0x40260f4c in std::string::string(std::string const&) ()
from /usr/lib/libstdc++.so.5
#5 0x40056e8b in mysqlpp::FieldNames::init(mysqlpp::ResUse const*) (
this=0x8113338, res=0x412add4c) at basic_string.h:187
#6 0x4006149b in ResUse (this=0x412add4c, result=0x8152008, c=0x0)
at field_names.h:51
#7 0x4005ea9a in mysqlpp::Query::store(char const*) (this=0x412add7c,
str=0x810196c "SELECT * FROM CommunityInfo.MSProfile WHERE
IMSI='8479697785'") at result.h:358
#8 0x4005ed32 in mysqlpp::Query::store(mysqlpp::SQLQueryParms&) (
this=0x412add7c, p=@0x412add90) at basic_string.h:781
#9 0x0809deb2 in DBAccess::runGetSql(char*, mysqlpp::Result*, LogEntry*) (
this=0x8120c1c,
querystr=0x412adf8c "SELECT * FROM CommunityInfo.MSProfile WHERE
IMSI='8479697785'", resSet=0x412adf5c, Log=0x412ae52c) at query.h:309
---Type <return> to continue, or q <return> to quit---
#10 0x080b1966 in DBAccess::getMSProfile(char*, unsigned short,
MSProfile*, LogEntry*) (this=0x8120c1c, imsi=0x8123aa4 "8479697785",
state=6,
profile=0x8152a00, Log=0x412ae52c) at Features.cpp:296
#11 0x080a11cb in DBAccess::findNumber(char*, char, char*,
RegisteredMS*, char, LogEntry*) (this=0x8120c1c, search_str=0x8152750
"8479697785",
field_type=2 '\002', equip_id=0x8152770 "", regMS=0x81529e8,
run_mask=25 '\031', Log=0x412ae52c) at basic_string.h:781
#12 0x08076cc8 in MsgProcessor:rocess_MSC_Auth_Req(CcAAAAuthReqMsg *,
sockaddr_in*) (this=0x8120c1c, msg=0x8152748, replyTo=0x8152b10)
at MsgProcessor-Recv-MSC.cpp:550
#13 0x0805d721 in InSysController::handleRequest(char*, int, sockaddr_in*) (
this=0x8120c1c, m=0x8152748 "\f\016,\001\001", len=1, fromwho=0x8152b10)
at InSysController.cpp:58
#14 0x0805d4c3 in InSysController::OnThreadMessage(int, int, void*) (
this=0x8120ab8, id=0, wParam=0, lParam=0x8152b08) at InSysController.cpp:18
#15 0x080970cd in ZThread::Run() (this=0x8120ab8) at zthread.cc:239
#16 0x08096859 in Thread_Entry_Func(void*) (arg=0x8120ab8) at zthread.cc:22
#17 0x401a62b6 in start_thread () from /lib/tls/libpthread.so.0
(gdb)



Anyone know why this might be?

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: I am crashing once in a while @ similar points (multi threading) - 09-29-2006 , 04:04 PM






Ankur G35 Saxena wrote:
Quote:
(gdb) bt
#0 0x4025e276 in std::__default_alloc_template<true,
0>::allocate(unsigned) ()
from /usr/lib/libstdc++.so.5
#1 0x402642a8 in std::string::_Rep::_S_create(unsigned,
std::allocator<char> const&) () from /usr/lib/libstdc++.so.5
#2 0x402643d9 in std::string::_Rep::_M_clone(std::allocator<char
const&, unsigned) () from /usr/lib/libstdc++.so.5
#3 0x40260e3d in std::string::_Rep::_M_grab(std::allocator<char
const&, std::allocator<char> const&) () from /usr/lib/libstdc++.so.5
#4 0x40260f4c in std::string::string(std::string const&) ()
from /usr/lib/libstdc++.so.5
It's clearly crashing deep in the Standard C++ library, not in MySQL++.
Therefore, either some piece of code corrupted it earlier, or it has a
thread bug of its own.

At this point, I would make sure that your program and _all_ of the
libraries it uses are built with thread-awareness. If you find no
problems there, run it under valgrind...hopefully you can catch this
problem at an earlier stage, instead of chasing secondary damage.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.