On 5/30/2013 9:15 AM, Alan Mazer wrote:
> I've been using valgrind for many years and am finally stumped. After
> not having used it recently, I'm now getting "definitely lost" memory
> and the location of the "operator new" usage is a function call.
>
> For example...
>
> ==35995== 2,089 bytes in 1 blocks are definitely lost in loss record 9
> of 10
> ==35995==    at 0x10008FC16: malloc (vg_replace_malloc.c:274)
> ==35995==    by 0x1000A126C: operator new(unsigned long) (in
> /usr/local/lib/libstdc++.6.dylib)
> ==35995==    by 0x10001984C: main (main.cpp:405)
>
> where main.cpp:405 is...
>
>       read_conf(conffile, ".conf;.test;.prot", preface, trigger_statement,
>               skip_preprocessor, m4dirs, &text);
>
> Everything being passed is a pointer.
>
> If I don't call the routine, the error does go away.
>
> This type of error is occurring in a variety of places, always
> "definitely lost" memory at a function call.
>
> Anyone have any idea what I'm missing?  I've tried multiple compilers
> and a bazillion different options (on compiler and valgrind).  I'm stumped.
>
> -- Alan
>

What is the signature of the function being called?  You say that 
pointers are being passed in, but what does the function expect? For 
example, is the compiler automatically creating an object for the string 
constant using a default constructor?  (I realize the loss record is 
longer than the string constant, but I don't know what the function 
expects.)

Also, is the function in a .so file that has been stripped so that 
Valgrind cannot follow its stack trace?

And of course, what version of Valgrind are you using?

-- 
     David Chapman      dcchap...@acm.org
     Chapman Consulting -- San Jose, CA
     Software Development Done Right.
     www.chapman-consulting-sj.com


------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to