You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Gerrit van Doorn <gd...@newwireless.com> on 2009/05/13 20:51:44 UTC

MutexException at exit when using SocketHubAppender

When I use SocketHubAppender and the application exits I get a "Debug 
Error!" message telling me the application requested the Runtime to 
terminate in an unusual way. When debugging the application it runs fine 
(I receive messages in Chainsaw) but when the application exits it tells me:
"Unhandled exception at .... in ... Microsoft C++ exception: 
log4cxx::helpers::MutexException at memory location ...".

Is there a solution to this? Am I using the SocketHubAppender 
incorrectly? My config is:

log4j.rootLogger=TRACE, SOCKETHUB
log4j.appender.SOCKETHUB=org.apache.log4j.net.SocketHubAppender
log4j.appender.SOCKETHUB.port=4445

Re: MutexException at exit when using SocketHubAppender

Posted by Stephen Webb <st...@ieee.org>.
> 
> See https://issues.apache.org/jira/browse/LOGCXX-278, which is fixed in 0.10.1 
that has never been released.
> On Wed, May 13, 2009 at 2:51 PM, Gerrit van Doorn <gdoorn <at> 
newwireless.com> wrote:When I use SocketHubAppender and the application exits I 
get a "Debug Error!" message telling me the application requested the Runtime to 
terminate in an unusual way. When debugging the application it runs fine (I 
receive messages in Chainsaw) but when the application exits it tells me:
> 
> "Unhandled exception at .... in ... Microsoft C++ exception: 
log4cxx::helpers::MutexException at memory location ...".
> Is there a solution to this? Am I using the SocketHubAppender incorrectly? My 
config is:
> log4j.rootLogger=TRACE, SOCKETHUB
> log4j.appender.SOCKETHUB=org.apache.log4j.net.SocketHubAppender
> log4j.appender.SOCKETHUB.port=4445
> 
> 
> -- Dale King
> 

To fix this remove the LogLog::debug(...) lines from SocketHubAppender::close(). 
As the application shuts down, the mutex used by LogLog is deleted before 
SocketHubAppender::close() is called. 

You also should remove the throw ThreadException() from Thread::join() as the 
tread can be stopped when this is called. 

-- Stephen Webb




Re: MutexException at exit when using SocketHubAppender

Posted by Dale King <da...@gmail.com>.
See https://issues.apache.org/jira/browse/LOGCXX-278, which is fixed in
0.10.1 that has never been released.

On Wed, May 13, 2009 at 2:51 PM, Gerrit van Doorn <gd...@newwireless.com>wrote:

> When I use SocketHubAppender and the application exits I get a "Debug
> Error!" message telling me the application requested the Runtime to
> terminate in an unusual way. When debugging the application it runs fine (I
> receive messages in Chainsaw) but when the application exits it tells me:
> "Unhandled exception at .... in ... Microsoft C++ exception:
> log4cxx::helpers::MutexException at memory location ...".
>
> Is there a solution to this? Am I using the SocketHubAppender incorrectly?
> My config is:
>
> log4j.rootLogger=TRACE, SOCKETHUB
> log4j.appender.SOCKETHUB=org.apache.log4j.net.SocketHubAppender
> log4j.appender.SOCKETHUB.port=4445
>



-- 
Dale King

Re: MutexException at exit when using SocketHubAppender

Posted by Gerrit van Doorn <gd...@newwireless.com>.
Oh I forgot to mention I use log4cxx version 0.10.0.
Has anyone used SocketHubAppender successfully?

Gerrit van Doorn wrote:
> When I use SocketHubAppender and the application exits I get a "Debug 
> Error!" message telling me the application requested the Runtime to 
> terminate in an unusual way. When debugging the application it runs 
> fine (I receive messages in Chainsaw) but when the application exits 
> it tells me:
> "Unhandled exception at .... in ... Microsoft C++ exception: 
> log4cxx::helpers::MutexException at memory location ...".
>
> Is there a solution to this? Am I using the SocketHubAppender 
> incorrectly? My config is:
>
> log4j.rootLogger=TRACE, SOCKETHUB
> log4j.appender.SOCKETHUB=org.apache.log4j.net.SocketHubAppender
> log4j.appender.SOCKETHUB.port=4445
>