fix(libc): keep the app0.zar state through exit handlers

Every path resolution reaches the app0.zar state, which was a
function-local static: it is destroyed during exit before the handlers
registered ahead of its first use run, so a path resolved in such a
handler locked a destroyed mutex. glibc lets that pass; macOS fails it
with EINVAL, and guest_path_lifetime failed there. The state is now
allocated once and never destroyed, as the working directory state
beside it already is.
This commit is contained in:
mugurc committed 2026-10-18 16:03:19 +03:00
1 parent 385ed71f2c
commit d10c1b43ba
1 file changed
+2 -2
+2 -2
View File
@@ -22,8 +22,8 @@ struct Archive {
};
Archive& State() {
static Archive archive;
return archive;
static auto* archive = new Archive;
return *archive;
}
bool SameComponent(std::string_view left, std::string_view right) {