Subject: ps aux, floating point exception.
To: None <netbsd-users@netbsd.org>
From: Jeff Roberson <nomad@nop.aliensystems.com>
List: netbsd-users
Date: 09/07/1999 12:07:51
So I just upgraded to 1.4.1 because somehow I couldn't get rid of my
procsize mismatch errors.  Now I get floating point errors when I tell ps
to print the percent of the cpu a particular process is using.  I'll paste
some gdb output from a version of ps I built with debugging symbols.

Starting program:  ./ps aux
USER       PID %CPU %MEM   VSZ  RSS TT  STAT STARTED       TIME COMMAND

Program received signal SIGFPE, Arithmetic exception.
0x1200030e8 in getpcpu (k=0x12017c000) at print.c:563
563             return (100.0 * fxtofl(p->p_pctcpu) /
(gdb) bt
#0  0x1200030e8 in getpcpu (k=0x12017c000) at print.c:563
#1  0x120004f7c in pscomp (a=0x12017c000, b=0x12017c640) at ps.c:457
#2  0x120028e4c in qsort ()
#3  0x120004acc in main (argc=0, argv=0x1fffff4c8) at ps.c:373
(gdb) l
558             if (p->p_swtime == 0 || (p->p_flag & P_INMEM) == 0
559                 || p->p_stat == SZOMB)
560                     return (0.0);
561             if (rawcpu)
562                     return (100.0 * fxtofl(p->p_pctcpu));
563             return (100.0 * fxtofl(p->p_pctcpu) /
564                     (1.0 - exp(p->p_swtime * log(fxtofl(ccpu)))));
565     }
566
567     void
(gdb) print p->p_pctcpu
$1 = 0
(gdb) print p->p_swtime
$2 = 44736
(gdb) print ccpu
$3 = 0

I supose it's worth mentioning that I recompiled my kernel with the config
file I used with 1.4.  I did a diff between that and GENERIC and it looked
ok.  The other thing is, I replaced etc with etc.old and removed the
upgraded etc to etc.new because I didn't want to reconfigure my machine.
Have any drastic changes been made to etc? I'm also getting Sep  7
09:52:03 nop identd[5072]: getbuf: kvm_read(0xfffffc00deadbeef, 136) - tcb
: Bad address whenever some one makes an identd request. So I'm assuming
I'm having more kvm problems.  I did a kvm_mkdb, and ps/w/etc. work fine
though.  Does anyone know what is wrong?

Thanks,
Jeff