[fpc-pascal] Linux program sometimes crashes with "EProcess : Failed to create pipes"
fpc at bcsoft.de
Thu Sep 10 12:44:07 CEST 2009
Am Donnerstag, 10. September 2009 11:01 schrieb T. Guilleminot:
> Have a Linux program that recently started to crash several times
> with such message :
> An unhandled exception occurred at $080A4CB9 :
> EProcess : Failed to create pipes
> This seems only occurs after a long running period of time.
> Considering error message and as it runs very often some OS processes
> I suspect TProcess. I use such procedure :
> Procedure Run_Command(Wait : boolean; TheCommand : ansistring);
> cdecl; export;
> AProcess: TProcess;
> AProcess := TProcess.Create(nil);
> AProcess.CommandLine := TheCommand;
> if Wait = true then AProcess.Options := AProcess.Options +
> I think I may hit some OS limits or I overload system.
> Does anyone know how to diagnose this further (why it fails...)
> and/or to fix this ?
Using this procedure with wait=false leaves you a zombie process. I.e.
even, if "TehCommand" finished, the process isn't closed unless you
call fpWaitPID (or better WaitOnExit) on it's pid.
Not sure, but probably the zombie still holds the pipes and therefore
you run out of handles and some point.
see also: http://mantis.freepascal.org/view.php?id=11797
More information about the fpc-pascal