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

Reject starting with multiple threads if --handle-signals=no #50278

Open
vchuravy opened this issue Jun 23, 2023 · 2 comments
Open

Reject starting with multiple threads if --handle-signals=no #50278

vchuravy opened this issue Jun 23, 2023 · 2 comments
Labels
docs This change adds or pertains to documentation error messages Better, more actionable error messages good first issue Indicates a good issue for first-time contributors to Julia multithreading Base.Threads and related functionality

Comments

@vchuravy
Copy link
Member

vchuravy commented Jun 23, 2023

Julia GC safepoint is based on a read fault on a protected page. If you start Julia with multiple threads and pass --handle-signals=no the signal handler will cause a unhandled segmentation fault.

I don't know if we could install a "partial" segmentation fault handler that only handles safepoints,
but we should not let users shoot themselves into the foot. An easy solution is to document that multi-threading requires the signal-handlers and to not allow starting with multiple threads when --handle-signals=no.

This is of course only a partial fix, since foreign threads may become adopted nontheless.

As seen in the wild: https://discourse.julialang.org/t/floop-threading-and-juliacall-produce-segmentation-fault/100717/11

x-ref: JuliaPy/PythonCall.jl#219

@vchuravy vchuravy added docs This change adds or pertains to documentation multithreading Base.Threads and related functionality good first issue Indicates a good issue for first-time contributors to Julia error messages Better, more actionable error messages labels Jun 23, 2023
@vtjnash
Copy link
Member

vtjnash commented Jun 27, 2023

Or add something like libjsig to our distribution? https://docs.oracle.com/javase/8/docs/technotes/guides/vm/signal-chaining.html

@vchuravy
Copy link
Member Author

Yeah that would make cases like #48378 workable, and maybe better the MPI situation as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation error messages Better, more actionable error messages good first issue Indicates a good issue for first-time contributors to Julia multithreading Base.Threads and related functionality
Projects
None yet
Development

No branches or pull requests

2 participants