site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com User-agent: Thunderbird 2.0.0.24 (Macintosh/20100228) Determine why forkpty() is failing by checking errno; see 'man forkpty'. Perhaps you aren't closing your file descriptors. Thanks to Dave and Jonas for the advice! /Ingemar _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Dave Keck wrote: How would you debug a problem like this? Are there pitfalls and limitations in process launching that I ought to know about? Yes, there are limitations on forking; see 'man fork'. You need to wait on your child processes to have their state cleaned up within the kernel. Failing to do so will prevent you from forking new processes. My checks for terminated processes were not complete, and, in particular, my manual process termination wasn't safe. I used kill() with SIGTERM, and if that failed, SIGKILL, but if that failed I just ignored it. After testing this thoroughly, I have found that SIGKILL often fails, which then leaves that process in an unknown state, possibly blocking pty's. I am not sure if that is an expected behavior. My current solution is to try SIGKILL over and over, up to 1000 times, until it works. I find that it usually works after one or two tries, but sometimes I see as much as ten tries. I have tested for a whikle and it hasn't failed me so far. But is this violent bashing against a process until it dies, is this really the way to do it? This email sent to site_archiver@lists.apple.com
participants (1)
-
Ingemar Ragnemalm