[torquedev] OS X outstanding issues
Garrick
garrick at usc.edu
Thu Jan 15 09:05:40 MST 2009
HPCC/Linux Systems Admin
On Jan 15, 2009, at 5:20 AM, Glen Beane <glen.beane at gmail.com> wrote:
> On Wed, Jan 14, 2009 at 11:30 PM, Garrick <garrick at usc.edu> wrote:
>> Wordexp() is called more than once and I expect wordfree() is
>> necessary
>> between calls.
>
>> From looking at Apple's wordexp source code I don't think this is
>> true.
>
>
> It always initializes pwe->we_wordc to zero and pwe->we_wordv to NULL
> (pwe is the name of the second parameter in the Apple source).
> we_wordv would be the pointer to the memory allocated by a previous
> call to wordexp if you are reusing pwe. Even if you pass the
> WRDE_REUSE flag all it does is call wordfree() before setting we_wordc
> and we_wordv:
>
>
> if (flags & WRDE_REUSE) {
> wordfree(pwe);
> }
> pwe->we_wordc = 0;
> pwe->we_wordv = NULL;
>
>
>
> The harm of not calling wordfree() will be a memory leak, but since
> this is a child of pbs_mom it isn't a problem. I'm going to do some
> tests later with wordfree() commented out. It is sloppy, but I think
> it might work until Apple fixes their code.
It's certainly worth a try.
Maybe you could get valgrind on that child process?
More information about the torquedev
mailing list