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

Explicitely use the fork context for multiprocessing to fix running boefjes on macOS #3576

Merged

Conversation

Donnype
Copy link
Contributor

@Donnype Donnype commented Sep 24, 2024

Changes

Adds no functionality but fixes a bug experienced by @noamblitz.

Note that, as I just noticed, from Python 3.14 onward we would have to do this anyways or have a new bug:
image

Issue link

Demo

QA notes

Please run make kat and verify the boefjes still run properly!


Code Checklist

  • All the commits in this PR are properly PGP-signed and verified.
  • This PR only contains functionality relevant to the issue.
  • I have written unit tests for the changes or fixes I made.
  • I have checked the documentation and made changes where necessary.
  • I have performed a self-review of my code and refactored it to the best of my abilities.

Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

@Donnype Donnype requested a review from a team as a code owner September 24, 2024 13:57
@Donnype Donnype self-assigned this Sep 24, 2024
@Donnype Donnype added the bug Something isn't working label Sep 24, 2024
Copy link
Contributor

@noamblitz noamblitz left a comment

Choose a reason for hiding this comment

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

Works on my machine now! (MacOS)

Copy link
Contributor

@ammar92 ammar92 left a comment

Choose a reason for hiding this comment

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

Since I haven't encountered this issue (yet?) and there's no context, I don't have much to add. But can you elaborate a bit more about what this exactly fixes? What specific differences in behavior do we see when running this in a containerized environment on MacOS?

@Donnype
Copy link
Contributor Author

Donnype commented Sep 25, 2024

@ammar92 Since MacOS uses a spawn by default instead of a fork, apparently the system tries to pickle the arguments of the process's target (start_working) and fails to do that. Hence @noamblitz was experiencing issues starting the boefje worker and API outside of Docker.

@Souf149
Copy link
Contributor

Souf149 commented Sep 26, 2024

dns-records and nmap-tcp work succesfully from inside the docker-boefjes.

Tested on Ubuntu 22.04.4 LTS

@underdarknl underdarknl merged commit 579ae18 into main Sep 26, 2024
9 checks passed
@underdarknl underdarknl deleted the fix/explicitely-use-fork-for-multiprocessing-for-macos branch September 26, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants