in reply to Program hangs

A tool like strace that can dump out what system calls are being made can provide insight into strange hangs like this. You may want to have the services of a seasoned C programmer or sysadmin handy if you're not familiar with it.