Skip to content
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

netbsd: fix and extend siginfo_t #2476

Closed
wants to merge 2 commits into from

Conversation

neocturne
Copy link
Contributor

Completely untested, opening PR to run CI...

See the commit messages for details.

@rust-highfive
Copy link

r? @Amanieu

(rust-highfive has picked a reviewer for you, use r? to override)

@neocturne
Copy link
Contributor Author

Is there a simple way to test these changes? I only noticed these inconsistencies while looking for something else, I'm not too familiar with NetBSD.

@neocturne
Copy link
Contributor Author

Regarding the style issues: Should the whole siginfo_t defintion and impl be duplicated in two modules for 32bit and 64bit?

- There is no padding before si_addr on 32bit
- Use u32 instead of u64 for trailing padding on 32bit to fix alignment
- The struct defintion in si_status() was completely wrong
- Rename the local struct defintions from siginfo_timer to match the
  union field names in the C code, fix ordering of unused fields

The corresponding C code can be found at:
https://github.com/NetBSD/src/blob/fd34e1d15d66c940bf5afd5bc6ba0381689266b8/sys/sys/siginfo.h

Note that the NetBSD 32bit ABI for uint64_t is weird: While the union
contains uint64_t and __alignof__(uint64_t) == 8, structs containing
uint64_t will only have an alignment of 4 in C code.
Allow accessing the PID and UID like on other platforms.
neocturne added a commit to neocturne/nix that referenced this pull request Oct 23, 2021
waitid() has a number of additional features that waitpid() is missing:

- WNOWAIT is only accepted for waitid() on Linux (and possibly other
  platforms)
- Support for waiting on PID file descriptors on Linux

For now support is added for all platforms with waitid() that have proper
siginfo_t support in libc. NetBSD support is currently a work in progress
[1].

Tests for the signal/exit code are currently skipped on MIPS platforms due
to multiple bugs in qemu-user in the translation of siginfo_t (one fixed
in January [2], one currently under review [3]).

[1] rust-lang/libc#2476
[2] https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg04810.html
[3] https://lists.nongnu.org/archive/html/qemu-devel/2021-10/msg05433.html
neocturne added a commit to neocturne/nix that referenced this pull request Oct 23, 2021
waitid() has a number of additional features that waitpid() is missing:

- WNOWAIT is only accepted for waitid() on Linux (and possibly other
  platforms)
- Support for waiting on PID file descriptors on Linux

For now support is added for all platforms with waitid() that have proper
siginfo_t support in libc. NetBSD support is currently a work in progress
[1].

Tests for the signal/exit code are currently skipped on MIPS platforms due
to multiple bugs in qemu-user in the translation of siginfo_t (one fixed
in January [2], one currently under review [3]).

[1] rust-lang/libc#2476
[2] https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg04810.html
[3] https://lists.nongnu.org/archive/html/qemu-devel/2021-10/msg05433.html
neocturne added a commit to neocturne/nix that referenced this pull request Oct 23, 2021
waitid() has a number of additional features that waitpid() is missing:

- WNOWAIT is only accepted for waitid() on Linux (and possibly other
  platforms)
- Support for waiting on PID file descriptors on Linux

For now support is added for all platforms with waitid() that have proper
siginfo_t support in libc. NetBSD support is currently a work in progress
[1].

Tests for the signal/exit code are currently skipped on MIPS platforms due
to multiple bugs in qemu-user in the translation of siginfo_t (one fixed
in January [2], one currently under review [3]).

[1] rust-lang/libc#2476
[2] https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg04810.html
[3] https://lists.nongnu.org/archive/html/qemu-devel/2021-10/msg05433.html
neocturne added a commit to neocturne/nix that referenced this pull request Oct 23, 2021
waitid() has a number of additional features that waitpid() is missing:

- WNOWAIT is only accepted for waitid() on Linux (and possibly other
  platforms)
- Support for waiting on PID file descriptors on Linux

For now support is added for all platforms with waitid() that have proper
siginfo_t support in libc. NetBSD support is currently a work in progress
[1].

Tests for the signal/exit code are currently skipped on MIPS platforms due
to multiple bugs in qemu-user in the translation of siginfo_t (one fixed
in January [2], one currently under review [3]).

[1] rust-lang/libc#2476
[2] https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg04810.html
[3] https://lists.nongnu.org/archive/html/qemu-devel/2021-10/msg05433.html
neocturne added a commit to neocturne/nix that referenced this pull request Oct 24, 2021
waitid() has a number of additional features that waitpid() is missing:

- WNOWAIT is only accepted for waitid() on Linux (and possibly other
  platforms)
- Support for waiting on PID file descriptors on Linux

For now support is added for all platforms with waitid() that have proper
siginfo_t support in libc. NetBSD support is currently a work in progress
[1].

Tests for the signal/exit code are currently skipped on MIPS platforms due
to multiple bugs in qemu-user in the translation of siginfo_t (one fixed
in January [2], one currently under review [3]).

[1] rust-lang/libc#2476
[2] https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg04810.html
[3] https://lists.nongnu.org/archive/html/qemu-devel/2021-10/msg05433.html
neocturne added a commit to neocturne/nix that referenced this pull request Nov 19, 2021
waitid() has a number of additional features that waitpid() is missing:

