Keeping an eye on hung system calls..

Alex Sayle alexs at alphacomplex.info
Tue Jun 6 12:07:36 BST 2006


On 6 Jun 2006, at 11:14BDT, Toby Corkindale wrote:

> Hi,
> I have a little app to make jpeg thumbnails out of video files.  
> It's nothing
> special, it just spawns mplayer to get a jpeg out of the first frame..
> However I have a problem with mplayer occaisionally getting hung on  
> some files
> it can't handle well, and never exitting.
> So, this lead me to wonder about methods of keeping an eye on system 
> () calls.

<snip />

> I was wondering.. perhaps this conundrum has already been solved?  
> Or am I just
> going in totally the wrong direction?

there's always LD_PRELOAD.

you define symbols in a shared library, in this case system() over  
load it and have
fun. examples attached. [1]

you could overload the system() call and place some logic for  
monitoring it, maybe
place a hart beat system so if it doesn't proclaim its alive status a  
Ninja daemon
could assassinate the zombie processes.


[1]
check make file for details. The gritty details are in libsystem.c in  
the init() call.


HTH.
-------------- next part --------------

--
[----------------------------------------------------------------------]
  Alex Sayle                                     alexs at alphacomplex.info




More information about the london.pm mailing list