mirror of
https://github.com/HeyPuter/gex.git
synced 2026-11-13 18:34:21 -10:00
shim: a replaced library's startup code is not a console error
ld.so still runs a replaced object's .init, PLT stubs, crtbegin constructors/destructors and .fini; in every child node spawned by child_process these were reported (libz.so.1 +0x2340 .init, +0x2360 .plt, +0x272c/+0x2780 crtbegin, +0x14f3c .fini) as console errors, which web/test/site.mjs counts as failures. They touch only the library's own data and tier-1 runs them correctly; the note goes to the debug console. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_781bad2ec05143db9067c86b4b2678e2
This commit is contained in:
1 parent
5831efa7d8
commit
058ee461e9
1 file changed
+8
-2
@@ -158,13 +158,19 @@ pub(crate) fn bound(addr: u64) -> bool {
|
||||
}
|
||||
|
||||
/// A dispatch miss in a replaced library's own text that no binding
|
||||
/// explains: its x86 code was never meant to run (said once per address).
|
||||
/// explains (said once per address, on the debug console). Expected ones are
|
||||
/// the object's own startup and teardown, which ld.so still runs: `.init`,
|
||||
/// its PLT stubs, crtbegin's `frame_dummy`/`__do_global_dtors_aux` and
|
||||
/// `.fini` -- libz.so.1 at +0x2340/+0x2360/+0x272c/+0x2780/+0x14f3c in every
|
||||
/// node child_process spawns. They touch only the library's own data, so
|
||||
/// tier-1 running them is right; as console errors they failed every page
|
||||
/// run that spawned a node.
|
||||
pub(crate) fn note_stray(pc: u64) {
|
||||
static SEEN: Mutex<Vec<u64>> = Mutex::new(Vec::new());
|
||||
let mut seen = lock(&SEEN);
|
||||
if seen.len() < 64 && !seen.contains(&pc) {
|
||||
seen.push(pc);
|
||||
crate::warn_line(&format!("gex: the guest reached {pc:#x}, the replaced library's own code (not a bound export): tier-1 runs it\n"));
|
||||
crate::trace_line(&format!("gex: the guest reached {pc:#x}, the replaced library's own code (not a bound export): tier-1 runs it\n"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user