All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] [Sebastian.Koch@metatool.de: Re: ps u failed with signal 8 (FPE)]
@ 2004-01-22 11:48 Gerd Knorr
  2004-01-22 23:06 ` Goetz Bock
  2004-01-28  4:39 ` [uml-devel] " Jeff Dike
  0 siblings, 2 replies; 4+ messages in thread
From: Gerd Knorr @ 2004-01-22 11:48 UTC (permalink / raw)
  To: uml devel

  Hi,

"ps u" doesn't work in uml due to some values in /proc/meminfo being zero,
see below for details,

  Gerd

----- Forwarded message from Sebastian Koch <Sebastian.Koch@metatool.de> -----

Date: Thu, 22 Jan 2004 11:20:17 +0100 (MET)
From: Sebastian Koch <Sebastian.Koch@metatool.de>
Subject: Re: ps u failed with signal 8 (FPE)
To: Albert Cahalan <albert@users.sf.net>
cc: Sebastian Koch <Sebastian.Koch@metatool.de>,
   Gerd Knorr <kraxel@bytesex.org>
Importance: high
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Bogosity: Unsure, tests=bogofilter, spamicity=0.482720, version=0.15.13

I've found it.

The problem is that the proc file system of the UML shows a wrong
/proc/meminfo. Especially the MemTotal:

Achen:~ # p /proc/meminfo
MemTotal:            0 kB
MemFree:         33656 kB
Buffers:           752 kB
Cached:          19756 kB
SwapCached:          0 kB
Active:          12236 kB
Inactive:        10600 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:            0 kB
LowFree:         33656 kB
SwapTotal:      262136 kB
SwapFree:       262136 kB
Dirty:              16 kB
Writeback:           0 kB
Mapped:           5360 kB
Slab:             3264 kB
Committed_AS:    27144 kB
PageTables:        172 kB
VmallocTotal:   449516 kB
VmallocUsed:       184 kB
VmallocChunk:   449332 kB
Achen:~ #

This leeds to divide by zero in ps/output.c line 785 because the
kb_main_total == 0.


/* pp->vm_rss * 1000 would overflow on 32-bit systems with 64 GB memory */
static int pr_pmem(char *restrict const outbuf, const proc_t *restrict
const pp){
  unsigned long pmem = 0;
  pmem = pp->vm_rss * 1000ULL / kb_main_total;
  if (pmem > 999) pmem = 999;
  return snprintf(outbuf, COLWID, "%2u.%u", (unsigned)(pmem/10),
(unsigned)(pmem%10));
}

Do you want to setup a consistence check after reading the proc/meminfo ?

I will try to find out the problem in UML.

Best regards
Sebastian



On 20 Jan 2004, Albert Cahalan wrote:

> On Tue, 2004-01-20 at 10:46, Sebastian Koch wrote:
>
> > Probably this is a known bug.
>
> Nope. I've not seen this one.
>
> > If you need additional information regarding the UML-, host-kernel or
> > the root file system please let me know. I can provide a backtrace if someone
> > point me out where to set a breakpoint. To be honest I don't understand the
> > kernel FPE signal handling at this moment.
>
> This could be caused by integer division by zero.
> If you can get the siginfo data, that would be
> enough to determine this.
>
> Also, try this:   ps --info
>
>
>

--



----- End forwarded message -----

-- 
"... und auch das ganze Wochenende oll" -- Wetterbericht auf RadioEins


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-01-28  4:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-22 11:48 [uml-devel] [Sebastian.Koch@metatool.de: Re: ps u failed with signal 8 (FPE)] Gerd Knorr
2004-01-22 23:06 ` Goetz Bock
2004-01-23 10:51   ` [uml-devel] " Gerd Knorr
2004-01-28  4:39 ` [uml-devel] " Jeff Dike

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.