NetBSD Problem Report #49364

From martin@duskware.de  Wed Nov  5 13:30:18 2014
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 80D14A6686
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  5 Nov 2014 13:30:18 +0000 (UTC)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: arm kernel panics on exec
X-Send-Pr-Version: 3.95

>Number:         49364
>Category:       port-arm
>Synopsis:       arm kernel panics on exec
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-arm-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 05 13:35:00 +0000 2014
>Closed-Date:    Sun Nov 09 11:10:59 +0000 2014
>Last-Modified:  Mon Nov 10 20:00:00 +0000 2014
>Originator:     Martin Husemann
>Release:        NetBSD 7.99.1
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD space-truckin.duskware.de 7.99.1 NetBSD 7.99.1 (CUBIETRUCK) #57: Wed Nov 5 10:29:20 CET 2014 martin@night-owl.duskware.de:/usr/src/sys/arch/evbarm/compile/CUBIETRUCK evbarm
Architecture: earmv7hfeb
Machine: evbarm
>Description:
Under VA pressure (or kernel memory, or whatever) execing new processes will
panic the kernel (pmap assertion: pg != NULL, details to be filled in).

This happens for me when extracting set files (especially the huge debug
ones) to wd0 and login in via ssh, or see below.

>How-To-Repeat:

Make sure you have plenty of space in /tmp (i.e. no tmpfs)
ssh into the box, then:
cd /usr/tests/fs/cd9660
atf-run | atf-report

Now wait like 10 minutes, then try to log in on the console

>Fix:
n/a

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Sat, 08 Nov 2014 08:14:38 +0000
State-Changed-Why:

Possible fix commited
sys/arch/arm/arm32/pmap.c:1.312


From: "Matt Thomas" <matt@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49364 CVS commit: src/sys/arch/arm/arm32
Date: Sat, 8 Nov 2014 08:01:34 +0000

 Module Name:	src
 Committed By:	matt
 Date:		Sat Nov  8 08:01:34 UTC 2014

 Modified Files:
 	src/sys/arch/arm/arm32: pmap.c

 Log Message:
 When allocing a l1page, if a page isn't available, use uvm_wait to wait
 for one to become available.  Should fix PR/49364.


 To generate a diff of this commit:
 cvs rdiff -u -r1.311 -r1.312 src/sys/arch/arm/arm32/pmap.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-arm/49364 (arm kernel panics on exec)
Date: Sat, 8 Nov 2014 12:55:14 +0100

 Doesn't seem to panic any more, but I can't login during the test run
 either, neither via ssh nor on the console.

 db{0}> show uvm
 Current UVM status:
   pagesize=8192 (0x2000), pagemask=0x1fff, pageshift=13
 , ncolors=1  258934 VM pages: 169872 active, 82960 inactive, 1092 wired, 1601 fr
 ee                                                                             
   pages  2201 anon, 250395 file, 1328 exec
   freemin=256, free-target=341, wired-max=86311
   cpu0:                                        
     faults=20079, traps=26366, intrs=10126135, ctxswitch=22556408
     softint=86732, syscalls=121857                               
   cpu1:                           
     faults=93273, traps=132938, intrs=9967258, ctxswitch=25485053
     softint=6056, syscalls=215410                                
   fault counts:                  
     noram=0, noanon=0, pgwait=0, pgrele=0
     ok relocks(total)=503(503), anget(retrys)=33645(0), amapcopy=16293
     neighbor anon/obj pg=22944/180984, gets(lock/unlock)=47190/503    
     cases: anon=22491, anoncow=11159, obj=40227, prcopy=6962, przero=30155
   daemon and swap counts:                                                 
     woke=13091735, revs=246, scans=324910, obscans=281348, anscans=0
     busy=0, freed=281348, reactivate=778, deactivate=395235         
     pageouts=0, pending=0, nswget=0                        
     nswapdev=1, swpgavail=262266   
     swpages=262266, swpginuse=0, swpgonly=0, paging=0

 db{0}> ps                                            
 PID    LID S CPU     FLAGS       STRUCT LWP *               NAME WAIT
 2051     1 2   0         0           bfd40060            atf-run     
 1701     1 3   0        80           bfd405e0         atf-report pipe_rd
 1373     1 3   0        80           bfc91680            atf-run select 
 39       1 3   0        80           bfd40b60               tcsh pause 
 1819     1 3   0        80           bfbb7120               tcsh pause
 1772     1 3   1        80           bfd40320               rxvt select
 1809     1 3   1        80           bfd408a0               sshd select
 1786     1 3   1        80           bfd410e0               sshd select
 1807 >   1 7   0         0           bff22880              getty       
 1386 >   1 7   1         0           bfbb6ba0               cron
 1663     1 3   1        80           bfbb6e60              inetd kqueue
 1133     1 3   1        80           bfbb73e0               sshd select
 885      1 3   0        80           bfc90b80               ntpd pause 
 540      1 3   0        80           bfc90e40            syslogd kqueue
 470      1 2   0         0           bfc91100             dhcpcd       
 1        1 3   0        80           bfd41920               init wait
 0       49 3   1       200           bfc913c0            physiod physiod
 0       48 3   0       200           bfd413a0           aiodoned aiodoned
 0       47 3   0       200           bff22b40            ioflush syncer  
 0       46 3   1       200           bfd41660           pgdaemon pgdaemon
 0       42 3   0       200           bff22e00               usb4 usbevt  
 0       41 3   1       200           bff230c0               usb3 usbevt
 0       40 3   0       200           bff23380               usb2 usbevt
 0       39 3   1       200           bff23640               usb1 usbevt
 0       38 3   1       200           bff225c0               usb0 usbevt
 0       37 3   1       200           bfd41be0              unpgc unpgc 
 0       35 3   0       200           bff22300        vmem_rehash vmem_rehash
 0       34 3   0       200           bff22040             sdmmc0 mmctaskq   
 0       25 3   0       200           bff23900               iic0 iicintr 
 0       24 3   1       200           bff23bc0            atabus0 atath  
 0       23 3   0       200           bff66020         usbtask-dr usbtsk
 0       22 3   0       200           bff662e0         usbtask-hc usbtsk
 0       21 3   1       200           bff665a0            xcall/1 xcall 
 0       20 1   1       200           bff66860          softser/1      
 0       19 1   1       200           bff66b20          softclk/1
 0       18 1   1       200           bff66de0          softbio/1
 0       17 1   1       200           bff670a0          softnet/1
 0       16 1   1       201           bff67360             idle/1
 0       15 3   1       200           bff67620         pmfsuspend pmfsuspend
 0       14 3   1       200           bff678e0           pmfevent pmfevent  
 0       13 3   0       200           bff67ba0         sopendfree sopendfr
 0       12 3   1       200           bff94000           nfssilly nfssilly
 0       11 3   0       200           bff942c0            cachegc cachegc 
 0       10 3   0       200           bff94580              vrele vrele  
 0        9 3   0       200           bff94840             vdrain vdrain
 0        8 3   0       200           bff94b00          modunload mod_unld
 0        7 3   0       200           bff94dc0            xcall/0 xcall   
 0        6 1   0       200           bff95080          softser/0      
 0        5 1   0       200           bff95340          softclk/0
 0        4 1   0       200           bff95600          softbio/0
 0        3 1   0       200           bff958c0          softnet/0
 0        2 1   0       201           bff95b80             idle/0
 0        1 3   0       200           8044acc0            swapper uvm

 db{0}> bt                                                           
 0xbfc2db4c: netbsd:comintr+0xc
 0xbfc2db7c: netbsd:pic_dispatch+0xe8
 0xbfc2dbd4: netbsd:armgic_irq_handler+0xd4
 0xbfc2dc44: netbsd:irq_entry+0x60         
 0xbfc2dc94: netbsd:mi_switch+0x314
 0xbfc2dcc4: netbsd:sleepq_block+0xb4
 0xbfc2dd04: netbsd:mtsleep+0x138    
 0xbfc2dd24: netbsd:uvm_wait+0x7c
 0xbfc2dd74: netbsd:uvm_km_kmem_alloc+0x270
 0xbfc2dd8c: netbsd:pool_page_alloc+0x3c   
 0xbfc2ddcc: netbsd:pool_grow+0x38      
 0xbfc2de04: netbsd:pool_get+0x78 
 0xbfc2de4c: netbsd:pool_cache_get_slow+0x224
 0xbfc2de84: netbsd:pool_cache_get_paddr+0x210
 0xbfc2deac: netbsd:kmem_intr_alloc+0x68      
 0xbfc2df0c: netbsd:sys_posix_spawn+0x14c
 0xbfc2df7c: netbsd:syscall+0x88         
 0xbfc2dfac: netbsd:swi_handler+0xa0
 db{0}> mach cpu 1                  
 kdb_trap: switching to cpu1
 Stopped in pid 1386.1 (cron) at netbsd:pmap_pai_check.constprop.5+0x38: und     e
 1560003
 db{1}> bt
 0xbf773c34: netbsd:pmap_pai_check.constprop.5+0xc
 0xbf773c84: netbsd:pmap_tlb_asid_acquire+0x6c    
 0xbf773ca4: netbsd:pmap_activate+0x7c        
 0xbf773cf4: netbsd:mi_switch+0x20c   
 0xbf773d24: netbsd:sleepq_block+0xb4
 0xbf773d64: netbsd:mtsleep+0x138    
 0xbf773d84: netbsd:uvm_wait+0x7c
 0xbf773db4: netbsd:pmap_create+0x94
 0xbf773ddc: netbsd:uvmspace_init+0x6c
 0xbf773e04: netbsd:uvmspace_alloc+0x44
 0xbf773e34: netbsd:uvmspace_fork+0x2c 
 0xbf773e4c: netbsd:uvm_proc_fork+0x24
 0xbf773ee4: netbsd:fork1+0x330       
 0xbf773f0c: netbsd:sys_fork+0x38
 0xbf773f7c: netbsd:syscall+0x88 
 0xbf773fac: netbsd:swi_handler+0xa0


 Martin

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-arm/49364 (arm kernel panics on exec)
Date: Sun, 9 Nov 2014 12:05:37 +0100

 This turns out to be PR kern/49175 again - the test complets (actually
 fails, but that is a different issue) in 110 seconds (fast than I expected,
 I really *like* this hardware) and then during cleanup wapbl strikes and
 kills the machine for minutes.

 Martin

