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:
@@ -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(),
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user