-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
std.process.Child.run fails to kill child on error condition #22433
Comments
These aren't "phantom tasks", they're your compiled program running. By linking these 3 values in a loop, you have set up the code so that |
@mlugg thanks for your help ! I knew I was doing a loop, and that was kind of intended. I'm not quite sure I get why doesn't the program stops when it encounters the error to be honest. I might not be enough used to Zig's compilation flow to understand what's going on. The error kinda says that it was unable to spawn the program and to make it run, but then I still have a program going on ? |
Apologies, I didn't read the issue closely enough. It's a bug that the |
Ahh, okay, But... somehow the child process isn't being killed? Even though there's an zig/lib/std/Build/Step/Run.zig Lines 1352 to 1362 in 7aa95bc
I'm guessing we're hitting an error condition on |
Ziglings doesn't use the standard run step, it has its own custom step which uses However, given there's no way for the user of Line 398 in 7aa95bc
errdefer is only scoped up through try child.wait() and not, say, if try stdout.toOwnedSlice() fails after the process has already terminated)
|
Oh, wow, I didn't realise Ziglings had a custom step for this. That's... interesting. But yeah, this should be handled by |
Zig Version
0.14.0-dev.2596+e6879e99e
Steps to Reproduce and Observed Behavior
Hey, I've been tinkering around with Zig and found a strange bug while solving Ziglings. Basically my CPU went to 89°C for no clear reason. Here are the steps to reproduce.
049_quiz6.zig
on your favorite editorzig build -Dn=49
Expected Behavior
Here are three screenshots of the situation.
btop
screenshot after launching the program 4 times in a row.I basically ran it 4 times in a row after seeing it not working, and it ate half of my CPU cores, while making my CPU heat skyrocket.
I'm not quite sure from where it comes from, either from a Zig compilation problem, or from the ziglings exercise itself. However, I don't have this problem with other Ziglings problems.
I would appreciate any insights on the situation ! Thanks :)
NB:
The text was updated successfully, but these errors were encountered: