Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guard page and bail:meme #202

Merged
merged 66 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
a914424
vendor `assert_no_alloc` with `ensure_no_alloc` function added
matthew-levan Jan 17, 2024
3411adc
wip: st. antony, abbot
matthew-levan Jan 17, 2024
1614290
Merge branch 'status' into msl/guard
matthew-levan Jan 18, 2024
f7f01f5
guard: initial commit
matthew-levan Jan 18, 2024
28a7bf5
guard: do not focus in top-level
matthew-levan Jan 18, 2024
caf8f69
Merge branch 'status' into msl/guard
matthew-levan Jan 18, 2024
42f56a5
guard: ready for initial rust wrapper implementation
matthew-levan Jan 19, 2024
0d5e8b8
wip: today
matthew-levan Jan 19, 2024
f7fcffc
wip: friday
matthew-levan Jan 19, 2024
cb73bcd
wip: sts. vincent and anastasius
matthew-levan Jan 23, 2024
43d145a
wip: sts. vincent and anastasius ii
matthew-levan Jan 23, 2024
5e44f2f
wip: debugging
matthew-levan Jan 23, 2024
7ff1657
wip: earl-eye in the mornin
matthew-levan Jan 23, 2024
95d4023
guard: kind of works
matthew-levan Jan 23, 2024
a8ed832
wip: restore cargo and remove eprints
matthew-levan Jan 23, 2024
4ff53a1
wip: need more work on ret pointer
matthew-levan Jan 23, 2024
140d02c
wip: got result value being passed correctly
matthew-levan Jan 23, 2024
0b86332
wip: guard weird error
matthew-levan Jan 23, 2024
a28137d
wip: cleanup `guard.c` printfs
matthew-levan Jan 24, 2024
a0ddc1f
guard: boots a baby pill and sigint works too; uses box
matthew-levan Jan 24, 2024
fa316f6
guard: add motes and use in all errors; disable sigint handling
matthew-levan Jan 24, 2024
680d2d2
wip: debugging ~2024.1.30
matthew-levan Jan 30, 2024
dd70aad
wip: add rust-assert-no-alloc
matthew-levan Jan 30, 2024
54cea05
wip: linux debugging
matthew-levan Jan 30, 2024
c07a280
wip: pull in `mem.rs` from `as/motes`
matthew-levan Jan 31, 2024
96b2242
wip: call previous handler on faults outside guard page
matthew-levan Jan 31, 2024
3620c7b
Revert "wip: pull in `mem.rs` from `as/motes`"
matthew-levan Feb 1, 2024
07ee849
guard: experiment with frame boundary callbacks
matthew-levan Feb 3, 2024
49278d0
stack: add debug helper functions to NockStack
ashelkovnykov Feb 3, 2024
0a8bcfe
wip: more debugging
matthew-levan Feb 5, 2024
fdc3010
wip: only center guard on fault in it
matthew-levan Feb 5, 2024
3f6d76b
wip: sigbus on guard hit?
matthew-levan Feb 5, 2024
3500cca
pill: add new pill which triggers OOM error
ashelkovnykov Feb 6, 2024
bac7919
wip: style
matthew-levan Feb 6, 2024
e086fbd
stack: safe partial commit of mem.rs changes from motes PR
ashelkovnykov Feb 7, 2024
c43b3e4
wip: refactoring and remove sigint handling
matthew-levan Feb 7, 2024
116f9e8
wip: minor
matthew-levan Feb 8, 2024
99b6a97
Merge branch 'status' into msl/guard
matthew-levan Feb 8, 2024
4035867
wip: wrap last block in `interpret` with guard
matthew-levan Feb 8, 2024
ef1829d
Merge branch 'status' into matt
ashelkovnykov Feb 14, 2024
1df75a2
Merge branch 'as/serf-guard' into msl/guard
ashelkovnykov Feb 14, 2024
1e44565
Merge branch 'as/serf-guard' into msl/guard
ashelkovnykov Feb 14, 2024
5efbc07
Enable guard page + bail:meme with stack traces
ashelkovnykov Feb 14, 2024
fcb1ba5
wip: test `interpret_with_guard`
matthew-levan Feb 14, 2024
1980ca7
wip: use only one `jmp_buf`; add `NockStackSnapshot`
matthew-levan Feb 14, 2024
8bcbf6a
Revert "wip: use only one `jmp_buf`; add `NockStackSnapshot`"
matthew-levan Feb 15, 2024
77ec530
Revert "wip: test `interpret_with_guard`"
matthew-levan Feb 15, 2024
b81ae6e
guard: documentation
matthew-levan Feb 16, 2024
4cfd3ca
guard: comment debug `fprintf` calls
matthew-levan Feb 16, 2024
446efcd
guard: touchups
matthew-levan Feb 16, 2024
8402043
cargo: clippy
matthew-levan Feb 16, 2024
f12337e
build: turn off `disable_release` default feature for `rust-assert-no…
matthew-levan Feb 16, 2024
45f47e0
wip: initial working on macOS
matthew-levan Feb 18, 2024
b1960ad
guard: works on macOS
matthew-levan Feb 19, 2024
6479459
Merge branch 'as/serf-guard' into msl/guard
matthew-levan Feb 19, 2024
5dcc240
guard: use state struct
matthew-levan Feb 19, 2024
96e0777
guard: placate clang warnings
matthew-levan Feb 19, 2024
85fef33
guard: use `guard_success` instead of `0`
matthew-levan Feb 19, 2024
b1e3b78
guard: remove unhelpful functions
matthew-levan Feb 19, 2024
d13fe50
guard: partially address @ashelkovnykov's comments
matthew-levan Feb 20, 2024
dd2bbc5
Merge branch 'as/serf-guard' into msl/guard
matthew-levan Feb 20, 2024
6616626
Revert "Merge branch 'as/serf-guard' into msl/guard"
matthew-levan Feb 21, 2024
e03d340
guard: use `guard_err` in rust constants
matthew-levan Feb 21, 2024
3573e90
pma: restore `btree.c`
matthew-levan Feb 21, 2024
209835c
guard: C style (pair w/ Matt)
ashelkovnykov Feb 21, 2024
dca5886
guard: minors
matthew-levan Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions rust/ares/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rust/ares/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ ares_macros = { path = "../ares_macros" }
# ares_pma = { path = "../ares_pma", features=["debug_prints"] }
ares_pma = { path = "../ares_pma" }
# use this when debugging requires allocation (e.g. eprintln)
# assert_no_alloc = { path = "../assert-no-alloc", features=["warn_debug"] }
assert_no_alloc = { path = "../assert-no-alloc" }
# assert_no_alloc = { path = "../rust-assert-no-alloc", features=["warn_debug"] }
assert_no_alloc = { path = "../rust-assert-no-alloc" }
bitvec = "1.0.0"
criterion = "0.4"
either = "1.9.0"
Expand Down
12 changes: 1 addition & 11 deletions rust/ares/src/guard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::interpreter::{Error, Mote, Result};
use crate::noun::D;
use ares_guard::*;
use assert_no_alloc::permit_alloc;
use std::convert::TryFrom;
use std::ffi::c_void;
use std::marker::PhantomData;

Expand Down Expand Up @@ -41,15 +40,6 @@ impl<'closure> CCallback<'closure> {
{
let function: unsafe extern "C" fn(*mut c_void) -> *mut c_void = Self::call_closure::<F>;

// debug_assert_eq!(
// std::mem::size_of::<&'closure mut F>(),
// std::mem::size_of::<*const c_void>()
// );
// debug_assert_eq!(
// std::mem::size_of_val(&function),
// std::mem::size_of::<*const c_void>()
// );

Self {
function,
input: closure as *mut F as *mut c_void,
Expand Down Expand Up @@ -95,7 +85,7 @@ pub fn call_with_guard<F: FnMut() -> Result>(
*result_box
})
} else {
let err = GuardError::from(u32::try_from(res).unwrap());
let err = GuardError::from(res);
match err {
GuardError::OutOfMemory => Err(Error::NonDeterministic(Mote::Meme, D(0))),
_ => {
Expand Down
Loading
Loading