- WNOWAIT is only accepted for waitid() on Linux (and possibly other
  platforms)
- Support for waiting on PID file descriptors on Linux

For now support is added for all platforms with waitid() that have proper
siginfo_t support in libc. NetBSD support is currently a work in progress
[1].

Tests for the signal/exit code are currently skipped on MIPS platforms due
to multiple bugs in qemu-user in the translation of siginfo_t (one fixed
in January [2], one currently under review [3]).

[1] rust-lang/libc#2476
[2] https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg04810.html
[3] https://lists.nongnu.org/archive/html/qemu-devel/2021-10/msg05433.html
neocturne added a commit to neocturne/nix that referenced this pull request Mar 5, 2022
waitid() has a number of additional features that waitpid() is missing:

- WNOWAIT is only accepted for waitid() on Linux (and possibly other
  platforms)
- Support for waiting on PID file descriptors on Linux

For now support is added for all platforms with waitid() that have proper
siginfo_t support in libc. NetBSD support is currently a work in progress
[1].

Tests for the signal/exit code are currently skipped on MIPS platforms due
to bugs in qemu-user's translation of siginfo_t (fixed in [2] and [3]; the
second fix is not in a released qemu version yet).

[1] rust-lang/libc#2476
[2] https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg04810.html
[3] https://lists.nongnu.org/archive/html/qemu-devel/2021-10/msg05433.html
neocturne added a commit to neocturne/nix that referenced this pull request Mar 5, 2022
waitid() has a number of additional features that waitpid() is missing:

- WNOWAIT is only accepted for waitid() on Linux (and possibly other
  platforms)
- Support for waiting on PID file descriptors on Linux

For now support is added for all platforms with waitid() that have proper
siginfo_t support in libc. NetBSD support is currently a work in progress
[1].

Tests for the signal/exit code are currently skipped on MIPS platforms due
to bugs in qemu-user's translation of siginfo_t (fixed in [2] and [3]; the
second fix is not in a released qemu version yet).

[1] rust-lang/libc#2476
[2] https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg04810.html
[3] https://lists.nongnu.org/archive/html/qemu-devel/2021-10/msg05433.html
neocturne added a commit to neocturne/nix that referenced this pull request Mar 6, 2022
waitid() has a number of additional features that waitpid() is missing:

- WNOWAIT is only accepted for waitid() on Linux (and possibly other
  platforms)
- Support for waiting on PID file descriptors on Linux

For now support is added for all platforms with waitid() that have proper
siginfo_t support in libc. NetBSD support is currently a work in progress
[1].

Tests for the signal/exit code are currently skipped on MIPS platforms due
to bugs in qemu-user's translation of siginfo_t (fixed in [2] and [3]; the
second fix is not in a released qemu version yet).

[1] rust-lang/libc#2476
[2] https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg04810.html
[3] https://lists.nongnu.org/archive/html/qemu-devel/2021-10/msg05433.html
neocturne added a commit to neocturne/nix that referenced this pull request Mar 9, 2022
waitid() has a number of additional features that waitpid() is missing:

- WNOWAIT is only accepted for waitid() on Linux (and possibly other
  platforms)
- Support for waiting on PID file descriptors on Linux

For now support is added for all platforms with waitid() that have proper
siginfo_t support in libc. NetBSD support is currently a work in progress
[1].

Tests for the signal/exit code are currently skipped on MIPS platforms due
to bugs in qemu-user's translation of siginfo_t (fixed in [2] and [3]; the
second fix is not in a released qemu version yet).

[1] rust-lang/libc#2476
[2] https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg04810.html
[3] https://lists.nongnu.org/archive/html/qemu-devel/2021-10/msg05433.html
bors bot added a commit to nix-rust/nix that referenced this pull request Mar 10, 2022
1584: wait: implement waitid() r=rtzoeller a=NeoRaider

waitid() has a number of additional features that waitpid() is missing:

- WNOWAIT is only accepted for waitid() on Linux (and possibly other platforms)
- Support for waiting on PID file descriptors on Linux

For now support is added for all platforms with waitid() that have proper siginfo_t support in libc. NetBSD support is currently a work in progress [1].

Tests for the signal/exit code are currently skipped on MIPS platforms due to multiple bugs in qemu-user in the translation of siginfo_t (one fixed in January [2], one currently under review [3]).

[1] rust-lang/libc#2476
[2] https://lists.nongnu.org/archive/html/qemu-devel/2021-01/msg04810.html
[3] https://lists.nongnu.org/archive/html/qemu-devel/2021-10/msg05433.html

Co-authored-by: Matthias Schiffer <mschiffer@universe-factory.net>
@JohnTitor
Copy link
Member

Regarding the style issues: Should the whole siginfo_t defintion and impl be duplicated in two modules for 32bit and 64bit?

The logs are no longer available but if the failure complained about it, you should do it.

@JohnTitor
Copy link
Member

@NeoRaider Friendly-ping, are you still interested in this PR? It's WIP but if you need some more time, I'm going to close to clean-up the PR list.

@JohnTitor
Copy link
Member

Triage: Closing as inactive. Feel free to reopen/resubmit if you're still interested in this PR. Thanks!

@JohnTitor JohnTitor closed this Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants