NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/57833: kernel panic on xorg exit





El 13/1/24 a las 1:40, David H. Gutteridge escribió:
The following reply was made to PR kern/57833; it has been noted by GNATS.

From: "David H. Gutteridge" <david%gutteridge.ca@localhost>
To: Gnats Bugs <gnats-bugs%netbsd.org@localhost>
Cc: Taylor R Campbell <riastradh%netbsd.org@localhost>
Subject: Re: kern/57833: kernel panic on xorg exit
Date: Fri, 12 Jan 2024 19:37:16 -0500

  On 2024-01-12 17:52, Ramiro Aceves wrote:
  > El 12/1/24 a las 0:05, David H. Gutteridge escribió:
  >
  >> The following reply was made to PR kern/57833; it has been noted by
  >> GNATS.
  >>
  >> From: "David H. Gutteridge" <david%gutteridge.ca@localhost>
  >> To: Taylor R Campbell <riastradh%netbsd.org@localhost>
  >> Cc: gnats-bugs%netbsd.org@localhost
  >> Subject: Re: kern/57833: kernel panic on xorg exit
  >> Date: Thu, 11 Jan 2024 18:04:44 -0500
  >>
  >> --=_79cd473ca3d4e19fbe52c232ee5dd792
  >> Content-Transfer-Encoding: 7bit
  >> Content-Type: text/plain; charset=US-ASCII;
  >> format=flowed
  >> On 2024-01-10 23:37, Taylor R Campbell wrote:
  >>> Can you also try the attached patch, instead of the other one, to see
  >>> what happens?
  >>>
  >>> (This might break things more spectacularly -- I haven't thought
  >>> about
  >>> whether it makes a lot of sense -- but it should at least prevent the
  >>> particular crash you observed, if we ever get that far with it.)
  >> I've supplied a debug log. (It can be found at:
  >> https://www.netbsd.org/~gutteridge/pr57833_debug.log .)
  >> Applying the first (small) patch did not prevent the panics. But the
  >> larger patch did fix the problem for me. There was a slight coding
  >> error with the second patch (wrong label for a goto statement), so it
  >> didn't compile as-is. I've attached a revised patch that fixes that
  >> one
  >> line, should anyone else want to test this.
  >> Thanks,
  >> Dave
  >
  > Hello Dave, thanks for feedback. Here I had the same problem, I applied
  > the patch and could not compile the kernel  because en error in 555
  > line when compiling i915_gem_stolen.c file. I changed
  >
  > goto err;
  >
  > to
  >
  > goto out;
  >
  > (not sure if that is the right fix)
Yes, it is. > File compiled ok. Rebuilt the kernel and I had the same panic the first
  > time abandoned Xorg session.
There must be something different about your hardware than mine here,
  then. (Mine is Intel 945GME.) The patch did work for me, but I guess
  there's more to it.
Do you have a build that includes a netbsd.gdb file? If not, you can
  generate one (e.g., for your patched kernel) by un-commenting the
  line
makeoptions DEBUG="-g" in your kernel config file (I assume GENERIC?) and re-building. The
  extra file should appear.
Then we would have the means to get the other details Taylor is looking
  for here (see the email from Thu, 11 Jan 2024 03:45UTC).
Dave PS Sorry I was not able to send you a patch again earlier. GMail is not
  accepting email from my domain, so my email bounced. Evidently my emails
  do make it when funnelled through GNATS.

Hello,

This is the last recorded crash after Taylor's patch and compiling the kernel with debugging symbols ad David suggested:

netbsd-compal# dmesg -M /var/crash/netbsd.7.core -N /var/crash/netbsd.7

...
...
     4.324510] uhid1 at uhidev1 reportid 3: input=2, output=0, feature=0
[    16.564698] wsdisplay0: screen 1 added (default, vt100 emulation)
[    16.564698] wsdisplay0: screen 2 added (default, vt100 emulation)
[    16.564698] wsdisplay0: screen 3 added (default, vt100 emulation)
[    16.564698] wsdisplay0: screen 4 added (default, vt100 emulation)
[   234.752732] uvm_fault(0xc151c400, 0xdd4e8000, 1) -> 0xe
[   234.752732] fatal page fault in supervisor mode
[ 234.752732] trap type 6 code 0 eip 0xc0b02ece cs 0x8 eflags 0x13287 cr2 0xdd4e8000 ilevel 0x8 esp 0x4bb1a000
[   234.752732] curlwp 0xc4341600 pid 0 lid 63 lowest kstack 0xdc7e02c0
[   234.752732] panic: trap
[   234.752732] cpu0: Begin traceback...
[ 234.752732] vpanic(c1186d04,dc7e1d7c,dc7e1e38,c012fed8,c1186d04,dc7e1e44,dc7e1e44,3f,dc7e02c0,13287) at netbsd:vpanic+0x196 [ 234.752732] panic(c1186d04,dc7e1e44,dc7e1e44,3f,dc7e02c0,13287,dd4e8000,8,4bb1a000,c157e960) at netbsd:panic+0x18
[   234.752732] trap() at netbsd:trap+0xd51
[   234.752732] --- trap (number 6) ---
[ 234.752732] drm_clflush_virt_range(dd4e8000,1000,0,1000,0,0,c147c8c0,dd4e8000,db6ff000,c5c423c0) at netbsd:drm_clflush_virt_range+0x3f [ 234.752732] i915_gem_object_put_pages_phys(c5c15900,c5c222c4,c5c15900,c5c15900,4,dc7e1f48,c06cd688,c5c15900,54,0) at netbsd:i915_gem_object_put_pages_phys+0x15a [ 234.752732] __i915_gem_object_put_pages(c5c15900,54,0,c0c5dd4f,0,0,c3dff878,0,c5c159b0,c5c159ac) at netbsd:__i915_gem_object_put_pages+0x70 [ 234.752732] __i915_gem_free_objects(c3dfea1c,c42a2f00,0,0,120,c4341600,c42a2f1c,dc7e1f78,c42a2f04,c42a2f1c) at netbsd:__i915_gem_free_objects+0x104 [ 234.752732] linux_workqueue_thread(c42a2f00,1848000,1853000,0,c01005a8,0,0,0,0,0) at netbsd:linux_workqueue_thread+0xe6
[   234.752732] cpu0: End traceback...

