LinuxQuestions.org
Register a domain and help support LQ
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 01-16-2011, 01:25 AM   #1
awanish.tiwari
LQ Newbie
 
Registered: Jan 2011
Posts: 3

Rep: Reputation: 0
Zombie process


Hi,

I have a php cron job on a linux server.
This php file creates threads, does the business logic, harvests threads and exits every half an hour.
But randomly, like once a week, it becomes a zombie process and I have manually kill it.

Can somebody help me with possible reason or areas where I should focus to fix this.

Thanks in advance!
 
Old 01-16-2011, 05:48 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi, welcome to LQ!

zombies commonly occur when the process is waiting on a resource
that has become unavailable. You could possibly check with strace
what the process is up to.



Cheers,
Tink
 
Old 01-17-2011, 07:13 AM   #3
awanish.tiwari
LQ Newbie
 
Registered: Jan 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Hey Tink!

Thanks for your reply. I looked around for strace. It looks like a tool to record system calls.

So you mean, I should use strace on the process when it becomes a zombie, right? If yes, please confirm and I will wait for the process to be a zombie again (normally once a week).


Thanks again! ( I will come back to you with my findings)
 
Old 01-17-2011, 11:25 AM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by awanish.tiwari View Post
Hey Tink!

Thanks for your reply. I looked around for strace. It looks like a tool to record system calls.

So you mean, I should use strace on the process when it becomes a zombie, right? If yes, please confirm and I will wait for the process to be a zombie again (normally once a week).
That was the plan indeed ... just attach to the process (in the hopes that
you can find what it's waiting on).

Quote:
Originally Posted by awanish.tiwari View Post
Thanks again! ( I will come back to you with my findings)
Good good :}



Cheers,
Tink
 
Old 01-21-2011, 12:13 PM   #5
awanish.tiwari
LQ Newbie
 
Registered: Jan 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Hey Tink,

Sorry to bother you again!
Today the process became zombie again (the parent).
I ran strace -p <pid>, and I got this output:

Process 21077 attached - interrupt to quit
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)

Can you suggest something to interpret this?
 
Old 01-21-2011, 01:45 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
You could try to look in /proc/<PID>/fd whether 7 is still there ...

If it's not you're out of luck, and your only chance would be
to execute the process under strace all together, but that would
make for a HUGE log.



Cheers,
Tink
 
  


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
zombie process at bootup llesher@readingeagle.com Linux - Server 2 12-07-2010 03:38 PM
zombie process sang_froid Linux - Server 1 05-25-2010 09:23 AM
Zombie Process N|k0N Linux - Security 8 09-22-2007 03:01 AM
zombie process ihatecomputers Linux - Software 2 03-24-2005 08:09 AM
Zombie Process Handling kghoshal Linux - Newbie 2 07-21-2003 10:10 AM


All times are GMT -5. The time now is 02:12 AM.

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