Atoptool / atop

System and process monitor for Linux
GNU General Public License v2.0
792 stars 109 forks source link

atop crashes with a floating point exception #277

Closed vpa1977 closed 10 months ago

vpa1977 commented 10 months ago

The issue occurs in lxc armhf container.

#./atopacctd

cannot switch on process accounting: Operation not permitted

# atop
Floating point exception (core dumped)

atopacctd leaves a zero-length shadow file

 ls -l /var/run/pacct_shadow.d
total 4
-rw-r--r-- 1 root root 0 Oct  2 22:46 0000000000.paf

that atop attempt to read.

static int atopacctd(int swon) retries attempts to read it at acctproc.c:441 and exits on failure.

It returns 1 (success) and does not zero out maxshadowrec variable in this case causing a subsequent division by zero.