Closed yoid2000 closed 2 months ago
Adding a check there like
u1 = max(u1, sys.float_info.epsilon)
makes most sense to me. Even if the probability of that specific value happening is low, that case still needs to be handled.
Right now, I don't see a reason why such values should be suspicious. The hash itself is not empty, so maybe there weren't enough bytes in the seed materials to produce anything more complex than that.
Ok. That is what I had in mind (except that I didn't know about sys.float_info.epsilon
).
Thanks.
CLosed by #141
I'm getting a failure at https://github.com/diffix/syndiffix/blob/4dcdbfa375d7c8bb707cf17335a8741845a60c80/syndiffix/anonymizer.py#L44
The problem is that
u1 = 0
, which causesmath.log(u1)
to crash.The reason that
u1 = 0
is because the seed in https://github.com/diffix/syndiffix/blob/4dcdbfa375d7c8bb707cf17335a8741845a60c80/syndiffix/anonymizer.py#L42is
81,486,552,638,685,184 = 0x1217F9680000000
Since the trailing 31 bits are zero, this causes
u1
to be 0.This seems too low probability to be happening just randomly (2^31 is like 2 billion) so there might be some upstream reason for the problem, but I didn't see anything obvious.
My inclination is to just add a check for the failing value and replace it with something safe. But maybe @cristianberneanu you have a better idea?
Here is the dump: