migrated from http://devel.opensaf.org/ticket/2615
Two purposes:
- enable code coverage analysis, gcov requires a clean exit of the process to flush coverage data to file
- logging point
Solution: a common SIGTERM handler in daemon.c that logs and exit the process. Any daemon that wants to override this (e.g. amfnd) just install its own SIGTERM handler after calling daemonize()
Status:
- daemon_exit() calls _Exit() which does not call exit handlers which I believe gcov_flush is one of. This results in no coverage for some daemons for example amfd.
Proposals:
alt1) using pragma for weak linking check for symbol gcov_flush and call it if available before calling _Exit()
alt2) change _Exit() to exit(), not as safe and requires other threads to be shutdown first. Perhaps calling ncs_agent_shutdown() also in daemon_exit() ?
and some services (CKPT, IMM) are still not adapted
changeset: 4740:e88a997a8d61
tag: tip
user: Hans Nordeback hans.nordeback@ericsson.com
date: Tue Dec 17 12:48:18 2013 +0100
files: osaf/libs/core/common/daemon.c
description:
base: use _Exit instead of exit in daemon_exit. [#581]
The change was done due to
that exit() is not thread safe, see e.g. ticket #651.
To make it possible to dump e.g. coverage data on termination
a weak reference to __gcov_flush has been added.
Related
Tickets: #581
this ticket is not fixed yet! A few services remain to be fixed
IMM patches pending for review
Now missing e.g. ckpt
changeset: 4749:1aa3223aa903
user: Hans Feldt hans.feldt@ericsson.com
date: Thu Dec 19 09:28:13 2013 +0100
summary: immd: use daemon_sigterm_install (#581)
changeset: 4750:85a453678667
tag: tip
user: Hans Feldt hans.feldt@ericsson.com
date: Thu Dec 19 09:28:14 2013 +0100
summary: immnd: use daemon_sigterm_install (#581)
changeset: 4772:e64cd4d03118
user: Hans Feldt hans.feldt@ericsson.com
date: Thu Dec 19 16:56:17 2013 +0100
summary: cpd: use daemon_sigterm_install [#581]
changeset: 4773:9d2025e17a54
tag: tip
user: Hans Feldt hans.feldt@ericsson.com
date: Thu Dec 19 16:56:18 2013 +0100
summary: cpnd: use daemon_sigterm_install [#581]
Related
Tickets: #581
edsv, glsv, mqsv & dtm remains