tprocess in linux failed after 1 hour running lazarus / 8-Other ---------------------------------------------------------------------- hsbelli · 2009-10-05 19:49 hi, i have a problem with this code:  with TProcess.Create(nil) do           try              CommandLine:= 'mplayer -quiet -zoom -wid '+ IntToStr(fWindow2) +              ' '+laubicacion+elarchivo;              Execute;              while Running do              Application.ProcessMessages;           finally            Free;           end; This code execute mplayer that show a video files (ej:.mpeg,.avi) in a embebed windows. After 1 hour running very well, i obtaing this error: GLib:ERROR:gmain.c:1817:g_main_dispatch: assertion failed: (current->dispatching_sources == ¤t_source_link) Any idea for solve this error?. Please i need help urgent. thanks. ---------------------------------------------------------------------- Marc · 2009-10-06 09:30 does mplayer produce some output while playing ? (errors or other info) ---------------------------------------------------------------------- hsbelli · 2009-10-07 12:52 hi, thanks for your reply. this the message thath mplayer show: [pulse] working around probably broken pause functionality,         see http://www.pulseaudio.org/ticket/440 AO: [pulse] 48000Hz 2ch s16le (2 bytes per sample) Starting playback... VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12) VDec: using Planar YV12 as output csp (no 0) Movie-Aspect is 1.33:1 - prescaling to correct movie aspect. VO: [xv] 720x576 => 768x576 Planar YV12  [zoom] X11 error: BadAccess during XSelectInput Call X11 error: The 'ButtonPressMask' mask of specified window has probably already used by another appication (see man XSelectInput) X11 error: MPlayer discards mouse control (reconfiguring) the application is simple ejecute a tproccess thath call mplayer for view a video files where are in a xml file, when the list of file end. the procedure start again. thanks. ---------------------------------------------------------------------- Bart · 2009-10-07 21:55 Is it possible that you do multiple process.execute and that after executing a zombie process remains? In that case after a while you're gonna run out of available file handles possibly. When I run 'ps ax' in a program like this Code: [Select]begin   p := TProcess.Create(nil);   try     try       p.CommandLine := 'ps ax';       p.Execute;     except       on E: exception do writeln(E.ClassName,': ',E.Message);     end;   finally     p.free;   end; then when I run ps ax in a seprate console it shows me: Code: [Select]6036 pts/1    Z+     0:00 [ps] And this zombie process will not go away until my program has finished. Bart ---------------------------------------------------------------------- Marc · 2009-10-08 09:37 oops, I thought you were using pipes, in that case if more messages are printed, you need to read the Porcess.Output pipe ---------------------------------------------------------------------- hsbelli · 2009-10-08 14:29 hi, yes i think is very posible tath where the problem i have. but how kill this zombie process?. give me any example please. thanks ---------------------------------------------------------------------- Bart · 2009-10-08 22:08 I think you need poWaitOnExit in the TProcess.Options to avoid zombie processes. Your program will not continue until the process you start finishes than Also it is possible to obtain the PID of the process you started. With this info you can kill the process (others may be able to tell you how). Bart ---------------------------------------------------------------------- hsbelli · 2009-10-09 14:19 hi, i dont use the options poWaitOnExit , because i need any other process run. Exists any way for not generate zombie process?, or how to kill this process without PID. thanks