List:MySQL++« Previous MessageNext Message »
From:Graham Reitz Date:November 24 2007 4:32am
Subject:Re: Application hangs at Result call to at()...
View as plain text  
Here is the call stack:

#0	0x9264e47a in __kill
#1	0x9264e46d in kill$UNIX2003
#2	0x926c5782 in raise
#3	0x926d4d3f in abort
#4	0x00084537 in __gnu_debug::_Error_formatter::_M_error at debug.cc:504
#5	0x000533a5 in std::copy<__gnu_norm::_Bit_const_iterator,  
__gnu_norm::_Bit_iterator> at stl_algobase.h:382
#6	0x000534a0 in __gnu_norm::vector<bool, std::allocator<bool>  
 >::operator= at stl_bvector.h:709
#7	0x00053504 in __gnu_debug_def::vector<bool, std::allocator<bool>  
 >::operator= at vector:100
#8	0x0005f256 in mysqlpp::Row::operator= at row.h:54
#9	0x000290fe in tac_db::client_id_query at tac_db.cpp:56
#10	0x00002073 in main at main.cpp:31

Here is the actual function in stl_bvector.h:

     vector&
     operator=(const vector& __x)
     {
       if (&__x == this)
	return *this;
       if (__x.size() > capacity())
	{
	  this->_M_deallocate();
	  _M_initialize(__x.size());
	}
       std::copy(__x.begin(), __x.end(), begin());
       this->_M_impl._M_finish = begin() + difference_type(__x.size());
       return *this;
     }

I must be using this wrong, but for some reason the same exact code  
runs on Windows without issue.  I am pretty sure the same code ran on  
OS X 10.4 without issue as well.   This started happening when I  
upgraded to Leopard.  I am really stuck.

Thanks,
Graham


On Nov 23, 2007, at 6:07 PM, Graham Reitz wrote:

> Also, I receive a EXC_BAD_ACCESS, which leads me to believe I have a  
> pointer that is screwed up.
>
>
> On Nov 23, 2007, at 5:37 PM, Graham Reitz wrote:
>
>> I forgot to add:
>>
>> Mac OS X 10.5.1 (Leopard)
>> Xcode 3.0
>>
>> On Nov 23, 2007, at 5:34 PM, Graham Reitz wrote:
>>
>>> I have an application that does the following:
>>>
>>> unsigned int some_db::client_id_query(std::string &client_username,
>>>                          std::string &client_password,
>>>                          std::string &error_msg)
>>> {
>>> 	try
>>> 	{
>>>       Query client_id_query = m_connection.query();
>>>       client_id_query << "select client_id from clients where  
>>> client_user_name ="
>>>           << quote_only << client_username << " and  
>>> client_password ="
>>>           << quote_only << client_password;
>>>
>>>       cout << "Query created\n";
>>>
>>>       Result client_id_result = client_id_query.store();
>>>
>>>       cout << "Result received\n";
>>>
>>>       Row client_id_row;
>>>       if (client_id_row = client_id_result.at(0))  // It hangs  
>>> here, and eventually hard crashes.
>>>       {
>>>           return client_id_row.at(0);
>>>       }
>>>   }
>>>   catch (exception &e)
>>>   {
>>>       error_msg = e.what();
>>>   }
>>>   catch (...)
>>>   {
>>>       error_msg = "Unknown exception";
>>>   }
>>>   return 0;
>>> }
>>>
>>> The output is:
>>> Connected to the some database (this is from the main function)
>>> Query created
>>> Result received (hangs here for about 20-30 seconds and than hard  
>>> crashes)
>>>
>>> I can perform a manual query in the database using the mysql  
>>> client and it returns a result without issue.
>>> What would cause it to hang for about 20-30 seconds at the  
>>> client_id_result.at(0) call?
>>> If there is something fundamentally wrong with this code I would  
>>> be grateful for any advice.
>>>
>>> Thanks,
>>> graham
>>>
>>
>


Thread
Application hangs at Result call to at()...Graham Reitz24 Nov
  • Re: Application hangs at Result call to at()...Graham Reitz24 Nov
    • Re: Application hangs at Result call to at()...Graham Reitz24 Nov
      • Re: Application hangs at Result call to at()...Graham Reitz24 Nov
      • Re: Application hangs at Result call to at()...Warren Young26 Nov
  • RE: Application hangs at Result call to at()...Jim Wallace26 Nov
    • Re: Application hangs at Result call to at()...Graham Reitz26 Nov