[systemd-devel] systemctl status -> sigsegv

Oleksii Shevchuk alxchk at gmail.com
Mon Oct 14 13:34:52 PDT 2013


> systemctl --system status smartd.service
smartd.service - Self Monitoring and Reporting Technology (SMART) Daemon
   Loaded: loaded (/usr/lib64/systemd/system/smartd.service; enabled)
   Active: active (running) since Пн 2013-10-14 11:19:05 EEST; 12h ago
 Main PID: 2112 (smartd)
   CGroup: /system.slice/smartd.service
           └─2112 /usr/sbin/smartd -n
Assertion 'n_pids > 0' failed at /tmp/portage/sys-apps/systemd-9999/work/systemd-9999/src/shared/cgroup-show.c:47, function show_pid_array(). Aborting.
zsh: abort (core dumped)  systemctl --system status smartd.service

Possible fix:

diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c
index 979fa8f..5c55313 100644
--- a/src/shared/cgroup-show.c
+++ b/src/shared/cgroup-show.c
@@ -263,7 +263,8 @@ static int show_extra_pids(const char *controller, const char *path, const char
                 copy[j++] = pids[i];
         }
 
-        show_pid_array(copy, j, prefix, n_columns, true, false, false, flags);
+       if (j)
+               show_pid_array(copy, j, prefix, n_columns, true, false, false, flags);
 
         return 0;
 }


More information about the systemd-devel mailing list