State-Changed-From-To: feedback->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Sun, 09 Nov 2014 11:10:59 +0000
State-Changed-Why:
Fixed


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49364 CVS commit: [netbsd-7] src/sys/arch/arm
Date: Mon, 10 Nov 2014 19:57:27 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Nov 10 19:57:26 UTC 2014

 Modified Files:
 	src/sys/arch/arm/arm [netbsd-7]: cpufunc_asm_armv7.S
 	src/sys/arch/arm/arm32 [netbsd-7]: bus_dma.c pmap.c
 	src/sys/arch/arm/pic [netbsd-7]: pic.c

 Log Message:
 Pull up following revision(s) (requested by skrll in ticket #209):
 	sys/arch/arm/pic/pic.c: revision 1.25
 	sys/arch/arm/arm/cpufunc_asm_armv7.S: revision 1.21
 	sys/arch/arm/arm32/pmap.c: revision 1.312
 	sys/arch/arm/arm32/bus_dma.c: revision 1.89
 	sys/arch/arm/arm32/pmap.c: revision 1.313
 	sys/arch/arm/arm32/pmap.c: revision 1.314
 	sys/arch/arm/arm32/pmap.c: revision 1.315
 	sys/arch/arm/arm32/pmap.c: revision 1.316
 Include opt_multiprocessor.h
 When allocing a l1page, if a page isn't available, use uvm_wait to wait
 for one to become available.  Should fix PR/49364.
 Post a dmb before invalidating the cache in the post-{read,write}
 operations to ensure that any/all cachelines brought in via speculation
 are really flushed.
 Ensure all memory operations are complete by before wfi. For example, the
 cpu could have just been in uvm_pageidlezero.
 In pmap_fault_fixup re-instate the TLB flush for the shared L1 case that
 occurs for non-ARM_MMU_EXTENDED kernels.
 This fixes rump/rumpkern/t_sp:stress_killer on rpi which is currently
 non-ARM_MMU_EXTENDED
 Remove an unnecessary flush that sneaked in as part of break-before-make
 change.
 Remove an XXXNH comment.
 Update PTE_SYNC_CURRENT to add a dsb for armv7 - part of the
 break-before-make fix.


 To generate a diff of this commit:
 cvs rdiff -u -r1.18.2.1 -r1.18.2.2 src/sys/arch/arm/arm/cpufunc_asm_armv7.S
 cvs rdiff -u -r1.86 -r1.86.2.1 src/sys/arch/arm/arm32/bus_dma.c
 cvs rdiff -u -r1.295.2.2 -r1.295.2.3 src/sys/arch/arm/arm32/pmap.c
 cvs rdiff -u -r1.22.2.1 -r1.22.2.2 src/sys/arch/arm/pic/pic.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.