You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Thorsten Schöning (Jira)" <lo...@logging.apache.org> on 2020/03/03 07:46:00 UTC
[jira] [Comment Edited] (LOGCXX-394) Levels are not thread safe
[ https://issues.apache.org/jira/browse/LOGCXX-394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15607820#comment-15607820 ]
Thorsten Schöning edited comment on LOGCXX-394 at 3/3/20 7:45 AM:
------------------------------------------------------------------
The changes to Level in this bug lead to memory leaks, as reported by a user in the following thread:
http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/201610.mbox/%3C516ac3df-9119-3dc0-b7c7-5eba797a4ea5%40visualact.se%3E
I currently don't reopen the bug because we accept leaks in other bugs like LOGCXX-322 in APRInitializer as well and getting the lib better usable in multi-threaded apps seems more important in my mind than those leaks. If anyone has a better workaround/solution with not leaking, which fixes this bug, feel free to add some note.
was (Author: tschoening):
The changes to Level in this bug lead to memory leaks, as reported by a user in the following thread:
http://mail-archives.apache.org/mod_mbox/logging-log4cxx-user/201610.mbox/<516ac3df-9119-3dc0-b7c7-5eba797a4ea5%40visualact.se>
I currently don't reopen the bug because we accept leaks in other bugs like LOGCXX-322 in APRInitializer as well and getting the lib better usable in multi-threaded apps seems more important in my mind than those leaks. If anyone has a better workaround/solution with not leaking, which fixes this bug, feel free to add some note.
> Levels are not thread safe
> --------------------------
>
> Key: LOGCXX-394
> URL: https://issues.apache.org/jira/browse/LOGCXX-394
> Project: Log4cxx
> Issue Type: Bug
> Components: Appender
> Environment: Windows 7, Visual Studio 2010 SP1
> Reporter: Petro Protsyk
> Assignee: Thorsten Schöning
> Priority: Minor
> Labels: thread-safety
>
> Level.cpp. All default level variables are function static. This is not thread safe, especially in Visual C++ compiler.
> Here is code to reproduce the issue in VC++ 2010:
> Concurrency::parallel_for (int(0), int(10), [&](int i)
> {
> if (::log4cxx::Level::getWarn() == NULL)
> {
> throw std::exception();
> }
> });
--
This message was sent by Atlassian Jira
(v8.3.4#803005)