Strange Program behaviour

Had a strange thing going on with my code. It's ok I figured it out for myself....

What OS -
There is tusc truss strace ...

The most likely problems are
I/O wait
stuck in a loop that cannot exit for some reason

There are lots of other possibilities. The real question is - if it is a code problem how can you fix it?

Many thanks Jim, it was on SuSe but I managed to fix it just after I posted haha