Bug 24924 - System.Diagnostics.Process remains as zombie
Summary: System.Diagnostics.Process remains as zombie
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-28 11:29 UTC by benapetr
Modified: 2014-11-28 11:29 UTC (History)
1 user (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description benapetr 2014-11-28 11:29:40 UTC
I have this code:

                            Process proc = new Process
                            {
                                StartInfo = new ProcessStartInfo
                                {
                                    FileName = ts.task.Path,
                                    Arguments = ts.parameters,
                                    UseShellExecute = false,
                                    RedirectStandardOutput = true,
                                    RedirectStandardError = true,
                                    CreateNoWindow = true
                                }
                            };

                            proc.Start();
                            while (!proc.StandardOutput.EndOfStream || !proc.StandardError.EndOfStream)
                            {
                                string line;
                                if (!proc.StandardOutput.EndOfStream)
                                    line = proc.StandardOutput.ReadLine();
                                else
                                    line = proc.StandardError.ReadLine();
                                if (ts.channel == null)
                                    IRC.DeliverMessage(line, ts.user);
                                else
                                    IRC.DeliverMessage(line, ts.channel);
                            }
                            proc.Close();
                            proc.Dispose();

It does in most cases create a new process, which finish and then remain as a zombie. Is this a bug in mono, or do I miss something to clean up? Happens on linux only.

Note You need to log in before you can comment on or make changes to this bug.