Using Dtrace to get system call Oracle Solaris

No comments


This post focuses on dtrace and truss command usages and benefits for Oracle Solaris 10 Operating System.Dtrace is a debugging tool which used in Oracle Solaris.

One of customer getting an unexpected error from java process . This process getting a sigterm signal.Application vendor couldn’t find which process sending sigterm signal to their application.

I tried to using truss command to get all attempts for the application process. I monitored application process with truss command and save all truss output to a file and also print every syscall and analyze it to find out why application is going down.

Take a  look this link to  check how to  monitor process with  truss  command.

As you see  at  one of the line  there  is  sigterm  signal. Application is  going down beacuse  of this  sigterm  signal.

/4:         Received signal #15, SIGTERM, in lwp_cond_wait() [caught]

The  next step  is  find  out  which process  sends  sigterm  signal to application.Fortunately, Oracle  Solaris has a powerful debugging tool which named  DTrace.It could  help us  to dig kernel system call and find  out what  is  doing  in background.

It’s time to  debugging kernel  system call  with  dtrace.First  I create a dtrace  probe  which shows system call.I listed  all syscall  with  “kill” command.I’ll try to get SIGTERM signal so  defined  signal  value “15” on dtrace  probe.

Dtrace  probe Script:

Now let’s  find which  process sends sigterm signal with a  simple test.

Step 1:Start  dtrace  probe

Run script and wait  for  SIGTERM signal.

Step 2:Create  a simple sleep process

Step 3:Check process ID  for dumy sleep process

Step 4:Send SIGTERM signal to dumy process

Step 5:Check dtrace  prob  logs

We  find that the  process which send sigterm to our  dumy sleep  process  is “sh”  process related  to my  SSH session.

Also  Please watch this video.I show  my test results.

Follow me


I'm a System Engineer with extensive experience and administration skills and works for Interbank Card Center Of Turkey.I provide hardware and software support for the following Unix/Linux and Windows platforms.(Oracle Solaris,HP-UX, Linux, IBM-AIX, Windows Servers)
Follow me
facebooktwittergoogle_pluslinkedinby feather