Page MenuHomeFreeBSD

ddb: make db_error reliably no-return
ClosedPublic

Authored by rlibby on Jul 8 2024, 3:59 PM.
Tags
None
Referenced Files
F97647007: D45918.diff
Mon, Sep 30, 1:54 PM
Unknown Object (File)
Fri, Sep 27, 3:39 AM
Unknown Object (File)
Fri, Sep 27, 3:03 AM
Unknown Object (File)
Fri, Sep 27, 12:48 AM
Unknown Object (File)
Thu, Sep 19, 9:56 PM
Unknown Object (File)
Sun, Sep 8, 7:06 PM
Unknown Object (File)
Sun, Sep 8, 5:41 AM
Unknown Object (File)
Sun, Sep 8, 5:26 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.