nix icon indicating copy to clipboard operation
nix copied to clipboard

SigSet Incorrect implementation of Eq and PartialEq

Open germag opened this issue 3 years ago • 3 comments

signal::SigSet derives Eq and PartialEq, I assume because libc::sigset_t does it too, but in linux, sigfillset(3) only initializes the first 64 bits, leaving the rest uninitialized, so two signal::SigSets can be different even though both have the same set of signals

germag avatar Jun 21 '22 08:06 germag

I can work on fixing this, I assume it is preferable to manually implement PartialEq rather than simply eliminating the derive (Eq, PartialEq) since it's a breaking change, right?

germag avatar Jun 21 '22 08:06 germag

Yes, I think it would be preferable to implement PartialEq rather than not to.

asomers avatar Jun 21 '22 12:06 asomers

FYI: I previously reported this to libc https://github.com/rust-lang/libc/issues/2700

magicant avatar Sep 11 '22 16:09 magicant

@germag are you still planning to fix this?

asomers avatar Dec 04 '22 22:12 asomers

@germag are you still planning to fix this?

Yes, sorry @asomers I thought it had been solved in the libc crate

germag avatar Dec 19 '22 16:12 germag