FreeBSDDesktop / DEPRECATED-freebsd-base-graphics

Fork of FreeBSD's base repository to work on graphics-stack-related projects
Other
49 stars 13 forks source link

realloc assert fail drm i915 #119

Closed johalun closed 7 years ago

johalun commented 7 years ago

World/kernel 2017-02-14. Ports: Portsnap 2017-02-13 except xorg-server+mesa 17+gtk30+weston which is from udev branch.

Crash when running X clients in Weston with drm backend.

#0  doadump (textdump=0) at pcpu.h:222
#1  0xffffffff82dd7037 in vt_kms_postswitch (arg=<value optimized out>) at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/modules/drm/drm/../../../dev/drm/linux_fb.c:82
#2  0xffffffff805a0f0b in vt_window_switch (vw=0xffffffff80eb88f8) at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/dev/vt/vt_core.c:540
#3  0xffffffff8059ea20 in vtterm_cngrab (tm=<value optimized out>) at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/dev/vt/vt_core.c:1465
#4  0xffffffff8069da32 in cngrab () at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/kern/kern_cons.c:368
#5  0xffffffff806f6d7a in vpanic (fmt=0xffffffff80bb3002 "realloc: called with spinlock or critical section held", ap=0xfffffe046481b010)
    at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/kern/kern_shutdown.c:765
#6  0xffffffff806f6c66 in kassert_panic (fmt=<value optimized out>) at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/kern/kern_shutdown.c:669
#7  0xffffffff806d3e69 in realloc (addr=0x0, size=32, mtp=0xffffffff82e3c520, flags=1) at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/kern/kern_malloc.c:608
#8  0xffffffff82e2f52a in reservation_object_get_fences_rcu (obj=0xfffff800075fe568, pfence_excl=0xfffffe046481b110, pshared_count=0xfffffe046481b124, pshared=0xfffffe046481b118)
    at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/modules/linuxkpi/../../compat/linuxkpi/common/src/linux_reservation.c:259
#9  0xffffffff82c95e49 in i915_sw_fence_await_reservation (fence=0xfffff8005545d3f8, resv=0xfffff800075fe568, exclude=0xffffffff82d37ac0, write=<value optimized out>, 
    timeout=10000, gfp=2) at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/modules/drm/i915/i915kms/../../../../dev/drm/i915/i915_sw_fence.c:320
#10 0xffffffff82c705da in i915_gem_do_execbuffer ()
    at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/modules/drm/i915/i915kms/../../../../dev/drm/i915/i915_gem_execbuffer.c:1154
#11 0xffffffff82c70de7 in i915_gem_execbuffer2 (dev=0xfffffe0002e58000, data=0xfffffe046481b570, linux_file=0xfffff80007bf9400)
    at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/modules/drm/i915/i915kms/../../../../dev/drm/i915/i915_gem_execbuffer.c:2014
#12 0xffffffff82dbef6e in drm_ioctl (filp=<value optimized out>, cmd=<value optimized out>, arg=<value optimized out>)
    at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/modules/drm/drm/../../../dev/drm/drm_ioctl.c:738
#13 0xffffffff82e2211a in linux_dev_ioctl (dev=<value optimized out>, cmd=3225445481, data=<value optimized out>, fflag=<value optimized out>, td=<value optimized out>)
    at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/modules/linuxkpi/../../compat/linuxkpi/common/src/linux_compat.c:1057
#14 0xffffffff805d0a43 in devfs_ioctl (ap=<value optimized out>) at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/fs/devfs/devfs_vnops.c:831
#15 0xffffffff80ae8c10 in VOP_IOCTL_APV (vop=<value optimized out>, a=<value optimized out>) at vnode_if.c:1067
#16 0xffffffff807c82e4 in vn_ioctl (fp=0xfffff80007a0d960, com=<value optimized out>, data=0xfffffe046481b880, active_cred=0xfffff80007777200, td=<value optimized out>)
    at vnode_if.h:448
#17 0xffffffff805d116f in devfs_ioctl_f (fp=<value optimized out>, com=<value optimized out>, data=<value optimized out>, cred=<value optimized out>, td=0xfffff800100b0000)
    at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/fs/devfs/devfs_vnops.c:789
#18 0xffffffff8075b200 in kern_ioctl (td=<value optimized out>, fd=<value optimized out>, com=<value optimized out>, data=<value optimized out>) at file.h:322
#19 0xffffffff8075ae9f in sys_ioctl (td=<value optimized out>, uap=0xfffffe046481ba30) at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/kern/sys_generic.c:748
#20 0xffffffff80a279b9 in amd64_syscall (td=0xfffff800100b0000, traced=0) at subr_syscall.c:135
#21 0xffffffff80a070eb in Xfast_syscall () at /usr/home/johannes/dev/freebsd/freebsd-base-graphics/sys/amd64/amd64/exception.S:396
#22 0x0000000802e90bda in ?? ()
hselasky commented 7 years ago

Can you re-test with the latest drm-next, after this patch:

Avoid use of critical_enter()/critical_exit() as much as possible.

johalun commented 7 years ago

Solved! Using drm-next 2017-02-17.