Page MenuHomeFreeBSD

mtx: Make idle thread assertions more robust
ClosedPublic

Authored by jhb on Mar 11 2025, 1:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 26, 12:04 PM
Unknown Object (File)
Wed, Jun 25, 12:58 AM
Unknown Object (File)
Mon, Jun 23, 3:03 PM
Unknown Object (File)
Sun, Jun 22, 7:23 AM
Unknown Object (File)
Fri, Jun 20, 6:47 PM
Unknown Object (File)
Thu, Jun 19, 7:12 AM
Unknown Object (File)
Apr 30 2025, 4:17 AM
Unknown Object (File)
Apr 21 2025, 6:37 AM
Subscribers

Details

Summary

Just print the pointer to the mutex instead of the name in case the
mutex is corrupted.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/kern/kern_mutex.c
292

Don't you want to do the same thing here?

454

Ditto.

sys/kern/kern_mutex.c
292

Ignore me, I read the patches in the wrong order.

In principle, it might be not a sleep mutex.

This revision is now accepted and ready to land.Mar 11 2025, 12:59 PM

I suspect that not outputting the lock name (provided lock_object is not corrupted) is not a big deal for this assertion.

If you feel that could be a concern, here and in D49313 m->lock_object.lo_name could perhaps be replaced by a call to a tiny helper function that will check if the class of lock_object is valid and then only try to print the lock name on success (this is not an absolute guarantee, but may well be enough), else just print the address of m.

In D49314#1124614, @kib wrote:

In principle, it might be not a sleep mutex.

I suppose we could just say "mutex"

This revision was automatically updated to reflect the committed changes.