https://issues.apache.org/bugzilla/show_bug.cgi?id=45825

           Summary: lack of synchronization in ThrowableInformation
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: Other
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Log4j version 1.2.15.
Method getThrowableStrRep in org.apache.log4j.spi.ThrowableInformation should
be synchronized in some way. The variable rep can be read by one thread (for
example AsynsAppender) in line 72, while another is in line 91
(lines.toArray(rep)). This may cause rep to contain some nulls. It leads to
NullPointerException at java.io.Writer.write(Writer.java:140). Stacktrace:

java.lang.NullPointerException   
 at java.io.Writer.write(Writer.java:140)   
 at org.apache.log4j.helpers.QuietWriter.write(QuietWriter.java:48)   
 at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:309)   
 at org.apache.log4j.WriterAppender.append(WriterAppender.java:160)   
 at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)   
 at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
 
 at org.apache.log4j.Category.callAppenders(Category.java:206)   
 at org.apache.log4j.Category.forcedLog(Category.java:391)   
 at org.apache.log4j.Category.info(Category.java:683)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to