Skip to content

audit all contributions by @devnexen for correctness and delete unnecessary libc ABI bits #16350

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

Closed
wants to merge 67 commits into from
Closed

Conversation

devnexen
Copy link
Contributor

@devnexen devnexen commented Jul 7, 2023

No description provided.

devnexen added 30 commits July 7, 2023 21:28
@andrewrk
Copy link
Member

andrewrk commented Jul 7, 2023

@mikdusan is there anything here that you want to keep? If so, would you be willing to audit it for correctness, and then add a commit to this branch to keep it?

I will do the same.

@rofrol
Copy link
Contributor

rofrol commented Jul 7, 2023

What happend here?

@andrewrk
Copy link
Member

andrewrk commented Jul 7, 2023

Context: #16333 (comment)

@andrewrk andrewrk changed the title Revert commits audit all contributions by @devnexen for correctness and delete unnecessary libc ABI bits Jul 8, 2023
@lin72h
Copy link

lin72h commented Jul 8, 2023

@devnexen Thanks for working on these freebsd integration bits, I've been following all your PR and learned a lots about freebsd internal.

@likern
Copy link

likern commented Jul 8, 2023

Why there isnt any integration tests written to run under BSD running in QEMU? I think that would solve the problem with correctness and trust, isn't it?

@mikdusan
Copy link
Member

mikdusan commented Jul 8, 2023

Why there isnt any integration tests written to run under BSD running in QEMU? I think that would solve the problem with correctness and trust, isn't it?

  • bsd-user is not supported on a linux host
  • full disclosure, I have never tried bsd-user on any system, but it looks like it needs to run on a bsd host
  • emulating a bsd system is really the only way we are going to get a bsd host and is something we'd like to do and there appears to be a path to that goal but it just hasn't happened yet

IMO, we have a few issues about libc on BSD. It is not very well organized and lacks direct tests. Basically libc only gets test coverage to the extent zig's std depends on it. Some further thoughts; feel free to critique:

  1. A direct libc test suite. eg: create a test for freebsd mmap() special MAP_ALIGNED(n) flag and verify alignment. Should be a simple test and yet it verifies that we are using the correct binary flags. It also doesn't depend on zig std somehow requiring to use it.

  2. It is possible that a direct libc test suite could get "out of hand" to be bundled with zig. If that is or becomes the case, there is nothing preventing us from launching a libc testsuite repo for zig.

  3. libc tests optioned to indicate host capabilities for testing; eg: -Dnetwork-ipv6,-Dnetwork-ipv4, -Dnetwork-internet, -Dnetwork-dns, -Dnetwork-icmp. If a host doesn't have the capability, skip.

Copy link
Contributor

@semarie semarie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added lines comments regarding OpenBSD contributions for what I am sure it is need or important to have. I didn't comment for others BSDs.

@likern
Copy link

likern commented Jul 8, 2023

I thought of more like running OpenBSD over full virtualization using kvm, which seems supports it according to this, at least having it run and failed on PR and commits.

To run it on GitHub Actions seems it need to have nested virtualization, kvm inside GA. It's not supported as is *BSD natively.

BUT macos machines does support this (can run Virtualbox). There is GitHub Action which supports it using this method.

Another way is to run self-hosted runners on native BSD system and run GA on VM (containers?) using bhyve, as shown here https://github.com/myb-project/guide/blob/main/en/gh_runners.md. It allows to run DragonflyBSD, FreeBSD, NetBSD, OpenBSD.

Similar approach is to run self-hosted runner on Linux with kvm support on it and run VMs on it.

@andrewrk
Copy link
Member

I re-did the work myself over here, in order to avoid unnecessary trust: #16636

Thank you for your comments @semarie - I will go over them one by one now.

@andrewrk andrewrk closed this Jul 31, 2023
@andrewrk
Copy link
Member

To all: testing is not a solution to sloppy contributions. Testing is certainly an important component of quality assurance, but when it comes to external ABIs, there is no substitution for expertise and carefulness. There could easily be extern functions that pass automated tests, yet expose a subtle flaw that could be exploited or triggered under certain conditions, and all of these commits are exactly the kind that are in danger of creating that exact scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants