Srin, What is G_system returning? What is your hardware and OS? You may want to compile with -g and step through it with a debugger. Specifically, check each signal.