Post

Replies

Boosts

Views

Activity

Reply to macOS: pre-established stop mechanism when a VM supervisor stops progressing
Thanks, Quinn. The launcher design we reviewed creates a child directly with fork(), then calls execvp() in the child. It does not use NSWorkspace or XPC. We have not adopted that design or observed a launch hang. On success, the parent gets the child’s PID from fork(), as you pointed out. My earlier wording was unclear: we were asking about the interval before the parent has returned from fork(), not about a successful launch that somehow returned no PID. Your answer settles the platform question for us: we cannot rely on an opt-in macOS watchdog to stop that helper for a particular run, or on a documented cleanup deadline. Thank you for clarifying.
Topic: App & System Services SubTopic: Core OS Tags:
4d
Reply to macOS: pre-established stop mechanism when a VM supervisor stops progressing
Sorry. I didn’t explain the use case clearly. I’m building a tool that runs one job at a time in a VM on an Apple silicon Mac. A launcher prepares a directory for the job and starts a helper process. That helper owns the VM. If the job is cancelled, I must not reuse its files while something from that run may still be writing to them. My question is: can I arrange for macOS itself to stop the helper for that particular run if my launcher gets stuck, or does my design have to assume that another process remains responsive to do it? Here’s the case I need to cover. The launcher starts creating the helper, but the launch call never returns a PID. The helper may already be alive. A cancellation request then arrives from outside the launcher. The launcher can’t act on it, and the helper’s VM queue isn’t progressing either. The Mac and kernel are otherwise running. I’m not asking another app to take over the VM. I need to decide two things before allowing a job to start: Can protection be set up before creating the job directory or launching the helper? If there is a public API or system service for this, how would it receive the cancellation and identify the right helper and any child processes from that run, even if the launch call never returns? What timing, if any, is documented? Our requirement is to finish the stop attempt, including any required fallback if the first stop operation fails or hangs, within 10 seconds of the original cancellation. That is our requirement, not a deadline we assume macOS promises. We are not asking for a guarantee that the VM has finished shutting down or that its files are safe to reuse within those 10 seconds. If there’s a supported mechanism that covers only part of this, its name, applicable macOS versions and limits would help. If the design must instead assume a responsive external controller and has no documented 10-second bound, that’s useful too: it tells me not to start jobs that require that guarantee. Thank you!
Topic: App & System Services SubTopic: Core OS Tags:
5d
Reply to macOS: pre-established stop mechanism when a VM supervisor stops progressing
I understand the limitation of adding another supervisor, and I am not asking for bounded VM teardown. For our design decision, should we treat the following requirement as outside the documented public macOS contracts: a mechanism armed before workload preparation that can initiate the fallback independently when both the VM-control queue and the supervisor stop progressing, while their processes remain alive? The 10-second requirement concerns completion of the prescribed stop/escalation attempt, not guaranteed successful VM termination. If no documented public mechanism covers this scenario, that clarification is sufficient. If a narrower mechanism exists under explicit assumptions, could you identify it?
Topic: App & System Services SubTopic: Core OS Tags:
1w
Reply to macOS: pre-established stop mechanism when a VM supervisor stops progressing
Thank you, Quinn. By “target application” I mean the macOS host process that owns the VZVirtualMachine instance. It is distinct from the separate supervisor process. I do not mean a process inside the guest or an internal Apple virtualization helper. In this scenario, the VM-owning host process remains alive, but its serial VM-control queue has stopped progressing. The separate supervisor then also stops progressing before initiating the fallback action against that host process. So the intended target is that same VM-owning host-process instance. My question is whether a mechanism established beforehand can still act on it without further progress by either the supervisor or the VM-control queue.
Topic: App & System Services SubTopic: Core OS Tags:
1w
Reply to macOS: pre-established stop mechanism when a VM supervisor stops progressing
Thanks, Quinn. The launcher design we reviewed creates a child directly with fork(), then calls execvp() in the child. It does not use NSWorkspace or XPC. We have not adopted that design or observed a launch hang. On success, the parent gets the child’s PID from fork(), as you pointed out. My earlier wording was unclear: we were asking about the interval before the parent has returned from fork(), not about a successful launch that somehow returned no PID. Your answer settles the platform question for us: we cannot rely on an opt-in macOS watchdog to stop that helper for a particular run, or on a documented cleanup deadline. Thank you for clarifying.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
4d
Reply to macOS: pre-established stop mechanism when a VM supervisor stops progressing
Sorry. I didn’t explain the use case clearly. I’m building a tool that runs one job at a time in a VM on an Apple silicon Mac. A launcher prepares a directory for the job and starts a helper process. That helper owns the VM. If the job is cancelled, I must not reuse its files while something from that run may still be writing to them. My question is: can I arrange for macOS itself to stop the helper for that particular run if my launcher gets stuck, or does my design have to assume that another process remains responsive to do it? Here’s the case I need to cover. The launcher starts creating the helper, but the launch call never returns a PID. The helper may already be alive. A cancellation request then arrives from outside the launcher. The launcher can’t act on it, and the helper’s VM queue isn’t progressing either. The Mac and kernel are otherwise running. I’m not asking another app to take over the VM. I need to decide two things before allowing a job to start: Can protection be set up before creating the job directory or launching the helper? If there is a public API or system service for this, how would it receive the cancellation and identify the right helper and any child processes from that run, even if the launch call never returns? What timing, if any, is documented? Our requirement is to finish the stop attempt, including any required fallback if the first stop operation fails or hangs, within 10 seconds of the original cancellation. That is our requirement, not a deadline we assume macOS promises. We are not asking for a guarantee that the VM has finished shutting down or that its files are safe to reuse within those 10 seconds. If there’s a supported mechanism that covers only part of this, its name, applicable macOS versions and limits would help. If the design must instead assume a responsive external controller and has no documented 10-second bound, that’s useful too: it tells me not to start jobs that require that guarantee. Thank you!
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
5d
Reply to macOS: pre-established stop mechanism when a VM supervisor stops progressing
I understand the limitation of adding another supervisor, and I am not asking for bounded VM teardown. For our design decision, should we treat the following requirement as outside the documented public macOS contracts: a mechanism armed before workload preparation that can initiate the fallback independently when both the VM-control queue and the supervisor stop progressing, while their processes remain alive? The 10-second requirement concerns completion of the prescribed stop/escalation attempt, not guaranteed successful VM termination. If no documented public mechanism covers this scenario, that clarification is sufficient. If a narrower mechanism exists under explicit assumptions, could you identify it?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
1w
Reply to macOS: pre-established stop mechanism when a VM supervisor stops progressing
Thank you, Quinn. By “target application” I mean the macOS host process that owns the VZVirtualMachine instance. It is distinct from the separate supervisor process. I do not mean a process inside the guest or an internal Apple virtualization helper. In this scenario, the VM-owning host process remains alive, but its serial VM-control queue has stopped progressing. The separate supervisor then also stops progressing before initiating the fallback action against that host process. So the intended target is that same VM-owning host-process instance. My question is whether a mechanism established beforehand can still act on it without further progress by either the supervisor or the VM-control queue.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
1w