Subject: port-i386/6504: panic: pmap_steal_ptp: failed to steal a PTP!
To: None <gnats-bugs@gnats.netbsd.org>
From: None <frueauf@ira.uka.de>
List: netbsd-bugs
Date: 11/28/1998 13:08:41
>Number:         6504
>Category:       port-i386
>Synopsis:       panic: pmap_steal_ptp: failed to steal a PTP!
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 28 04:20:01 1998
>Last-Modified:
>Originator:     Thorsten Frueauf
>Organization:
private
	
>Release:        <NetBSD-current source date> NetBSD-current 27.11.1998
>Environment:
	
System: NetBSD cyberlap 1.3I NetBSD 1.3I (CYBERLAP) #0: Sat Nov 28 00:05:32 MET 1998 frueauf@cyberlap:/usr/src/sys/arch/i386/compile/CYBERLAP i386

Toshiba Tecra 500CDT laptop (P120).

real mem  = 50069504
avail mem = 44646400

>Description:
	
While I tried to update the pkgsrc/graphics/sane package to 1.00, the
machine paniced while I compiled sane-1.00/backend/umax.c:

cc -c -O2 -I/usr/pkg/include -Wall -DHAVE_CONFIG_H -I. -I. -I../include -I../include -I/usr/pkg/include -D_GNU_SOURCE -DPATH_SANE_CONFIG_DIR=/usr/X11R6/etc/sane.d -DPATH_SANE_DATA_DIR=/usr/X11R6/share -DV_MAJOR=1 -DV_MINOR=0 -DBACKEND_NAME=umax -DLIBDIR=/usr/X11R6/lib/sane -fPIC -DPIC umax.c

It looks like this is an optimazion bug in egcs which gets triggered with
-O2, when I compile the same thing with -O it does not eat up all memory.
However - egcs eating all memory should not panic the machine.

Here is the relevant output of `ps aux -M netbsd.0.core`:

USER       PID %CPU %MEM   VSZ  RSS TT  STAT STARTED       TIME COMMAND
frueauf   7811  0.0  0.0   132    0 pb  IW+  -          0:00.00 (cc)
frueauf   7813  0.0  0.0 81284    0 pb  RW+  12:17PM    3:28.95 (cc1)

netbsd.0.core:
--------------
(gdb) target kcore netbsd.0.core
panic: pmap_steal_ptp: failed to steal a PTP!
#0  0x0 in ?? ()

It looks to me that I don't get more usefull output if I recompile the
kernel with debug options, but if you whish i can try and provide more
necessary info, just tell me.

/var/adm/messages:
------------------
Nov 28 11:00:01 cyberlap syslogd: restart
Nov 28 12:21:51 cyberlap /netbsd: r: no room for pid 12228(xclock), free 1
Nov 28 12:21:57 cyberlap /netbsd: scheduler: no room for pid 12228(xclock), free 1
Nov 28 12:21:57 cyberlap last message repeated 7 times
Nov 28 12:21:57 cyberlap /netbsd: scheduler: no room for pid 12228(xclock)or pid 12228(xclock), free 1
Nov 28 12:21:58 cyberlap /netbsd: scheduler: no room for pid 12228(xclock), free 1
Nov 28 12:21:59 cyberlap last message repeated 53 times
Nov 28 12:21:59 cyberlap /netbsd: scheduler: no room for pid 12228(xclock), free 2
Nov 28 12:22:00 cyberlap /netbsd: scheduler: no room for pid 12228(xclock), free 1
Nov 28 12:34:02 cyberlap syslogd: restart

>How-To-Repeat:
	
Try to compile sane-1.00, especially sane-1.00/backend/umax.c with
current egcs and -O2 on a current i386 machine.

>Fix:
	
Workaround: don't use -O2 with egcs. I have no solution to
prevent the panic :-(
>Audit-Trail:
>Unformatted:
panic: pmap_steal_ptp: failed to steal a PTP!