Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-524

OnlyOnceErrorHandler might cause StackOverflowError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 1.2.15
    • None
    • Core
    • None

    Description

      I am referring to the solution in https://bz.apache.org/bugzilla/show_bug.cgi?id=42151.

      I am suggesting another approach instead of placing a bad hack into com.csfb.fao.carat.util.file.LoggingOutputStream.

      Why not change the error method of class OnlyOnceErrorHandler from

      public void error(String message, Exception e, int errorCode, LoggingEvent event)
      {
        if (e instanceof InterruptedIOException || e instanceof InterruptedException)
        {
          Thread.currentThread().interrupt();
        }
        if(firstTime)
        {
          LogLog.error(message, e);
          firstTime = false;           // yikes, too late if stdout/stderr has been
        }                              // redirected
      }
      

      to

      public void error(String message, Exception e, int errorCode, LoggingEvent event)
      {
        if (e instanceof InterruptedIOException || e instanceof InterruptedException)
        {
          Thread.currentThread().interrupt();
        }
        if(firstTime)
        {
          firstTime = false;
          LogLog.error(message, e);
        }
      }
      

      Attachments

        Activity

          People

            nachbarslumpi Dominik Psenner
            marcimarc Marc Theisen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: