LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-25-2009, 02:23 PM   #1
htamayo
Member
 
Registered: Jan 2005
Location: san salvador, el salvador
Distribution: Debian Stable, UbuntuStudio Karmic Koala
Posts: 190

Rep: Reputation: 30
how to know why an app is freezing


hi, suddenly an app was freezing -noatun- i killed the process and then load it but always is freezing. now, I did tail | dmesg but nothing weird in it.

my question is: is there a way|command that help me to know why is it freeze? why killing the process and then load it doesn't work?

all the best
 
Old 03-25-2009, 02:31 PM   #2
fpmurphy
Member
 
Registered: Jan 2009
Location: /dev/ph
Distribution: Fedora, Ubuntu, Redhat, Centos
Posts: 297

Rep: Reputation: 62
When it freezes what is the process state shown by the ps utility? Sleeping, stopped, or what? man ps for information on how to get the process state.
 
Old 03-25-2009, 02:40 PM   #3
htamayo
Member
 
Registered: Jan 2005
Location: san salvador, el salvador
Distribution: Debian Stable, UbuntuStudio Karmic Koala
Posts: 190

Original Poster
Rep: Reputation: 30
it's sleeping (S)
 
Old 03-25-2009, 04:29 PM   #4
JaksoDebr
Member
 
Registered: Mar 2009
Distribution: Fedora, Slackware
Posts: 104

Rep: Reputation: 21
Does this happen also after a reboot? Killing a single process does not always kill everything related to an application. A single launch of Firefox, for example, has more than a single process running, and to kill it, you need to kill all related processes for a clean start.

Linux Archive

Last edited by JaksoDebr; 04-02-2009 at 06:09 AM.
 
Old 03-25-2009, 05:06 PM   #5
htamayo
Member
 
Registered: Jan 2005
Location: san salvador, el salvador
Distribution: Debian Stable, UbuntuStudio Karmic Koala
Posts: 190

Original Poster
Rep: Reputation: 30
in fact, I'm interesting in tracking all related process, maybe the reboot could be easier, but for me is a dark-side kind of solution, brute force, like windows style
 
Old 03-25-2009, 06:50 PM   #6
jjuhl
LQ Newbie
 
Registered: Mar 2009
Distribution: Slackware
Posts: 3

Rep: Reputation: 0
A few utils for inspecting process state

There can be many reasons for a program to "hang".

Some of the utilities you can use to find out what's going on are;

'ps' - this will show you a list of running processes (you may want to run something like 'ps aux' to get more detail) including how much memory they use, what their current state is, their PID (process ID) etc etc. Can be very instructive.

Another good tool is 'top'. This will show you what processes are using a lot of CPU time, memory etc, show you the load of the system in general and various other details. It's a great way to get a snapshot look at how the system currently performs.

The 'vmstat' tool can show you details about memory use, page ins, page outs etc. You run it with an update frequency in seconds, like 'vmstat 3' and it then shows you a line with various details about the system memory utilization and more every <interval> seconds.

'sar' can be used to see how the system has performed over time.

If you want to see what a running process is currently doing, then strace, ltrace (or even gdb - the GNU debugger) are your friends. 'strace' will dump a log of the system calls the program is executing. 'ltrace' shows library calls the program is making. And 'gdb' is a interactive debugger allowing you complete inspection of the programs runtime state.
All 3 programs can be run as 'strace progname' to start <progname> under the tool, or you can use 'strace -p <pid>' to attach the tool to a running process id (same for ltrace and gdb).

You can also find various details by using 'ls -l' and 'cat' to view files in /proc/<pid_of_program>/

Read the 'man' pages for the tools I've mentioned and you should be well on your way to discovering why your programs "hang".
 
Old 03-25-2009, 11:56 PM   #7
dv502
Member
 
Registered: Sep 2006
Location: USA - NYC
Distribution: Whatever icon you see!
Posts: 642

Rep: Reputation: 57
Here is a way to kill a process and its child processes.


Code:
pkill -P $( pgrep script )
Replace the red with the name of the script or the name of the program.

BTW, have you tried reinstalling the program or doing an upgrade?

Another good tool is called strace as mention above. Strace traces all the function calls of an application. Do a man strace or google for its usage.

Also do a memory test, some live CDs have this feature. If your memory is beginning to fail, this will cause freezes and other intermitted problems.




- Good luck

Last edited by dv502; 03-26-2009 at 12:16 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Check if an app is running and if it's not launch this app Coume Linux - General 3 07-28-2008 03:34 AM
bash - start app, [do stuff], kill started app MiniMe001 Programming 3 03-19-2008 04:06 PM
script or app mailcheck app from shell pandersson61 Linux - Software 1 03-24-2006 09:16 PM
Freezing, app crashes with Rage XL vid card on Mdk 10.1 CE redlogan23 Linux - Hardware 0 01-17-2005 12:03 PM
New app install, or, I've d/l'd the app, now what? Dani Linux - Newbie 4 01-06-2002 09:24 PM


All times are GMT -5. The time now is 06:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration