[devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-03 Thread Hans Feldt
osaf/libs/core/common/daemon.c | 9 ++--- 1 files changed, 6 insertions(+), 3 deletions(-) By calling exit() instead of _Exit() registered exit functions are called. This enabled for example flushing of gcov data. diff --git a/osaf/libs/core/common/daemon.c b/osaf/libs/core/common/daemon.c

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-07 Thread Mathivanan Naickan Palanivelu
On a related topic, I had this patch written(untested) sometime back for the rest of the services Some things to consider - add graceful (pthread cancel and join) exit for log service(now that there is a separate thread introduced) - see if imm's sub processes needs-to/can be gracefully shutdow

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-07 Thread Anders Widell
I am a bit suspicious about cancelling threads - the safest solution is if you can ask the thread nicely to shut down itself. Regarding the problems we had in IMM related to calling exit() - there is actually a coding rule in the Google coding standard that forbids global objects: http://googl

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-07 Thread Hans Feldt
Great that you have done this but I think you should split your patch into several per service or even per daemon. Thanks, Hans On 10/07/2013 10:06 AM, Mathivanan Naickan Palanivelu wrote: > On a related topic, I had this patch written(untested) sometime back for the > rest of the services > Som

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-09 Thread Mathivanan Naickan Palanivelu
> -Original Message- > From: Anders Widell [mailto:anders.wid...@ericsson.com] > Sent: Monday, October 07, 2013 5:58 PM > To: Mathivanan Naickan Palanivelu; Hans Feldt > Cc: opensaf-devel@lists.sourceforge.net > Subject: Re: [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-09 Thread Anders Widell
Ack from me. I guess we should also go through the code and make sure we follow this rule from the Google C++ Style guide: Static and Global Variables Static or global variables of class type are forbidden: they cause hard-to-find bugs due to indeterminate order of construction and destructio

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-09 Thread Anders Björnerstedt
; mathi.naic...@oracle.com Cc: opensaf-devel@lists.sourceforge.net Subject: Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581] Ack from me. I guess we should also go through the code and make sure we follow this rule from the Google C++ Style guide: Static and Global

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-09 Thread Anders Widell
ersBj > > -Original Message- > From: Anders Widell [mailto:anders.wid...@ericsson.com] > Sent: den 9 oktober 2013 15:52 > To: Hans Feldt; mathi.naic...@oracle.com > Cc: opensaf-devel@lists.sourceforge.net > Subject: Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to c

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-09 Thread Anders Björnerstedt
: Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581] Wasn't it IMM that got into trouble last time we played with exit() :-) These objects will be destroyed when we call exit(). Are they accessed by any thread besides the main thread? Anyway, I suppose it wouldn

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-09 Thread Anders Björnerstedt
To: Anders Widell; Hans Feldt; mathi.naic...@oracle.com Cc: opensaf-devel@lists.sourceforge.net Subject: RE: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581] Played with exit? Are you referring to the episode with illegal stuff in the signal handler ? /AndersBj -Origin

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-09 Thread Anders Björnerstedt
9 oktober 2013 19:23 To: Anders Widell; Hans Feldt; mathi.naic...@oracle.com Cc: opensaf-devel@lists.sourceforge.net Subject: RE: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581] Played with exit? Are you referring to the episode with illegal stuff in the signal handler ?

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-10 Thread Anders Widell
om] > Sent: den 9 oktober 2013 19:33 > To: Anders Widell; Hans Feldt; mathi.naic...@oracle.com > Cc: opensaf-devel@lists.sourceforge.net > Subject: Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call > exit() [#581] > > And no they are not acccessed by any other thread

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-10 Thread Anders Björnerstedt
sson.com] > Sent: den 9 oktober 2013 19:33 > To: Anders Widell; Hans Feldt; mathi.naic...@oracle.com > Cc: opensaf-devel@lists.sourceforge.net > Subject: Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to > call exit() [#581] > > And no they are not acccessed by any other t

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-10 Thread Anders Widell
t; /AndersBj > > -Original Message- > From: Anders Widell > Sent: den 10 oktober 2013 10:32 > To: Anders Björnerstedt; Hans Feldt; mathi.naic...@oracle.com > Cc: opensaf-devel@lists.sourceforge.net > Subject: Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to ca

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-10 Thread Anders Björnerstedt
; Hans Feldt; mathi.naic...@oracle.com Cc: opensaf-devel@lists.sourceforge.net Subject: Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581] Yes, but even if you protect the global data with e.g. a mutex, you can still get unexpected problems when you call exit(). exit() will

Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-10 Thread Anders Widell
rt(). >>> >>> But I have never seen any interference caused by that, such as >>> strange core dumps while navigating the statically allocated c++ data. >>> >>> Only the exit donw by the signal handler has caused that kind of problem. >>> >