Skip to content

win,process: avoid kernel bug with starting Windows Store apps#4152

Merged
vtjnash merged 2 commits intolibuv:v1.xfrom
vtjnash:jn/job-control-bug
Oct 2, 2023
Merged

win,process: avoid kernel bug with starting Windows Store apps#4152
vtjnash merged 2 commits intolibuv:v1.xfrom
vtjnash:jn/job-control-bug

Conversation

@vtjnash
Copy link
Copy Markdown
Member

@vtjnash vtjnash commented Sep 27, 2023

Make sure this handle is functional. The Windows kernel seems to have a bug that if the first use of AssignProcessToJobObject is for a Windows Store program, subsequent attempts to use the handle with fail with INVALID_PARAMETER (87). This is possilby because all uses of the handle must be for the same Terminal Services session. We can ensure it is tied to our current session now by adding ourself to it. We could remove ourself afterwards, but there doesn't seem to be a reason to.

Secondly, we start the process suspended so that we can make sure we added it to the job control object before it does anything itself (such as launch more jobs or exit).

Fixes: JuliaLang/julia#51461

Make sure this handle is functional. The Windows kernel seems to have a bug that if the first use of AssignProcessToJobObject is for a Windows Store program, subsequent attempts to use the handle with fail with INVALID_PARAMETER (87). This is possilby because all uses of the handle must be for the same Terminal Services session. We can ensure it is tied to our current session now by adding ourself to it. We could remove ourself afterwards, but there doesn't seem to be a reason to.

Secondly, we start the process suspended so that we can make sure we added it
to the job control object before it does anything itself (such as launch more
jobs or exit).

Fixes: JuliaLang/julia#51461
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
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.

Crash on windows when calling out to juliaup

2 participants