Closed pnkfelix closed 1 year ago
r? @bryangarza
(By the way, Bryan, I'm not totally wedded to forcing something like this into the system. But I think we need a simple entry point, i.e. something that is as close as possible to a trivial "compile X. run X atop krabcake." for purposes of our early prototyping, and that is what this make go
is trying to be, at least for now.)
Oh, and also, this code doesn't work out of the box, at least not on my system. Which might be a better reason to avoid landing it.
(It does work if I subsequently apply my patch to revise the client request protocol usage, which is why I wanted to try to add this indpendently first.)
Here is the error I am currently seeing on it with this PR alone:
rustc -C opt-level=2 baseline.rs
./bin/valgrind -q --tool=krabcake ./baseline
Hello world (from `rs_hello/src/lib.rs`)!
Hello world (from `sb_rs_port/main.rs`)!
BorrowMut is 4b430000
--366792-- kc_main.c: dispatching code 4b430000
--366792-- lib.rs: handle client request BORROW_MUT 0x1fff0005f6
--366792-- kc_main.c: dispatching code 4b430000
--366792-- lib.rs: handle client request BORROW_MUT 0x1fff0005f6
Panicked!
--366792-- VALGRIND INTERNAL ERROR: Valgrind received a signal 4 (SIGILL) - exiting
--366792-- si_code=2; Faulting address: 0x581A1AC8; sp: 0x100298dcd0
valgrind: the 'impossible' happened:
Killed by fatal signal
host stacktrace:
==366792== at 0x581A1AC8: rust_begin_unwind (lib.rs:103)
==366792== by 0x58001392: core::panicking::panic_fmt (panicking.rs:64)
==366792== by 0x5800142C: core::panicking::panic (panicking.rs:114)
==366792== by 0x581A3D0B: rs_client_request_borrow_mut (lib.rs:307)
==366792== by 0x580139B4: wrap_tool_handle_client_request (m_tooliface.c:285)
==366792== by 0x580528DA: vgPlain_scheduler (scheduler.c:2240)
added baseline.rs test that
make go
calls out to again.We avoid fragile code-duplication by introducing fragile coupling between this baseline and the interior of kc/tests; lol.