Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5EB4D200B6F for ; Wed, 24 Aug 2016 19:09:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5D435160AC2; Wed, 24 Aug 2016 17:09:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id ABA35160A91 for ; Wed, 24 Aug 2016 19:09:21 +0200 (CEST) Received: (qmail 55753 invoked by uid 500); 24 Aug 2016 17:09:20 -0000 Mailing-List: contact log4net-dev-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET Dev" List-Id: Delivered-To: mailing list log4net-dev@logging.apache.org Received: (qmail 55718 invoked by uid 99); 24 Aug 2016 17:09:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Aug 2016 17:09:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 9B2C92C015F for ; Wed, 24 Aug 2016 17:09:20 +0000 (UTC) Date: Wed, 24 Aug 2016 17:09:20 +0000 (UTC) From: "Dominik Psenner (JIRA)" To: log4net-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LOG4NET-524) OnlyOnceErrorHandler might cause StackOverflowError MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 24 Aug 2016 17:09:22 -0000 [ https://issues.apache.org/jira/browse/LOG4NET-524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15435303#comment-15435303 ] Dominik Psenner commented on LOG4NET-524: ----------------------------------------- Please subscribe to the log4j mailing list to track notifications and get involved. I do not actively hack on log4j and will most likely loose track of this. > OnlyOnceErrorHandler might cause StackOverflowError > --------------------------------------------------- > > Key: LOG4NET-524 > URL: https://issues.apache.org/jira/browse/LOG4NET-524 > Project: Log4net > Issue Type: Bug > Components: Core > Affects Versions: 1.2.15 > Reporter: Marc Theisen > Assignee: Dominik Psenner > > 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 > {code} > 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 > } > {code} > to > {code} > 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); > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)