All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Knorr <kraxel@bytesex.org>
To: uml devel <user-mode-linux-devel@lists.sourceforge.net>
Subject: [uml-devel] [Sebastian.Koch@metatool.de: Re: ps u failed with signal 8 (FPE)]
Date: Thu, 22 Jan 2004 12:48:58 +0100	[thread overview]
Message-ID: <20040122114858.GH11029@bytesex.org> (raw)

  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

             reply	other threads:[~2004-01-22 12:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-22 11:48 Gerd Knorr [this message]
2004-01-22 23:06 ` [uml-devel] [Sebastian.Koch@metatool.de: Re: ps u failed with signal 8 (FPE)] Goetz Bock
2004-01-23 10:51   ` [uml-devel] " Gerd Knorr
2004-01-28  4:39 ` [uml-devel] " Jeff Dike

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040122114858.GH11029@bytesex.org \
    --to=kraxel@bytesex.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.