NetBSD Problem Report #56074

From  Thu Mar 25 13:09:41 2021
Return-Path: <>
Received: from ( [])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id BE59A1A9217
	for <>; Thu, 25 Mar 2021 13:09:41 +0000 (UTC)
Message-Id: <>
Date: Thu, 25 Mar 2021 14:09:38 +0100 (CET)
Subject: Kernel panic in uvm_pglist_alloc_contig_agressive with uvideo
X-Send-Pr-Version: 3.95

>Number:         56074
>Category:       kern
>Synopsis:       Kernel panic in uvm_pglist_alloc_contig_agressive with uvideo
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 25 13:10:01 +0000 2021
>Last-Modified:  Wed Dec 22 08:05:39 +0000 2021
>Originator:     Reinoud Zandijk
>Release:        NetBSD 9.99.80


System: NetBSD 9.99.80 NetBSD 9.99.80 (GENERIC) #2: Wed Feb 24 22:15:49 CET 2021 amd64
Architecture: x86_64
Machine: amd64

When trying out my USB camera in Firefox for a test-meeting the kernel
paniced. It had been running fine for some days. It was attached on:


addr 1: EHCI root hub, NetBSD
 addr 2: product 005a, NEC
  addr 3: product 0825, Logitech

The gdb trace gives:

(gdb) target kvm netbsd.175.core
0xffffffff802261d5 in cpu_reboot (howto=howto@entry=260,
bootstr=bootstr@entry=0x0) at
713                     dumpsys();
(gdb) where
#0  0xffffffff802261d5 in cpu_reboot (howto=howto@entry=260, bootstr=bootstr@entry=0x0) at

#1  0xffffffff80caefe1 in kern_reboot (howto=howto@entry=260, bootstr=bootstr@entry=0x0) at

#2  0xffffffff80ceedfd in vpanic (fmt=fmt@entry=0xffffffff81346626 "trap", ap=ap@entry=0xffffa10109d79588) at

#3  0xffffffff80ceeec2 in panic (fmt=fmt@entry=0xffffffff81346626 "trap") at /usr/sources/

#4  0xffffffff80228ee1 in trap (frame=0xffffa10109d796d0) at /usr/sources/

#5  0xffffffff802210e3 in alltraps ()

#6  0xffffffff80c69a8c in uvm_pglistalloc_contig_aggressive (rlist=0xffffa10109d79930, boundary=0, alignment=4096, high=4294967296, low=16777216, num=60) at

#7  uvm_pglistalloc_contig (waitok=1, rlist=0xffffa10109d79930, boundary=0, alignment=4096, high=4294967296, low=16777216, num=<optimized out>) at

#8  uvm_pglistalloc (size=size@entry=245760, low=low@entry=16777216, high=high@entry=4294967296, alignment=<optimized out>, alignment@entry=4096, boundary=0, rlist=rlist@entry=0xffffa10109d79930, nsegs=nsegs@entry=59, waitok=waitok@entry=1) at

#9  0xffffffff8052d385 in _bus_dmamem_alloc_range (size=245760, alignment=alignment@entry=4096, boundary=0, segs=segs@entry=0xffff8a717c6da500, nsegs=59, rsegs=0xffff8a717c6da4f8, flags=flags@entry=0, low=16777216, high=4294967296, t=0xffff8a717c6da500) at

#10 0xffffffff8052d9e5 in _bus_dmamem_alloc (t=0xffff8a717c6da500, t=0xffff8a717c6da500, flags=0, rsegs=0xffff8a717c6da4f8, nsegs=<optimized out>, segs=0xffff8a717c6da500, boundary=<optimized out>, alignment=4096, size=18446614818756341760) at

#11 _bus_dma_alloc_bouncebuf (t=t@entry=0xffffffff81844d60 <pci_bus_dma_tag>, map=map@entry=0xffff8a7072c30808, size=size@entry=245760, flags=flags@entry=0)
    at /usr/sources/

#12 0xffffffff8052dfa1 in _bus_dmamap_create (dmamp=0xffff8a6f5d0c7408, flags=0, boundary=0, maxsegsz=245760, nsegments=59, size=245760, t=0xffffffff81844d60 <pci_bus_dma_tag>)
    at /usr/sources/