[   234.752732] dumping to dev 0,1 offset 1023
[   234.752732] dump
netbsd-compal#


netbsd-compal# gdb /usr/src/sys/arch/i386/compile/MYKERNEL/netbsd.gdb
GNU gdb (GDB) 11.0.50.20200914-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "i486--netbsdelf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/src/sys/arch/i386/compile/MYKERNEL/netbsd.gdb...
(gdb) target kvm /var/crash/netbsd.7.core
0xc012d6ed in maybe_dump (howto=260) at ../../../../arch/i386/i386/machdep.c:725
725			dumpsys();
(gdb) frame 0
#0 0xc012d6ed in maybe_dump (howto=260) at ../../../../arch/i386/i386/machdep.c:725
725			dumpsys();
(gdb) frame 1
#1 cpu_reboot (howto=howto@entry=260, bootstr=bootstr@entry=0x0) at ../../../../arch/i386/i386/machdep.c:746
746		maybe_dump(howto);
(gdb) frame 2
#2 0xc0c85e17 in kern_reboot (howto=howto@entry=260, bootstr=bootstr@entry=0x0) at ../../../../kern/kern_reboot.c:73
73		cpu_reboot(howto, bootstr);
(gdb) frame 3
#3 0xc0cbc9d8 in vpanic (fmt=fmt@entry=0xc1186d04 "trap", ap=0xdc7e1d7c "D\036~\334D\036~\334?")
    at ../../../../kern/subr_prf.c:291
291		kern_reboot(bootopt, NULL);
(gdb) frame 4
#4 0xc0cbca91 in panic (fmt=fmt@entry=0xc1186d04 "trap") at ../../../../kern/subr_prf.c:208
208		vpanic(fmt, ap);
(gdb) frame 5
#5 0xc012fed8 in trap (frame=0xdc7e1e44) at ../../../../arch/i386/i386/trap.c:358
358			panic("trap");
(gdb) frame 6
#6  0xc012529b in alltraps ()
(gdb) frame 7
#7  0xdc7e1e44 in ?? ()
(gdb) frame 8
#8 0xc06cf74c in i915_gem_object_put_pages_phys (obj=<optimized out>, pages=<optimized out>)
    at ../../../../external/bsd/drm2/dist/drm/i915/gem/i915_gem_phys.c:206
206				drm_clflush_virt_range(src, PAGE_SIZE);
(gdb)
#8 0xc06cf74c in i915_gem_object_put_pages_phys (obj=<optimized out>, pages=<optimized out>)
    at ../../../../external/bsd/drm2/dist/drm/i915/gem/i915_gem_phys.c:206
206				drm_clflush_virt_range(src, PAGE_SIZE);
(gdb) info locals
page = 0x40
dst = 0xdb6ff000 "\377\377\377\377\377\377\377\377"
mapping = <optimized out>
src = 0xdd4e8000
i = <optimized out>
dmat = <optimized out>
vaddr = <optimized out>
(gdb) frame 9
#9  0xc06cf1b2 in __i915_gem_object_put_pages (obj=obj@entry=0xc5c15900)
    at ../../../../external/bsd/drm2/dist/drm/i915/gem/i915_gem_pages.c:246
246			obj->ops->put_pages(obj, pages);
(gdb) info locals
pages = <optimized out>
err = <optimized out>
(gdb) frame 10
#10 0xc06cd688 in __i915_gem_free_objects (i915=0xc3dfd004, freed=<optimized out>) at ../../../../external/bsd/drm2/dist/drm/i915/gem/i915_gem_object.c:257
257			__i915_gem_object_put_pages(obj);
(gdb) info locals
mmo = <optimized out>
mn = <optimized out>
obj = 0xc5c15900
on = 0x0
wakeref = <optimized out>
(gdb) frame 11
#11 0xc0aef695 in linux_workqueue_thread (cookie=0xc42a2f00) at ../../../../external/bsd/common/linux/linux_work.c:455
455					(*func)(work);
(gdb) info locals
func = 0xc06cd7f2 <__i915_gem_free_work>
wq = 0xc42a2f00
q = {0x0, 0xc42a2f24}
marker = {work_owner = 3291047360, work_entry = {tqe_next = 0x0, tqe_prev = 0xc42a2f1c}, func = 0xc42a2f00}
work = 0xc3dfea1c
i = <optimized out>
(gdb) frame 12
#12 0xc0102011 in lwp_trampoline ()
(gdb) info locals
No symbol table info available.
(gdb) frame 13
No frame at level 13.
(gdb)

Ramiro.






Home | Main Index | Thread Index | Old Index