[systemd-devel] systemd-cgls - Memory overflow

Michal Schmidt mschmidt at redhat.com
Thu May 10 15:08:37 PDT 2012


On 05/10/2012 11:30 PM, Sven Anders wrote:
> What I find curious is, that it reads the correct command line and then opens the
> /proc file again, but this time it fails. What happened to the first read?

The first read is from is_kernel_thread().
The second read is from show_pid_array() -> get_process_cmdline().

> I checked the code, but could not see any reason for this on the first look.
>
> I did not see any mmap in the code causing this nor any reason, why this should be
> triggered by any libc function...

malloc() uses mmap for big allocations. I asked about COLUMNS because I 
suspected this line in get_process_cmdline() was doing the big 
allocations on your system:
       r = new(char, max_length);

Michal


More information about the systemd-devel mailing list