Page MenuHomeFreeBSD

ddb: make db_error reliably no-return
ClosedPublic

Authored by rlibby on Jul 8 2024, 3:59 PM.
Tags
None
Referenced Files
F102909490: D45918.id140693.diff
Mon, Nov 18, 3:18 PM
Unknown Object (File)
Oct 1 2024, 11:34 AM
Unknown Object (File)
Oct 1 2024, 7:17 AM
Unknown Object (File)
Oct 1 2024, 6:21 AM
Unknown Object (File)
Sep 30 2024, 7:31 PM
Unknown Object (File)
Sep 30 2024, 1:54 PM
Unknown Object (File)
Sep 27 2024, 3:39 AM
Unknown Object (File)
Sep 27 2024, 3:03 AM
Subscribers

Details

Summary

Most code assumes db_error does not return, but according to
kdb_reenter_silent, there may be cases where it could. Instead, panic
if kdb_reenter_silent returns and mark the routine as __dead2. This
addresses gcc warnings.

Diff Detail

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

Event Timeline

It seems that db_error() is the only caller of kdb_reenter_silent(). And then it might be better to panic in kdb_reenter_silent() instead, I am not sure. [To make kdb_reenter_silent() more strict]

In D45918#1046830, @kib wrote:

It seems that db_error() is the only caller of kdb_reenter_silent(). And then it might be better to panic in kdb_reenter_silent() instead, I am not sure. [To make kdb_reenter_silent() more strict]

I waffled on that. It seems like kdb_reenter_silent() was meant to be a version of kdb_reenter() without the prints, and kdb_reenter() has other callers... I also wondered if both kdb_reenter() and kdb_reenter_silent() should be no-return / panic. It seems the major difference would be whether we continue after not handling a trap when kdb_active but no kdb_jmpbufp is set. (Is that actually what we want? How does the happen? I'm unsure.) I went with just modifying db_error() as a change with less potential fallout.

This revision is now accepted and ready to land.Jul 8 2024, 8:10 PM
This revision was automatically updated to reflect the committed changes.