Subject: port-macppc/24754: kernel hangs during execve(2)
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <aymeric@netbsd.org>
List: netbsd-bugs
Date: 03/12/2004 14:10:18
>Number:         24754
>Category:       port-macppc
>Synopsis:       kernel hangs during execve(2)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-macppc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 12 14:11:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Aymeric Vincent
>Release:        1.6ZK
>Organization:
>Environment:
1.6ZK
>Description:
For "quite some time" (at least 4 months) I've been experiencing kernel lockups on my iBook.

It happens when the filesystem is on NFS, when the filesystem is mounted with or without softdep, and also when the filesystem is mounted -o sync (like this time).

I'm not sure it's specific to macppc.

Here are some information gathered with DDB, I can send my kernel to anyone interested for reverse engineering purposes.

Everything below is typed by hand. This happened as usual during a "make build" after a few hours of compilation on a 640MB machine. The only special thing I can see below is that the number of inactive pages is exactly equal to the free target.

Also, apparently no attempt was made to use the swap partition although for example sshd, inetd, cron, and syslogd have been sitting there all along and free memory had been oscillating between ~0 and 25M for at least one hour.

----- output of sysstat vmstat 1 at time of hang (not very interesting):

Proc r d s w   Csw  Trp  Sys Int  Sof  Flt
     1   5     277 3021      165   83 2951

14.9% sys 79.2% user 5.9% idle

        real  virtual  free
Active 377396  377396   7440
All    622364  622364 531572

166 interrupts
100 cpu0 clock
  1 cpu0 softclock
  1 openpic irq 47
 64 openpic irq 19 (hard disk)

64 fmin, 85 ftarg, 48071 itarg

----- message of DDB when hitting the magic sequence (Cmd-Opt-Power)

Stopped in pid 16793.1 (sh)
...
----- traceback

... (begin of traceback due to pressing the key sequence) ...
0xd6093720 pmap_pvo_enter+11c
0xd6093770 pmap_enter+1d8
0xd60937b0 uvm_fault+584
0xd60938e0 trap+2b8
0xd6093960 kernel DSI write trap @ 0xc183c000 by memcpy+90 srr1=0x9032 r1=0xd6093a20
    cr=0x40002084 xer=0x20000000 ctr=0x22d dsisr=0xa000000
saved LR(0x3f613) is invalid

OK, so I asked to use the stack frame starting a little after:

0xd6093ac0 uiomove+1fc
0xd6093af0 ffs_read+4a8
0xd6093b90 vn_rdwr+124
0xd6093c70 vmcmd_readvn+54
0xd6093ca0 vmcmd_map_readvn+b4
0xd6093cc0 sys_execve+620
0xd6093ed0 syscall_plain+e0
0xd6093f40 user SC trap #59 by 0x418c3110: srr1=0xd032 r1=0xffffe0e0
    cr=0x20000084 xer=0 ctr=0x418c3108

----- output of "show uvmexp":

Current UVM status:
  pagesize=4096 (0x1000), pagemask=0xfff, pageshift=12
  157451 VM pages: 92402 active, 48071 inactive, 48 wired, 3808 free
  min 10% (25) anon, 10% (25) file, 5% (12) exec
  max 80% (204) anon, 50% (128) file, 30% (76) exec
  pages  13944 anon, 129789 file, 3868 exec
  freemin=64, free-target=85, inactive-target=48071, wired-max=52483
  faults=118465877, traps=119604335, intrs=3012328, ctxswitch=3524975
  softint=1412086, syscalls=0, swapins=256, swapouts=272
  fault counts:
    noram=0, noanon=0, pgwait=0, pgrele=0
    ok relocks(total)=20595(20595), anget(retrys)=94114584(0), amapcopy=1266931
    neighbor anon/obj pg=893239/26860545, gets(lock/unlock)=7418305/20595
    cases: anon=93908084, anoncow=206497, obj=5840621, prcopy=1577684, przero=16418027
  daemon and swap counts:
    woke=819, revs=813, scans=503774, obscans=221782, anscans=0
    busy=0, freed=0, reactivate=258803, deactivate=543095
    pageouts=0, pending=0, nswget=0
    nswapdev=1, nanon=278623, nanonneeded=278623 nfreeanon=271873
    swpages=131033, swpginuse=0, swpgonly=0, paging=0

>How-To-Repeat:
Compile something big that takes long enough, wait.

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted: