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

Truncate exit code to u8, even if the real code doesn't fit in u8. #739

Closed
wants to merge 1 commit into from

Conversation

jakobnissen
Copy link
Contributor

This prevents JuliaLauncher from panicking if a user exits with an error code which doesn't fit in u8.
This is already the behaviour of Julia on Linux, where ccall(:jl_exit) can be called with Int32(-1), yet returns error code 255.

Closes #737

This prevents JuliaLauncher from panicking if a user exits with an error code
which doesn't fit in u8.
This is already the behaviour of Julia on Linux, where `ccall(:jl_exit)` can be
called with Int32(-1), yet returns error code 255.
@StefanKarpinski
Copy link
Sponsor Member

Can we please change things around so that the Julia process is the parent and the updater is the child? The. This would be unnecessary as would all the logic for handling the termination of the Julia child process.

@davidanthoff
Copy link
Collaborator

I have an alternative fix for the underlying problem in #750. @jakobnissen what do you think of that?

@StefanKarpinski I don't understand your suggestion :) The updater is not in the picture here at all, and is never the parent process. This here is the julialauncher, which is what starts when you type in julia. It is in charge of a) figuring out which Julia version to start, and b) will periodically launch the updater as a child process in the background.

@StefanKarpinski
Copy link
Sponsor Member

#552:

I think we should change julialauncher to use execve() (or its moral equivalent, wherever possible) instead of fork() when launching the julia sub-process. Because this does not launch a child process but instead causes the current process to be replaced by the new process

This would mean, among other benefits listed there, that julialauncher doesn't need to propagate the exit code because it becomes the Julia process which then terminates as it normally would. Having the real julia process be the child of the julialauncher process is just less good in basically every way.

@davidanthoff
Copy link
Collaborator

Yeah, I'm just quite nervous about the interaction of execve and Rust packages, there seems to be a lot of potential for pain. And on Windows that won't ever work, and I'm also not keen to have such a massive difference there...

My sense right now is that the only way to really have a one-process solution that is architecturally similar on the various platforms would be some variant of #327. Which also seems anything but trivial...

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.

Julia crashes when using exit(-1)
3 participants