You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn try_only_interception_egress(ctx: TcContext) -> Result<i32, i32> {
info!(&ctx, "received an egress packet");
let start = ctx.data();
let end = ctx.data_end();
let len = end - start;
let mut tmp = Packet{
buf: [0u8; BUF_SIZE],
};
for i in 0..len{
if i >= BUF_SIZE {
return Err(0);
}
tmp.buf[i] = ctx.load(i).map_err(|_| 0)?;
}
if let Some(mut buffer) = PACKETS.reserve::<Packet>(0) {
buffer.write(tmp);
buffer.submit(0);
}
Ok(TC_ACT_PIPE)
}
this is part of the code, with the last nightly if I comment this line: tmp.buf[i] = ctx.load(i).map_err(|_| 0)?
or this line: buffer.write(tmp);
it works correctly I read on discord that the "file too short" is a recent bug probably due to the last nightly.
Is there a way to solve this?
I'm on Ubuntu with x86-64
kernel: 6.8.0-31-generic
rustup 1.27.1 (54dd3d00f 2024-04-24)
The text was updated successfully, but these errors were encountered:
I find that I get this issue when the amount of stack used is too great. I'm guessing the compiler optimises out your tmp in the stack if either of those lines are omitted (in one case it can be optimised out entirely, the other it can be transformed to static).
Your BUF_SIZE is probably too large for the stack. Drop it in a per-cpu array instead :)
this is part of the code, with the last nightly if I comment this line:
tmp.buf[i] = ctx.load(i).map_err(|_| 0)?
or this line:
buffer.write(tmp);
it works correctly I read on discord that the "file too short" is a recent bug probably due to the last nightly.
Is there a way to solve this?
I'm on Ubuntu with x86-64
kernel: 6.8.0-31-generic
rustup 1.27.1 (54dd3d00f 2024-04-24)
The text was updated successfully, but these errors were encountered: