https://bugs.kde.org/show_bug.cgi?id=456171

--- Comment #6 from Paul Floyd <pjfl...@wanadoo.fr> ---

> Pardon, what do you mean by this? When running a simple test program which
> calls setproctitle, I'm not getting any leaks or addressing errors...

I haven't done any testing yest, but looking at the source I see that
setproctitle first tries auxv. When an application runs under Valgrind it
doesn't get a full auxv, rather it gets one that has been sanitized by Valgrind
without any dynamic memory. So presume the _elf_aux_info call will fail and the
fallback is to

        if (ps_strings == NULL) {
                len = sizeof(ul_ps_strings);
                if (sysctlbyname("kern.ps_strings", &ul_ps_strings, &len, NULL,
                    0) == -1)
                        return (NULL);
                ps_strings = (struct ps_strings *)ul_ps_strings;
        }

This is getting a pointer to some memory. My question is where does that memory
come from? And I presume (again) that it causes problems because it came from
somewhere and memcheck didn't see it being allocated.

Also this code does look a bit leaky. The buffers allocated by malloc never get
freed, so if you run with --leak-check=full --show-reachable=yes I expect that
memcheck will complain about that memory. That's not a big issue, and it would
require changes to libc, see
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259294

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to