From owner-freebsd-current@freebsd.org Tue Jan 12 11:33:04 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E7A04D3DCF for ; Tue, 12 Jan 2021 11:33:04 +0000 (UTC) (envelope-from jakob@alvermark.net) Received: from out.alvermark.net (out.alvermark.net [185.34.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFT3335X2z4q1J for ; Tue, 12 Jan 2021 11:33:03 +0000 (UTC) (envelope-from jakob@alvermark.net) Received: from c-f649235c.06-431-73746f70.bbcust.telenor.se ([92.35.73.246] helo=mail.alvermark.net) by out.alvermark.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1kzHux-0002eN-5U; Tue, 12 Jan 2021 12:32:55 +0100 Received: from [192.168.67.33] by mail.alvermark.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1kzHuw-000J8b-HQ; Tue, 12 Jan 2021 12:32:54 +0100 Subject: Re: Panic after updating From: Jakob Alvermark To: Hans Petter Selasky , FreeBSD Current References: <87512669-f0b9-eb2f-1103-170a29384ea8@alvermark.net> <34a9dafd-9690-1b33-abf8-017ad31cf2ab@alvermark.net> <60e4db60-c816-463e-0e08-a33c674ad4da@alvermark.net> Message-ID: Date: Tue, 12 Jan 2021 12:32:54 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.4.1 MIME-Version: 1.0 In-Reply-To: <60e4db60-c816-463e-0e08-a33c674ad4da@alvermark.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 4DFT3335X2z4q1J X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[alvermark.net:s=x]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:185.34.136.138]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[alvermark.net: no valid DMARC record]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; SPAMHAUS_ZRD(0.00)[185.34.136.138:from:127.0.2.255]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[alvermark.net:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[185.34.136.138:from]; ASN(0.00)[asn:34971, ipnet:185.34.136.0/24, country:IT]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-current] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 11:33:04 -0000 On 1/12/21 9:33 AM, Jakob Alvermark wrote: > > On 1/11/21 7:08 PM, Hans Petter Selasky wrote: >> On 1/11/21 5:24 PM, Jakob Alvermark wrote: >>> >>> On 1/11/21 1:14 PM, Hans Petter Selasky wrote: >>>> On 1/11/21 11:12 AM, Jakob Alvermark wrote: >>>>> >>>>> Updated my Acer laptop from r367734 to main-c255666-g1790f5e654f >>>>> >>>>> >>>>> Rebooting with the newly build kernel i get this panic. >>>>> >>>>> >>>>> Fatal    trap 12: page fault while in kernel mode >>>>> >>>>> cpuid    = 1; apic id = 02 >>>>> fault    virtual address     = 0x1030000 >>>>> fault    code                = supervisor read data, >>>>> >>>>> instruction    pointer       = 0x20:0xffffffff809e5265 >>>>> stack    pointer             = 0x28:0xffffffff8281db70 >>>>> frame    pointer             = 0x28:0xffffffff8281db70 >>>>> code    segment              = base 0x0, limit 0xfffff, type 0x1b >>>>> =    DPL 0, pres 1, long 1, def32 0, gran 1 >>>>> processor    eflags  = interrupt enabled, resume, IOPL = 0 >>>>> current    process           = 12 (irq88: xhci0) >>>>> trap    number               = 12 >>>>> panic:    page fault >>>>> cpuid    = 1 >>>>> time    = 2 >>>>> KDB:    stack backtrace: >>>>> db_trace_self_wrapper()    at db_trace_self_wrapper+0x2b/frame >>>>> 0xffffffff8281d820 >>>>> vpanic()    at vpanic+0x181/frame 0xffffffff8281d870 >>>>> panic()    at panic+0x43/frame 0xffffffff8281d8d0 >>>>> trap_fatal()    at trap_fatal+0x387/frame 0xffffffff8281d930 >>>>> trap_pfault()    at trap_pfault+0x4f/frame 0xffffffff8281d990 >>>>> trap()    at trap+0x280/frame 0xffffffff8281daa0 >>>>> calltrap()    at calltrap+0x8/frame 0xffffffff8281daa0 >>>>> ---    trap 0xc, rip = 0xffffffff809e5265, rsp = >>>>> 0xffffffff8281db70, rbp = 0xffffffff8281db70 --- >>>>> usbd_get_page()    at usbd_get_page+0x65/frame 0xffffffff8281db70 >>>>> xhci_interrupt_poll()    at xhci_interrupt_poll+0x29/frame >>>>> 0xffffffff8281dc20 >>>>> xhci_interrupt()    at xhci_interrupt+0x11a/frame 0xffffffff8281dc60 >>>>> ithread_loop()    at ithread_loop+0x24f/frame 0xffffffff8281dcf0 >>>>> fork_exit()    at fork_exit+0x7e/frame 0xffffffff8281dd30 >>>>> fork_trampoline()    at fork_trampoline+0xe/frame 0xffffffff8281dd30 >>>>> ---    trap 0, rip = 0, rsp = 0, rbp = 0 --- >>>>> KDB:    enter: panic >>>>> >>>>> >>>>> Any help appreciated. >>>> >>>> Hi, >>>> >>>> If you could bi-sect that panic, would be great. >>>> >>>> Else install gdb from ports and run: >>>> >>>> kgdb101 >>>> >>>> info line *(usbd_get_page+0x65) >>>> >>>> >>> >>> Having just learned how to bisect (thanks Warner for the mini >>> primer) this is the result: >>> >>> de0b2d4f47bad36025dcf52755ce76cca6e715d9 is the first bad commit >>> >> >> You mean this commit is causing the panic? >> >>> git show de0b2d4f47bad36025dcf52755ce76cca6e715d9 >>> commit de0b2d4f47bad36025dcf52755ce76cca6e715d9 >>> Author: Mateusz Guzik >>> Date:   Sun Dec 13 21:30:42 2020 +0000 >>> >>>     Patch annotation in sigdeferstop >>>         Probability flipped since sigdefer handling was moved away >>> from regular VOP >>>     calls. >>> >>> Notes: >>>     svn path=/head/; revision=368616 >>> >>> diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h >>> index 93ef15bbbf0..df761a1e1a5 100644 >>> --- a/sys/sys/signalvar.h >>> +++ b/sys/sys/signalvar.h >>> @@ -367,7 +367,7 @@ static inline int >>>  sigdeferstop(int mode) >>>  { >>> >>> -       if (__predict_true(mode == SIGDEFERSTOP_NOP)) >>> +       if (__predict_false(mode == SIGDEFERSTOP_NOP)) >>>                 return (SIGDEFERSTOP_VAL_NCHG); >>>         return (sigdeferstop_impl(mode)); >>>  } > It appears so. Mind you, this is the first time I have done a bisect, > I may have made a mistake. >> >> And: >> >> git show de0b2d4f47bad36025dcf52755ce76cca6e715d9 | patch -p1 -R >> >> gets you a working kernel? >> > No... So I probably made a mistake in bisecting. I will try again. > Alright, after a new bisect run I got a different result, so I most likely did something wrong the first time. ff3468ac94597efdcbc56f372528dfc98b114dac is the first bad commit commit ff3468ac94597efdcbc56f372528dfc98b114dac Author: Ian Lepore Date:   Sat Dec 12 18:34:15 2020 +0000     Provide userland notification of gpio pin changes ("userland gpio interrupts"). Maybe more likely this is causing the panic? Jakob