[Bug libstdc++/27530] Possible memory leak in std::vectorint::reserve() or std::vectorint::clear()
--- Comment #9 from pcarlini at suse dot de 2006-10-08 01:24 --- Feedback not forthcoming. -- pcarlini at suse dot de changed: What|Removed |Added Status|WAITING |RESOLVED Resolution||INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27530
[Bug libstdc++/27530] Possible memory leak in std::vectorint::reserve() or std::vectorint::clear()
-- pinskia at gcc dot gnu dot org changed: What|Removed |Added Severity|major |normal http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27530
[Bug libstdc++/27530] Possible memory leak in std::vectorint::reserve() or std::vectorint::clear()
--- Comment #8 from chris at bubblescope dot net 2006-08-03 19:48 --- One quick piece of advice. Have you tried compiling your entire application against the libstdc++ debug mode? It might help narrow down where the problem is. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27530
[Bug libstdc++/27530] Possible memory leak in std::vectorint::reserve() or std::vectorint::clear()
--- Comment #7 from ksharenkov at ya dot ru 2006-08-02 03:47 --- Hello. Now I can say more about this problem. before code listing I am sure that problem in template instantiation. code if CBaseSeat::CBaseSeat() id used deeply in templates holderT1 contains T1 which contains of vectorDerived from BaseSeat which contains vectorint there are facts: 1) The leak was gone just i removed line m_cardsSet.reserve( MAX_CARDS_ON_HAND ); it was need only for allocatio optimize 2) Windows version of this code not affected by this problem In any case i will try to create self contained test code when i will have a day for it. But it will be rather big i think. There is the code: // CMessage* CMessage::clone() const { CMessage* result = new CMessage( m_descriptor, m_session, m_id ); std::stringstream buffer; this-write( buffer ); // read unnecessary type short type; shortSerializer.read( buffer, type ); result-read( buffer ); return result; } // CMessage* CMessageFactory::createInstance( CSession* sess, MessageType type ) { Descriptors::iterator pos = m_descriptors.find( type ); if( pos==m_descriptors.end() ) { throw std::logic_error(ERROR: Trying create message of unknown type ); } CMessage* result = new CMessage( pos-second, sess, nextMessageId() ); return result; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27530
[Bug libstdc++/27530] Possible memory leak in std::vectorint::reserve() or std::vectorint::clear()
--- Comment #6 from chris at bubblescope dot net 2006-07-29 10:08 --- My natural suspision would be that your clone() function is incorrectly implemented. Can you show us the source to the CMessage object, and theMessageFactory.createInstance( )? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27530
[Bug libstdc++/27530] Possible memory leak in std::vectorint::reserve() or std::vectorint::clear()
--- Comment #5 from pcarlini at suse dot de 2006-05-15 16:58 --- (In reply to comment #4) I have tried to create simple test case (about 200 rows) where I tried to reproduce key code fragments. In simple test case leak not reproduced. But I have easy reproduced it with very small application based on main project code. Please try harder to produce a self-contained, small, testcase. Otherwise, we cannot debug the issue. Thanks. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27530
[Bug libstdc++/27530] Possible memory leak in std::vectorint::reserve() or std::vectorint::clear()
--- Comment #2 from pcarlini at suse dot de 2006-05-10 12:10 --- Chris is right. Certainly we are not aware of any problem in that code, in particular the 3.4.5 version, very close to the original HP/SGI code and very well tested from that point of view (at least). Please provide a self-contained testcase (as small as possible, of course), otherwise the PR, not really useful, likely will be soon closed, sorry. -- pcarlini at suse dot de changed: What|Removed |Added Status|UNCONFIRMED |WAITING Summary|Polible memory leak in |Possible memory leak in |std::vectorint::reserve() |std::vectorint::reserve() |or std::vectorint::clear()|or std::vectorint::clear() http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27530
[Bug libstdc++/27530] Possible memory leak in std::vectorint::reserve() or std::vectorint::clear()
--- Comment #3 from ksharenkov at ya dot ru 2006-05-10 12:48 --- Ok, i will try to create a short program -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27530
[Bug libstdc++/27530] Possible memory leak in std::vectorint::reserve() or std::vectorint::clear()
--- Comment #4 from ksharenkov at ya dot ru 2006-05-10 15:58 --- I have tried to create simple test case (about 200 rows) where I tried to reproduce key code fragments. In simple test case leak not reproduced. But I have easy reproduced it with very small application based on main project code. Code like CMessage* m1 = theMessageFactory.createInstance( ) CMessage* m2 = m1-clone(); delete m2; delete m1; I am staring think that problem in templates instantiation. Also I already had problem with proper template instantiation in my Project. For some copy operations with vector of objects, vptr were set to 0 (caused SEG FAULT). I have not reported on It. I have resolved it by equal code but without copy operation. (2 weeks spent to detect cause, I though I am was wrong somewhere #61516; ) I have a test executable with full debug info (27M) (necessary libs statically linked) Depends only ldd ./leaktest linux-gate.so.1 = (0x00f56000) libstdc++.so.6 = /usr/local/lib/libstdc++.so.6 (0x00111000) libm.so.6 = /lib/tls/libm.so.6 (0x0045c000) libgcc_s.so.1 = /lib/libgcc_s.so.1 (0x005a5000) libc.so.6 = /lib/tls/libc.so.6 (0x00339000) /lib/ld-linux.so.2 = /lib/ld-linux.so.2 (0x0032) Will it be usefull for you? To analyze generated code. -- ksharenkov at ya dot ru changed: What|Removed |Added CC||ksharenkov at ya dot ru http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27530