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

Remko Popma commented on LOG4J2-2816:
-------------------------------------

[~orloden] Can you give more detail on what version (and vendor) of Java you 
are using? Also, just to confirm, you are using Log4j 2.13.0, correct?

All:

Some notes that may help with investigation:

Looking at the source for {{RingBufferLogEvent}} [line 
161|http://logging.apache.org/log4j/log4j-2.12.1/log4j-core/xref/org/apache/logging/log4j/core/async/RingBufferLogEvent.html#L161],
 this NPE implies that the {{asyncLogger}} field is {{null}}.

This field is set by the {{RingBufferLogEvent::setValues}} method, and nulled 
out after each event in the {{RingBufferLogEvent::clear}} method. Looking at 
the call chain for {{setValues}} I cannot see a chance for a {{null}} value 
being passed in. However, the {{clear}} method is called after the work is 
done, which would imply there is a race condition and this 
{{RingBufferLogEvent}} is claimed and used by multiple threads simultaneously, 
which should never happen by design of the Disruptor... [~ckozak], do you have 
any ideas?



> NullPointerException from AsyncLogger
> -------------------------------------
>
>                 Key: LOG4J2-2816
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2816
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.13.0
>            Reporter: Denis
>            Priority: Minor
>
> We've got several times following NullPointerException (example from our 
> stdout.log):
>   
> {code:java}
> 84449.232: [purging class loader data graph, 0.0000003 secs]
> AsyncLogger error handling event seq=1037012, 
> value='org.apache.logging.log4j.core.async.RingBufferLogEvent@2a7b2d78': 
> java.lang.NullPointerException: null
> java.lang.NullPointerException
>  at 
> org.apache.logging.log4j.core.async.RingBufferLogEvent.execute(RingBufferLogEvent.java:161)
>  at 
> org.apache.logging.log4j.core.async.RingBufferLogEventHandler.onEvent(RingBufferLogEventHandler.java:46)
>  at 
> org.apache.logging.log4j.core.async.RingBufferLogEventHandler.onEvent(RingBufferLogEventHandler.java:29)
>  at 
> com.lmax.disruptor.BatchEventProcessor.processEvents(BatchEventProcessor.java:168)
>  at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:125)
>  at java.lang.Thread.run(Thread.java:748)
> AsyncLogger error handling event seq=1037022, 
> value='org.apache.logging.log4j.core.async.RingBufferLogEvent@d5d330f': 
> java.lang.NullPointerException: null
> java.lang.NullPointerException
>  at 
> org.apache.logging.log4j.core.async.RingBufferLogEvent.execute(RingBufferLogEvent.java:161)
>  at 
> org.apache.logging.log4j.core.async.RingBufferLogEventHandler.onEvent(RingBufferLogEventHandler.java:46)
>  at 
> org.apache.logging.log4j.core.async.RingBufferLogEventHandler.onEvent(RingBufferLogEventHandler.java:29)
>  at 
> com.lmax.disruptor.BatchEventProcessor.processEvents(BatchEventProcessor.java:168)
>  at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:125)
>  at java.lang.Thread.run(Thread.java:748)
> 84450.232: [deflating idle monitors, 0.0000624 secs]
> {code}
>  
> What is interesting this NPEs always preceeded by
> {code}
> 84449.232: [purging class loader data graph, 0.0000003 secs] vm message
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to