Page MenuHomeFreeBSD

mbuf: add mbuf information to KASSERTs
ClosedPublic

Authored by bz on Apr 13 2025, 11:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 7, 1:50 AM
Unknown Object (File)
Wed, May 27, 7:46 AM
Unknown Object (File)
Wed, May 27, 4:52 AM
Unknown Object (File)
Tue, May 26, 11:57 PM
Unknown Object (File)
Tue, May 26, 1:16 PM
Unknown Object (File)
May 15 2026, 7:02 AM
Unknown Object (File)
May 13 2026, 1:20 AM
Unknown Object (File)
Apr 29 2026, 7:04 AM
Subscribers

Details

Summary

Be more consistent about printing the mbuf pointer in KASSERT messages.
This massively helps debugging and we were already doing a good job at
it.

Also replace some handrolled KASSERTs with M_ASSERTPKTHDR() for fewer
copies of the check logic.

In m_align() move the msg into the KASSERT given after it was moved
here in ed6a66ca6c206 the msg is only used in one place.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

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

Event Timeline

bz requested review of this revision.Apr 13 2025, 11:11 PM
glebius added a subscriber: glebius.

Thanks! Definitely will speed up analyzing crashes when debugger fails to figure out which register holds the pointer.

This revision is now accepted and ready to land.Apr 14 2025, 6:53 PM
zlei added a subscriber: zlei.

Looks good to me.

This revision was automatically updated to reflect the committed changes.