List:MySQL++« Previous MessageNext Message »
From:Thunder0 Date:November 27 2007 10:49am
Subject:Re: Is method "const ColData Row::at(size_type i) const" leaking memory?
View as plain text  
I made the const_string destructor virtual and here is what happened (gdb
message):


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1283466336 (LWP 7230)]
0x004ccb29 in __gnu_cxx::__exchange_and_add () from /usr/lib/libstdc++.so.6
(gdb) where
#0  0x004ccb29 in __gnu_cxx::__exchange_and_add () from
/usr/lib/libstdc++.so.6
#1  0x004b0f24 in std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::~basic_string () from /usr/lib/libstdc++.so.6
#2  0x08068564 in ~ColData_Tmpl (this=0xb37fbff8)
    at /usr/include/mysql++/coldata.h:87
#3  0x08062258 in btau::DBSession::retrieveLastLinkingitem (this=0x87f8738,
    linkingItemList=@0xb37fc18c) at ../DatabaseModule/DBSession.cpp:607
#4  0x080764a2 in
btau::ApplicationDataLogicManager::saveTimestampAndLinkingItem
(this=0xb37fd2c4, tst=@0xb37fd2d8)
    at ../ApplicationLogicModule/ApplicationDataLogicManager.cpp:388
#5  0x08089543 in
btau::TSUMessageProcessingThread::manageTimeStampsaveRequest
    (this=0x87f69e8, tsuReq=0x87f6d58)
    at ../ApplicationLogicModule/TSUMessageProcessingThread.cpp:526
#6  0x08089e7a in btau::TSUMessageProcessingThread::Run (this=0x87f69e8)
    at ../ApplicationLogicModule/TSUMessageProcessingThread.cpp:402
#7  0x0809f513 in Thread::StartThread (zz=0x87f69e8) at Thread.cpp:106
#8  0x00369433 in start_thread () from /lib/libpthread.so.0
#9  0x001c9a1e in clone () from /lib/libc.so.6


I do not know if that can be interesting to you, I reported it just in case.

I will restore the standard version. I'll have some tries with a simpler
code: I will "valgrind" a small main and see what happens.
I will try and find some workaround, or the new version which you mentioned.


Thanks.


--------- Original Message --------
	Da: plusplus@stripped
	To: MySQL++ Mailing List <plusplus@stripped>
	Oggetto: Re: Is method "const ColData Row::at(size_type i) const"  leaking
memory?
	Data: 26/11/07 21:58
	
	> 
> 
> 
> Thunder0 wrote:
> > 
> > (const_string.h:110)==10964==    
> 
> Try making ~const_string() virtual and rebuilding.
> 
> I don't really expect that to fix it, because if it does, it means 
> someone somewhere is holding references to ColData<const_string> objects 
> by pointers to the base class and deleting them through that pointer. 
> That shouldn't be happening, because as far as I know, everyone keeps 
> ColData objects as ColData.  (This lack of use of the is-a property of 
> inheritance is one reason why ColData no longer uses inheritance in v3.)
> 
> If, as seems more likely, making the base class dtor virtual doesn't 
> help, I'm at a total loss.  You can clearly see in const_string.h that 
> memory allocated in the ctors gets deallocated in the dtor.  When a 
> ColData_Tmpl<const_string> object goes away, ~const_string() should be 
> called, freeing up the memory.
> 
> -- 
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:    http://lists.mysql.com/plusplus?unsub=1
> 
> 
> 
>  
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Stai cercando l'email marketing di successo ed economica? Prova con
Email.it le tue campagne di Email Marketing a partire da 250 Euro!

 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7149&d=20071127


Thread
Is method "const ColData Row::at(size_type i) const" leaking memory?Thunder021 Nov
  • Re: Is method "const ColData Row::at(size_type i) const" leakingmemory?Warren Young22 Nov
Re: Is method "const ColData Row::at(size_type i) const" leaking memory?Thunder026 Nov
  • Re: Is method "const ColData Row::at(size_type i) const" leakingmemory?Warren Young26 Nov
    • Re: Is method "const ColData Row::at(size_type i) const" leaking memory?Graham Reitz27 Nov
      • Re: Query object seg. faults on destruction...Graham Reitz27 Nov
        • Re: Query object seg. faults on destruction...Warren Young27 Nov
          • Re: Query object seg. faults on destruction...Graham Reitz27 Nov
            • Re: Query object seg. faults on destruction...Warren Young27 Nov
              • Re: Query object seg. faults on destruction...Graham Reitz28 Nov
Re: Is method "const ColData Row::at(size_type i) const" leaking memory?Thunder027 Nov
  • Re: Is method "const ColData Row::at(size_type i) const" leakingmemory?Warren Young27 Nov
Re: Is method "const ColData Row::at(size_type i) const" leaking memory?Thunder028 Nov
  • Re: Is method "const ColData Row::at(size_type i) const" leakingmemory?Warren Young28 Nov