gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNUstep, Valgring and Memory leaks.


From: Ronan Collobert
Subject: Re: GNUstep, Valgring and Memory leaks.
Date: Wed, 1 Sep 2004 13:30:16 +0200 (CEST)

Hey,

  Thanks for all your answers, I will live with those memory leaks.

Note that concerning the use of valgrind with GNUstep, there is a tricky
"bug" in NSProcessInfo related to the processing of the arguments argv[]
given to the program:

On my computer (an intel linux debian testing machine), NSProcessInfo
reads the arguments argv[] using what is given in
/proc/<processid>/cmdline. When launching a GNUstep program with a command
such as:
valgrind --tool=memcheck mygnustepprogram myargs

then if in "mygnustepprogram" I use
[[NSProcessInfo processInfo] arguments] to obtain the command line
arguments, they will contain all the command line, including valgrind
arguments:
valgrind --tool=memcheck mygnustepprogram myargs

This is very weird, because the arguments given directly with
main(int argc, char **argv)
contain the correct answer:
mygnustepprogram myargs

It seems that in this special case, reading /proc is not a good idea. I
had a look on the code of valgrind: they load "by hand" the program into
memory. Note that a command line like:
/usr/bin/time -p mygnustepprogram myargs

will work fine with NSProcessInfo (time is using a standard "execvp"
system call).

Ronan.

On Tue, 31 Aug 2004, Matt Rice wrote:

>
> --- Richard Frith-Macdonald <address@hidden>
> wrote:
> <snip>
> > If there is a cheap, simple way to tell valgrind
> > about these situations
>
> there is, you can create suppressions files
> http://electra.lbl.gov/ATLAS/valgrind_HOWTO.html#SUPPRESSION
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]