You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Truman Lackey (Jira)" <lo...@logging.apache.org> on 2021/12/10 22:21:00 UTC

[jira] [Commented] (LOGCXX-537) double mutex lock

    [ https://issues.apache.org/jira/browse/LOGCXX-537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17457393#comment-17457393 ] 

Truman Lackey commented on LOGCXX-537:
--------------------------------------

I have create a github repo that with instructions and code on how to reproduce this issue.
[https://github.com/bowb/log4cxx_mutex_error|https://github.com/bowb/log4cxx_mutex_error] 

> double mutex lock
> -----------------
>
>                 Key: LOGCXX-537
>                 URL: https://issues.apache.org/jira/browse/LOGCXX-537
>             Project: Log4cxx
>          Issue Type: Bug
>          Components: Appender
>    Affects Versions: 0.12.1
>         Environment: Ubuntu 18.04
>            Reporter: Truman Lackey
>            Priority: Major
>
> There is a possibility of the SocketAppender calling std::unique_lock<log4cxx::shared_mutex> lock(mutex) twice causing a deadlock exception. In socketappenderskeleton.cpp connect call if the exception is caught on line 118 then fireConnector() will be called.  On line 160 the mutex is attempted to be locked again but it has already been locked in the appendersleketo.cpp doAppend call. This causes log4cxx to throw a  std::err::resource_deadlock_would_occur



--
This message was sent by Atlassian Jira
(v8.20.1#820001)