A panic solidcore's guard catches reaches the engine as EngineError::Internal

smlib's run() catches a solidcore panic and replaces the kernel (kept: the app does not die
natively), returning Error::Internal; the kernel turned it into KernelError::Failed and the
engine into Other, so hostile_params_never_panic and the fuzzer no longer saw kernel panics.
Now the kernel's wrapper errors go through KernelError::smlib, which keeps Internal; a body the
wrapper could not take because of a panic is Internal too. A feature whose evaluation hit it
records the result as internal (not cached: the kernel was replaced), and the command that
made it, or any command whose kernel call returns it, fails with EngineError::Internal under
its own id. Crash reports mark a panic inside a solidcore call recovered (kernel::guarded), and
the crash test's kernel mode panics inside a solidcore call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
This commit is contained in:
jyviko
2026-11-02 21:39:02 -05:00
parent d9310b2389
commit ac3e6e0105
28 changed files with 180 additions and 51 deletions
+1 -3
View File
@@ -131,9 +131,7 @@ fn crash_test(_: &mut Session, p: &Value) -> Result<Value> {
match str_(p, "mode") {
Some("panic") => std::panic::panic_any(String::from("crash test: an internal error in a command")),
Some("kernel") => {
solidcraft_kernel::guard("crash test", || -> solidcraft_kernel::Result<()> {
std::panic::panic_any(String::from("an internal error in the kernel"))
})?;
solidcraft_kernel::crash_test()?;
Err(EngineError::Other("crash test: the kernel error was not caught".into()))
}
Some("abort") => std::process::abort(),
+4 -2
View File
@@ -826,8 +826,10 @@ fn add_feature_in(s: &mut Session, p: &Value, kind: FeatureKind, world: bool) ->
}
}
let r = s.model.result(id).cloned();
if let Some(e) = r.as_ref().and_then(|r| r.error.clone()) {
return Err(EngineError::Other(e));
if let Some(r) = &r
&& let Some(e) = r.error.clone()
{
return Err(EngineError::of_feature(r, e));
}
let st = s.model.state();
let bodies: Vec<&str> = st.bodies.iter().map(|b| b.name.as_str()).collect();