- **Type**: defect --> enhancement


---

** [tickets:#115] LOG: _logtrace_log causes SEGV**

**Status:** unassigned
**Milestone:** future
**Created:** Mon May 13, 2013 07:54 AM UTC by elunlen
**Last Updated:** Thu Jun 27, 2013 08:04 AM UTC
**Owner:** nobody

If an application uses dynamic loading (dlopen(), not during link time) and 
loads and unloads (with dlclose()) an OpenSAF library that has called 
logtrace_init(), the application will crash with SEGV as soon as the 
application logs anything after the dlclose()-call.

This occurs because logtrace.c (osaf/lib/core/common/logtrace.c:163) saves a 
pointer to a const string that holds the name of the "agent-library". If 
logging has been initiated in the dlopened library, the pointer ('ident', 
defined in logtrace.c:46) will point to an address within the loaded library, 
and once the lib is unloaded, that address will become invalid.

Currently there are two ways of avoiding the problem, none of them are good:
1) Call logtrace_init(strdup("imma"),....): That will cause a (small) 
memory-leak every time the trace-system is initiated.
2) Don't use logtrace_init() in libraries: Makes it hard to debug the system.

Migrated from #2628 at devel.opensaf.org


---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/opensaf/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/opensaf/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Opensaf-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets

Reply via email to