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

Add a no-clone3 feature to disable clone3 #2419

Closed
wants to merge 1 commit into from

Conversation

jprendes
Copy link
Contributor

@jprendes jprendes commented Oct 9, 2023

This PR adds a no-clone3 feature that disables the use of clone3 in libcontainer.

This can be used to counteract the undefined behaviour introduced by using a raw sysall for clone3, which leads to problem in musl and on glibc when the main process uses threads.

See containerd/runwasi#347

@jprendes jprendes changed the title Add feature to disable clone3 Add a no-clone3 feature to disable clone3 Oct 9, 2023
@YJDoc2
Copy link
Collaborator

YJDoc2 commented Oct 9, 2023

Hey, actually I was also trying the same here #2418 which either takes clone3 or clone depending on feature without any fallback. Its failing some tests, so need to see that there.

@jprendes jprendes force-pushed the clone3-behind-feature-gate branch from dda2902 to ce0d754 Compare October 9, 2023 11:35
@YJDoc2 YJDoc2 added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Oct 9, 2023
@jprendes jprendes force-pushed the clone3-behind-feature-gate branch from ce0d754 to ca431fd Compare October 9, 2023 13:45
@codecov-commenter
Copy link

codecov-commenter commented Oct 9, 2023

Codecov Report

Merging #2419 (dd324aa) into main (b968ac5) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2419      +/-   ##
==========================================
- Coverage   66.01%   66.01%   -0.01%     
==========================================
  Files         133      133              
  Lines       16832    16822      -10     
==========================================
- Hits        11112    11105       -7     
+ Misses       5720     5717       -3     

@jprendes jprendes force-pushed the clone3-behind-feature-gate branch 8 times, most recently from 83d2216 to fa95416 Compare October 9, 2023 14:58
@YJDoc2
Copy link
Collaborator

YJDoc2 commented Oct 9, 2023

Hey, there's one conflict due to recent merge in master, can you rebase? Also I saw your comment on my PR regarding failing test, I'll try to get to that, or if this is done first/ has more preferable approach, we can go ahead with this.

Also a nit, personal preference : can the feature name be "positive" i.e. instead of no-clone3 , can we have clone3, and invert the checks instead?

@jprendes
Copy link
Contributor Author

jprendes commented Oct 9, 2023

can the feature name be "positive" i.e. instead of no-clone3 , can we have clone3, and invert the checks instead?

I thought about that and my concern is that when we request no-clone3, we really don't want clone3 (since we know we are hitting undefined behaviour somewhere).
Due to how cargo resolves features (the union of all features requested), a feature can be enabled by another crate even if your crate didn't enable it. The same doesn't apply to disabling features (you can't disable features other than default).
Naming it clone3 means that some other crate can accidentally enable it.
Naming it no-clone3 means that once we enable it, it can't be accidentally disabled.

Signed-off-by: Jorge Prendes <[email protected]>
@jprendes jprendes force-pushed the clone3-behind-feature-gate branch from 56202d8 to dd324aa Compare October 9, 2023 15:43
@jprendes
Copy link
Contributor Author

jprendes commented Oct 9, 2023

can you rebase?

Rebased :-)

@jprendes jprendes marked this pull request as draft October 9, 2023 22:19
@jprendes
Copy link
Contributor Author

jprendes commented Oct 9, 2023

Converting to draft as this doesn't fix the sporadic failures in containerd/runwasi#347

@utam0k
Copy link
Member

utam0k commented Oct 15, 2023

@jprendes Can we close this PR?

@jprendes jprendes closed this Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants