rbpf icon indicating copy to clipboard operation
rbpf copied to clipboard

Valid mod operations cause a div/0 exception

Open jackcmay opened this issue 7 years ago • 4 comments

https://github.com/qmonnet/rbpf/blob/ceb7fa67946a7a6e9cff5a4e03ae721a1ecf10b6/src/jit.rs#L380

jackcmay avatar Nov 14 '18 01:11 jackcmay

Looks like this was done on purpose, why?

jackcmay avatar Nov 14 '18 01:11 jackcmay

I took this code from uBPF, so I'm not exactly the “original author” here :).

As I understand it this should be a conditional jump, triggered only if the divisor is 0 — in which case this is the behaviour we expect to see. How did you trigger it? Are you sure you were not trying to divide by 0?

qmonnet avatar Nov 15 '18 05:11 qmonnet

Yeah, was triggered by a x % 10

jackcmay avatar Nov 15 '18 23:11 jackcmay

I didn't manage to reproduce it :/. Do you have a reproducer, by any chance?

qmonnet avatar Nov 16 '18 20:11 qmonnet

Possibly related to https://github.com/qmonnet/rbpf/pull/89

qmonnet avatar Jan 05 '24 01:01 qmonnet