[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: Hanging process cannot be killed except from "kill -9"



Radtanapan,


>> I tried them already but they didn't work.

 >> It's an application process which is developed from C/C++.

 

Have you written signal handler functions into your code?  Perhaps that
would

be the next step.  It sounds like your application is getting stuck in a
"blocking"

section of code, waiting for some IO that never comes.  It can't exit the
loop

unless the IO arrives, (Which it never will,) or until you break the
execution via

kill -9.  This is not the right forum to get a C++ answer, but here's my
attempt;

 

You need to debug your code to find the section of code that your
application is

hanging in.  Probably a conditional loop with impossible conditions.  You
also need

to have signal-handling code in your application.  You could use an existing
signal

like HUP, or CONT, or use a user-defined signal, (man signal(7) for more
info,) to

set a boolean "continue" flag.  Add that boolean flag to the conditional
loop you

found while debugging, so that if the signal handler is triggered, the loop
exits.

now you can clean up your resources properly, before
quitting/reloading/restarting/etc.

 

This I just a guess though.  If you need more detail on how to do the above,
may I

suggest google, as I have not written a C++ app from scratch since I was in
college. 

 

Regards,

 

Gavin McDonald

========================

EVI Logistic Enterprises

email: me gavitron com

phone: (604) 313-3845

 

 

  _____  

From: Radtanapan Janjanejob [mailto:radtanapan yahoo com] 
Sent: Tuesday, October 25, 2005 12:19 AM
To: me gavitron com; General Red Hat Linux discussion list
Subject: RE: Hanging process cannot be killed except from "kill -9"

 

Gavin,

 

Here are more info. about my questions.

 

What about sending the hung process a different signal, 
like SIGHUP or SIGTERM to get it to clean up properly...?



I cant answer your first question, since you would have
to specify _WHAT_PROCESS_ is hanging.

Regards,

 

Gavin McDonald <gavitron gmail com> wrote:

What about sending the hung process a different signal, 
like SIGHUP or SIGTERM to get it to clean up properly...?

I cant answer your first question, since you would have
to specify _WHAT_PROCESS_ is hanging.

For your second question, Yes there is a work around; Don't
write code that hangs.. ;)

-G


Regards,

Gavin McDonald
========================
EVI Logistic Enterprises
email: me gavitron com
phone: (604) 313-3845



> -----Original Message-----
> From: redhat-list-bounces redhat com [mailto:redhat-list-
> bounces redhat com] On Behalf Of Radtanapan Janjanejob
> Sent: Sunday, October 23, 2005 11:06 PM
> To: redhat-list redhat com
> Subject: Hanging process cannot be killed except from "kill -9"
> 
> I understand that this issue used to be posted in many web site . However,
> most of users delighted with "kill -9" command even though the resource
> cannot be returned clearly. I would very much appreciated if anyone can
> give me an advice for the following questions:
> 
> - Is it the known issue of the Red Hat?
> - Is there any workaround/solution which is better than "kill -9" e.g.
> coding style or how to tune machine?
> 
> Thanks
> 
> 
> 
> ---------------------------------
> Yahoo! FareChase - Search multiple travel sites in one click.
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request redhat com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request redhat com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]