[Bug 276057] crash in xa_destroy() while initializing the i915kms module

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 13 Jan 2024 18:44:06 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276057

--- Comment #8 from Donn Seeley <donn@xmission.com> ---
(In reply to Konstantin Belousov from comment #2)
I had some time to look at this issue this morning.  Some questions:

  If you can't reinitialize a mutex, then what is the point of MTX_NEW?
  The mutex(9) man page says that MTX_NEW prevents an assertion from
  firing if you call mtx_init() on a mutex without calling mtx_destroy()
  first.  That language implies that you *can* safely call mtx_init() on
  a mutex that has been destroyed.

  If there's some reason why the witness code would have a problem with
  reinitializing a mutex, could we not just initialize the mutex with
  MTX_NOWITNESS?  I noticed that the FreeBSD emulation of Linux
  spinlocks uses MTX_NOWITNESS, and the xarray code in Linux uses a
  spinlock for protection, so there's some precedent here.

Comments, suggestions?

-- 
You are receiving this mail because:
You are the assignee for the bug.