-
Notifications
You must be signed in to change notification settings - Fork 683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SigSet: Fix incorrect implementation of Eq, PartialEq and Hash #1946
Conversation
146d057
to
387efba
Compare
v2:
|
@germag have you done any performance analysis of the auto-derived version (on platforms other than Linux; I acknowledge the Linux impl is broken) vs the manually implemented one? If this new implementation is measurably slower, we might want to use the auto-derived version on platforms where it is correct. We could also implement this on Linux by reading only the initialized bits and hashing them all at once, although that is certainly a leaky abstraction. |
No, I haven't,
I think it would be better to do that in libc. Also, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should merge this. It's hard for Nix to know which platforms fully initialize sigset_t and which don't. So unless they start providing sigeqset
or something like that, we should probably just do things the hard way.
Friendly ping @germag, would you like to finish this PR? The CI failure seems to be irrelevant, rebasing your branch should resolve it :) |
387efba
to
b9b046e
Compare
Rebase
Sorry for the delay, I thought it was already merged |
`signal::SigSet` derives `Eq`, `PartialEq` and `Hash`, but on 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. Signed-off-by: German Maglione <gmaglione@redhat.com>
b9b046e
to
10a6384
Compare
signal::SigSet
derivesEq
,PartialEq
andHash
, but on linux,sigfillset(3)
only initializes the first 64 bits, leaving the rest uninitialized. So twosignal::SigSets
can be different even though both have the same set of signals.closes #1749