strace is a command used to print stack trace of a running process.
strace will show all system calls and signals.
To view stack trace of a process ID 12345 use following command:
$ strace -o strace.out -p 12345
To view stack trace of firefox process use following command:
$ strace -o strace.out -p `pidof firefox`
Both commands will write stack trace output to strace.out file.
strace command requires root permission, so to run strace command either you need to login as root or use it with sudo.