Yaron Yeshaya (JIRA | 20 May 2012 16:33
Picon
Favicon

[jira] [Created] (LOG4NET-339) log4net.Appender.EventLogAppende cause our application to stuck.

Yaron Yeshaya created LOG4NET-339:
-------------------------------------

             Summary: log4net.Appender.EventLogAppende cause our application to stuck. 
                 Key: LOG4NET-339
                 URL: https://issues.apache.org/jira/browse/LOG4NET-339
             Project: Log4net
          Issue Type: Bug
          Components: Appenders
    Affects Versions: 1.2.10
         Environment: Windows Server 2008 R2 SP1
            Reporter: Yaron Yeshaya

Randomly one of our COM Service (.Net 4.0 Windows service that exposes com interface) stop processing com
calls. We spoke with Microsoft and sent the the application dump file.
Microsoft claims that from the dump it looks like log4net issue: "we are appending the events 04ACEEE0
00f3ba38 log4net.Appender.EventLogAppender and we are waiting on it
(clr!WaitForMultipleObjectsEx_SO_TOLERANT+0x56  --wait).
The issue seems to be coming from log4net."

Did you encountered such an issue?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

Ron Grabowski (JIRA | 21 May 2012 02:51
Picon
Favicon

[jira] [Commented] (LOG4NET-339) log4net.Appender.EventLogAppende cause our application to stuck.


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

Ron Grabowski commented on LOG4NET-339:
---------------------------------------

Can you provide a method name or a better stack trace? The appender eventually calls down to this:

EventLog.WriteEntry(m_applicationName, eventTxt, entryType, eventID, category);

without any fancy locking. How do you know that WriteEntry isn't the problem?

http://svn.apache.org/viewvc/logging/log4net/trunk/src/Appender/EventLogAppender.cs?view=markup

                
> log4net.Appender.EventLogAppende cause our application to stuck. 
> -----------------------------------------------------------------
>
>                 Key: LOG4NET-339
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-339
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: Windows Server 2008 R2 SP1
>            Reporter: Yaron Yeshaya
>
> Randomly one of our COM Service (.Net 4.0 Windows service that exposes com interface) stop processing com
(Continue reading)

Yaron Yeshaya (JIRA | 21 May 2012 08:06
Picon
Favicon

[jira] [Commented] (LOG4NET-339) log4net.Appender.EventLogAppende cause our application to stuck.


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

Yaron Yeshaya commented on LOG4NET-339:
---------------------------------------

I have the analysis of the memory dump:

Offending stack:
04acee80 752e0bdd ntdll!NtWaitForMultipleObjects+0x15
04acef1c 76e91a2c KERNELBASE!WaitForMultipleObjectsEx+0x100
04acef64 738af2ea kernel32!WaitForMultipleObjectsExImplementation+0xe0 -->wait.
04acefc8 738af118 clr!WaitForMultipleObjectsEx_SO_TOLERANT+0x56  -->wait 
04acefe8 738aef58 clr!Thread::DoAppropriateAptStateWait+0x4d
04acf07c 738af019 clr!Thread::DoAppropriateWaitWorker+0x17d
04acf0e8 73989d56 clr!Thread::DoAppropriateWait+0x60
04acf1e8 72d4b77f clr!WaitHandleNative::CorWaitOneNative+0x196
04acf200 72d4b73d
mscorlib_ni!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle,
Int64, Boolean, Boolean)+0x2b
04acf220 00d70626 mscorlib_ni!System.Threading.WaitHandle.WaitOne(Int32, Boolean)+0x2d
04acf268 0065ba8e EventService!TraderTools.STPlatform.EventService.SynchronizedQueue.Dequeue()+0x36
04acf2c0 72d4afeb EventService!TraderTools.STPlatform.EventService.EventThread.ThreadProc()+0x4e
04acf2d0 72cd7fc4 mscorlib_ni!System.Threading.ThreadHelper.ThreadStart_Context(System.Object)+0x63
04acf2ec 72cd7f04
mscorlib_ni!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,
System.Threading.ContextCallback, System.Object, Boolean)+0xb0
04acf30c 72d4af78
(Continue reading)

Ron Grabowski (JIRA | 27 May 2012 22:17
Picon
Favicon

[jira] [Commented] (LOG4NET-339) log4net.Appender.EventLogAppende cause our application to stuck.


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

Ron Grabowski commented on LOG4NET-339:
---------------------------------------

I've never really dug deep into memory dump so that wasn't very helpful to me. If you have a lot of control over
your environment and you know that all the event log busy work stuff has been setup correctly you could just
write your own appender to forward log messages to WriteEntry:

public class ApplicationNameEventLogAppender : AppenderSkeleton
{
    protected override void Append(LoggingEvent loggingEvent)
    {
        EventLog.WriteEntry("ApplicationName", RenderLoggingEvent(loggingEvent), EventLogEntryType.Information);
    }
}

That would eliminate log4net's EventLogAppender as the problem.

> log4net.Appender.EventLogAppende cause our application to stuck. 
> -----------------------------------------------------------------
>
>                 Key: LOG4NET-339
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-339
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
(Continue reading)


Gmane