Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@hycinth22
Copy link

@hycinth22 hycinth22 commented Jan 26, 2025

I found a corner case.

if config.enable_instruction_meter=false & jit is off,
vm.due_insn_count subtract overflow encoutered at

self.vm.due_insn_count = self.vm.previous_instruction_meter - self.vm.due_insn_count;

that's because we set previous_instruction_meter to 0 when config.enable_instruction_meter is set to false

sbpf/src/vm.rs

Lines 347 to 352 in 946f7d9

let initial_insn_count = if config.enable_instruction_meter {
self.context_object_pointer.get_remaining()
} else {
0
};
self.previous_instruction_meter = initial_insn_count;

I confirmed that it exists in interpreter mode,
but I'm not sure about the behavior in JIT mode (request for review)

@hycinth22 hycinth22 marked this pull request as ready for review January 26, 2025 12:17
@Lichtso Lichtso merged commit bce8eed into anza-xyz:main Jan 30, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants