Page MenuHomeFreeBSD

mtx: Make idle thread assertions more robust
AcceptedPublic

Authored by jhb on Tue, Mar 11, 1:38 AM.

Details

Reviewers
kib
markj
olce
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 62863
Build 59747: arc lint + arc unit

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.Tue, Mar 11, 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.