#13 bus_dmamap_create (t=t@entry=0xffffffff81844d60 <pci_bus_dma_tag>, size=245760, nsegments=59, maxsegsz=245760, boundary=boundary@entry=0, flags=flags@entry=0, dmamp=dmamp@entry=0xffff8a6f5d0c7408)
    at /usr/sources/

#14 0xffffffff8046416a in usb_block_allocmem (tag=tag@entry=0xffffffff81844d60 <pci_bus_dma_tag>, size=size@entry=245760, align=align@entry=0, flags=flags@entry=1, dmap=dmap@entry=0xffff8a7167a8c230)
    at /usr/sources/

#15 0xffffffff80464363 in usb_allocmem (bus=<optimized out>, size=245760, align=align@entry=0, flags=1, p=0xffff8a7167a8c230) at

#16 0xffffffff8045f153 in usbd_alloc_buffer (size=244800, xfer=0xffff8a7167a8c1b8) at

#17 usbd_create_xfer (pipe=0xffff8a7182d54900, len=len@entry=244800, flags=flags@entry=0, nframes=80, xp=xp@entry=0xffff8a711a1b69f8) at

#18 0xffffffff804850ce in uvideo_stream_start_xfer (vs=0xffff8a711a1b6940) at /usr/sources/

#19 uvideo_start_transfer (addr=<optimized out>) at

#20 0xffffffff80d86c5c in video_stream_on (sc=sc@entry=0xffff8a70cf481d00, type=<optimized out>) at

#21 0xffffffff80d87d97 in video_stream_on (type=<optimized out>, sc=0xffff8a70cf481d00) at

#22 videoioctl (dev=<optimized out>, cmd=2147767826, data=0xffffa10109d79ee0, flag=7, l=<optimized out>) at

#23 0xffffffff80cdb6bf in cdev_ioctl (dev=49408, cmd=2147767826, data=0xffffa10109d79ee0, flag=7, l=0xffff8a719ab7ea40) at

#24 0xffffffff80d64d8f in VOP_IOCTL (vp=vp@entry=0xffff8a6ffa5077c0, command=command@entry=2147767826, data=data@entry=0xffffa10109d79ee0, fflag=<optimized out>, cred=<optimized out>)
    at /usr/sources/

#25 0xffffffff80d5bcac in vn_ioctl (fp=0xffff8a6ff9ec8680, com=2147767826, data=0xffffa10109d79ee0) at

#26 0xffffffff80d00504 in sys_ioctl (l=<optimized out>, uap=0xffffa10109d7a000, retval=<optimized out>) at

#27 0xffffffff8054713a in sy_call (rval=0xffffa10109d79fb0, uap=0xffffa10109d7a000, l=0xffff8a719ab7ea40, sy=0xffffffff81882f90 <sysent+1296>) at

#28 sy_invoke (code=54, rval=0xffffa10109d79fb0, uap=0xffffa10109d7a000, l=0xffff8a719ab7ea40, sy=0xffffffff81882f90 <sysent+1296>) at

#29 syscall (frame=0xffffa10109d7a000) at

#30 0xffffffff8020b25d in handle_syscall ()

Unknown, plugged in my uvideo device and used it



From: "Chuck Silvers" <>
Subject: PR/56074 CVS commit: src/sys/uvm
Date: Fri, 26 Mar 2021 09:35:18 +0000

 Module Name:	src
 Committed By:	chs
 Date:		Fri Mar 26 09:35:18 UTC 2021

 Modified Files:
 	src/sys/uvm: uvm_pglist.c

 Log Message:
 in uvm_pglistalloc_contig_aggressive(), avoid looking forward past
 the end of the target range of the physseg.
 fixes PR 56074.

 To generate a diff of this commit:
 cvs rdiff -u -r1.87 -r1.88 src/sys/uvm/uvm_pglist.c

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

State-Changed-From-To: open->feedback
State-Changed-When: Wed, 22 Dec 2021 08:05:39 +0000
OK to close?


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.