How to check, which limit was exceeded? (Process terminated because of ulimit. )

view story

http://unix.stackexchange.com – Let's assume process runs in ulimited environment : ( ulimit ... -v ... -t ... -x 0 ... ./program ) Program is terminated. There might be many reasons : memory/time/file limit exceeded ; just simple segfault ; or even normal termination with return code 0. How to check what was the reason of program termination, without modifying program? (HowTos)