Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Linux (Redhat FC5), gcc-4.1.1, GNU ld 2.16, APR 1.2.2, APR-util 1.2.7
Description
(There is a bug that describes similar symptoms, LOGCXX-112, now closed; I couldn't figure out how to re-open it).
I'm getting SEGFAULTs while trying to access log4cxx functions from a destructor of a global class instance. After some digging here's what I found: it seems that local static variables used by some log4cxx functions get destructed too early, (e.g., the string in NDC::getNull). The destructors of these object get called before the static destructors of user classes (I verified this in a debugger). I can also demonstrate this behavior in a completely isolated (not using log4cxx), simple program. I actually suspect this may be a "feature" of gcc and/or GNU ld, not necessarly a problem with log4cxx, since like I said it happens consitently with or without log4cxx code.
I'm quite sure changing local static vars to be global (either standalone or as static class-members) will solve this.
Attachments
Attachments
Issue Links
- is related to
-
LOGCXX-112 change "static" to "auto" for Transcoder::decode() decoder and CharsetDecoder::getDefaultDecoder() decoder
- Resolved