* [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
* Re: [uml-devel] [Sebastian.Koch@metatool.de: Re: ps u failed with signal 8 (FPE)]
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
1 sibling, 1 reply; 4+ messages in thread
From: Goetz Bock @ 2004-01-22 23:06 UTC (permalink / raw)
To: uml devel
On Thu, Jan 22 '04 at 12:48, Gerd Knorr wrote:
> "ps u" doesn't work in uml due to some values in /proc/meminfo being zero,
> see below for details,
Works fine here:
user@uml ~$ ps u
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
user 7112 0.0 0.0 2200 4 pts/1 S Jan03 0:00 /bin/bash
user 12177 0.0 1.5 2192 444 pts/0 S Jan09 0:00 -bash
user 12182 0.0 1.8 2312 520 pts/0 S Jan09 0:00 screen -r
user 12219 0.0 4.6 2208 1288 pts/2 S Jan09 0:00 /bin/bash
user 12224 0.0 2.5 2536 724 pts/2 R Jan09 0:00 ps u
user@uml ~$ cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 28614656 27774976 839680 0 806912 21946368
Swap: 134209536 11239424 122970112
MemTotal: 27944 kB
MemFree: 820 kB
MemShared: 0 kB
Buffers: 788 kB
Cached: 20028 kB
SwapCached: 1404 kB
Active: 1968 kB
Inactive: 21180 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 27944 kB
LowFree: 820 kB
SwapTotal: 131064 kB
SwapFree: 120088 kB
user@uml ~$ cat /proc/version
Linux version 2.4.22-4bgstatic-6um (root@basel1.hfz.info) (gcc version 3.3) #1 Mon Dec 1 01:18:56 CET 2003
user@host ~$ cat /proc/version
Linux version 2.4.23-0tr1bg (root@basel1.hfz.info) (gcc version 3.3) #1 Sun Nov 30 17:08:50 CET 2003
So what version of uml are you talking about.
--
/"\ Goetz Bock at blacknet dot de -- secure mobile Linux everNETting
\ / (c) 2003 as GNU FDL 1.1
X [ 1. Use descriptive subjects - 2. Edit a reply for brevity - ]
/ \ [ 3. Reply to the list - 4. Read the archive *before* you post ]
-------------------------------------------------------
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
* [uml-devel] Re: [Sebastian.Koch@metatool.de: Re: ps u failed with signal 8 (FPE)]
2004-01-22 23:06 ` Goetz Bock
@ 2004-01-23 10:51 ` Gerd Knorr
0 siblings, 0 replies; 4+ messages in thread
From: Gerd Knorr @ 2004-01-23 10:51 UTC (permalink / raw)
To: Goetz Bock, user-mode-linux-devel
Goetz Bock <bock+uml@blacknet.de> writes:
> On Thu, Jan 22 '04 at 12:48, Gerd Knorr wrote:
> > "ps u" doesn't work in uml due to some values in /proc/meminfo being zero,
> > see below for details,
> Works fine here:
> user@uml ~$ cat /proc/version
> Linux version 2.4.22-4bgstatic-6um (root@basel1.hfz.info) (gcc version 3.3) #1 Mon Dec 1 01:18:56 CET 2003
The kernel in question is 2.6.x ...
Gerd
--
"... 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
* Re: [uml-devel] [Sebastian.Koch@metatool.de: Re: ps u failed with signal 8 (FPE)]
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-28 4:39 ` Jeff Dike
1 sibling, 0 replies; 4+ messages in thread
From: Jeff Dike @ 2004-01-28 4:39 UTC (permalink / raw)
To: Gerd Knorr; +Cc: uml devel
kraxel@bytesex.org said:
> The problem is that the proc file system of the UML shows a wrong /
> proc/meminfo. Especially the MemTotal:
Nice catch. I was wondering about that SIGFPE crash. Try the patch below.
Jeff
===== arch/um/kernel/mem.c 1.21 vs edited =====
--- 1.21/arch/um/kernel/mem.c Thu Jan 8 07:43:01 2004
+++ edited/arch/um/kernel/mem.c Mon Jan 26 11:02:13 2004
@@ -30,7 +30,6 @@
int kmalloc_ok = 0;
static unsigned long brk_end;
-static unsigned long totalram_pages = 0;
void unmap_physmem(void)
{
-------------------------------------------------------
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.