[systemd-devel] [PATCH] cgtop: fix assert when not on tty

David Herrmann dh.herrmann at gmail.com
Wed Mar 11 09:00:20 PDT 2015


Hi

On Wed, Mar 11, 2015 at 11:24 AM, Umut Tezduyar Lindskog
<umut.tezduyar at axis.com> wrote:
> systemd-cgtop --dept=1 -b -n 10 -d 0.1 | cat
>
> Assertion 'new_length >= 3' failed at src/shared/util.c:3 \
> 595, function ellipsize_mem(). Aborting.
> Aborted (core dumped)
> ---
>  src/cgtop/cgtop.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied (with a small comment added).

Thanks!
David

> diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
> index 3c7ad40..46ba1aa 100644
> --- a/src/cgtop/cgtop.c
> +++ b/src/cgtop/cgtop.c
> @@ -447,7 +447,7 @@ static int display(Hashmap *a) {
>          Group *g;
>          Group **array;
>          signed path_columns;
> -        unsigned rows, n = 0, j, maxtcpu = 0, maxtpath = 0;
> +        unsigned rows, n = 0, j, maxtcpu = 0, maxtpath = 3;
>          char buffer[MAX3(21, FORMAT_BYTES_MAX, FORMAT_TIMESPAN_MAX)];
>
>          assert(a);
> --
> 2.1.1
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


More information about the systemd-devel mailing list