Memory Problems?

8 views
Skip to first unread message

Matt Forni

unread,
Mar 24, 2010, 3:27:20 AM3/24/10
to cs224...@googlegroups.com
Is anyone having memory problems when attempting to add another global Vector2List to FrontEnd?  It's been a few since I've seen problems like this so I apologize if I'm doing something stupid, but simply adding:

Vector2List m_curves;

to my header file causes the following dump upon execution of ./fibermesh.
Thanks in advance and my deepest apologies to anyone who ran into a similar problem.

*** glibc detected *** ./fibermesh: malloc(): memory corruption: 0x089e5670 ***
======= Backtrace: =========
/lib/libc.so.6[0xb6b17845]
/lib/libc.so.6[0xb6b19de2]
/lib/libc.so.6(__libc_malloc+0x96)[0xb6b1b586]
/usr/lib/libstdc++.so.6(_Znwj+0x27)[0xb6cd7fd7]
./fibermesh[0x8067267]
./fibermesh[0x805f2ef]
./fibermesh[0x805d533]
/lib/libc.so.6(__libc_start_main+0xe5)[0xb6ac3455]
./fibermesh[0x8056291]
======= Memory map: ========
08048000-0893f000 r-xp 00000000 00:2f 2599466    /home/mattf/course/cs224/fibermesh/fibermesh
0893f000-08960000 rw-p 008f7000 00:2f 2599466    /home/mattf/course/cs224/fibermesh/fibermesh


--
Matt Fornaciari
Applied Math - Computer Science (Graphics)
Brown University
69 Brown St., Box 4539
Providence, RI  02912

John F. Hughes

unread,
Mar 24, 2010, 9:20:44 AM3/24/10
to cs224...@googlegroups.com
That sure SOUNDS as if you're damaging memory somewhere EARLIER in your code, and calling the new allocator is breaking something. Except that you seem to be just declaring this thing. In C++, does that invoke the default constructor? It probably does. Hmmm. Try commenting out some code PRIOR to this (or most code prior to it) and see whether it then succeeds. Binary search may then help you find the culprit (I hope). [But realize, please, that you're getting advice from someone who hasn't written any C++ code in many years.]
 
--Spike


From: cs224...@googlegroups.com [mailto:cs224...@googlegroups.com] On Behalf Of Matt Forni
Sent: Wednesday, March 24, 2010 3:27 AM
To: cs224...@googlegroups.com
Subject: Memory Problems?

To unsubscribe from this group, send email to cs224-2010+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Trevor O'Brien

unread,
Mar 24, 2010, 9:34:03 AM3/24/10
to cs224...@googlegroups.com
I agree with Spike.  Declaring the variable does invoke the default constructor, but I'd be surprised if that were the issue here, since I believe there are other Vector2List's being declared as well.  Also, you saw global, but I presume you mean member variable for FrontEnd.

You've added nothing else to that header file?  Have you appended anything to the list in the definition of the FrontEnd class?  If not, does the problem come and go with commenting out that line?

-Trevor
--
Trevor M. O'Brien
Ph.D. Student
Department of Computer Science
Brown University
vis.cs.brown.edu/~trevor

Matt Forni

unread,
Mar 24, 2010, 11:24:13 AM3/24/10
to cs224...@googlegroups.com

I meant member. I didn't change a. single other thing in the header and the problem is eliminated if I comment the declaration out.

On Mar 24, 2010 9:34 AM, "Trevor O&apos;Brien" <tre...@cs.brown.edu> wrote:

I agree with Spike.  Declaring the variable does invoke the default constructor, but I'd be surprised if that were the issue here, since I believe there are other Vector2List's being declared as well.  Also, you saw global, but I presume you mean member variable for FrontEnd.

You've added nothing else to that header file?  Have you appended anything to the list in the definition of the FrontEnd class?  If not, does the problem come and go with commenting out that line?

-Trevor

On Wed, Mar 24, 2010 at 9:20 AM, John F. Hughes <j...@cs.brown.edu> wrote: > > That sure SOUNDS as ...

--
Trevor M. O'Brien
Ph.D. Student
Department of Computer Science
Brown University
vis.cs.brown.edu/~trevor

To unsubscribe from this group, send email to cs224-2010+unsubscribegooglegroups.com or reply to th...

Reply all
Reply to author
Forward
0 new messages