- **assigned_to**: Hans Feldt --> nobody
---
** [tickets:#115] LOG: _logtrace_log causes SEGV**
**Status:** unassigned
**Created:** Mon May 13, 2013 07:54 AM UTC by elunlen
**Last Updated:** Mon May 13, 2013 10:37 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.------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Opensaf-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets