1

I have a program which takes a lot of time to crash.

Is it possible to run the program and trace what is happening into a file, like trus does?

5
  • 1
    What's wrong with truss? On Linux, you have strace, if it's not available. Commented Jan 12, 2012 at 15:57
  • 1
    Uh, use truss (Solaris & others) or strace (Linux) just like you said? What's your question? Commented Jan 12, 2012 at 15:57
  • Is compiled program, or do you have it's sources? Commented Jan 12, 2012 at 15:58
  • Or just wait till it crashes and analyse the core file (gdb on Linux / BSD, DRWatson on MSWindows) Commented Jan 12, 2012 at 15:59
  • i have the source, thanks, i'll try the strace.. the program is huge and it runs for 8 - 10 days until it crashes. Commented Jan 12, 2012 at 16:11

1 Answer 1

2

"It depends".

If the program is doing a lot of system calls, like being very I/O intensive, you can probably glean something useful from running it through strace. Otherwise, you might want to try profiling it and inspecting the profile. Note that profiling often requires that you are able to re-build the program to add the profiling instrumentation code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.