Re: [RFC PATCH v1 08/16] unwind_user: Enable archs that save RA/FP in other registers

From
Steven Rostedt <rostedt@goodmis.org>
Date
2025-07-17 03:57:39
Also in
bpf, lkml
Reply to
Josh Poimboeuf, 2025-07-17
On Wed, 16 Jul 2025 19:01:06 -0700
Josh Poimboeuf [off-list ref] wrote:
quoted
+		if (unwind_user_get_reg(&ra, frame->ra.regnum))
+			goto done;
+		break;
+	default:
+		WARN_ON_ONCE(1);
+		goto done;  
The default case will never happen, can we make it a BUG()?
Is this really serious enough to crash the system? WARN_ON_ONCE() *is* for
things that will never happen.

The only time I ever use BUG() is if it's too dangerous to continue (like a
function graph trampoline that gets corrupted and has no place to return
to). In general, usage of BUG() should be avoided.

-- Steve
Thread (42 messages) 42 messages, 4 authors, last reply 2025-08-01
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help