[
https://issues.apache.org/jira/browse/LOG4NET-582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16286262#comment-16286262
]
Stefan Bodewig commented on LOG4NET-582:
----------------------------------------
Sorry for the delay.
I'd expect your stack trace to contain {{InternalConfigure}} if this was the
case, that's why I said I cannot match the stack trace with the 1.2.15 code
base (while it matches 1.2.9 well). I'm still not convinced the CMS is not
using 1.2.9 via the GAC or a similar way.
Personally I don't run any system that would even remotely match yours and
haven't been able - and won't be able - to reproduce the issue.
> IndexOutOfRangeException | I/O race condition issue still occurred with
> Log4net v.1.2.15
> ----------------------------------------------------------------------------------------
>
> Key: LOG4NET-582
> URL: https://issues.apache.org/jira/browse/LOG4NET-582
> Project: Log4net
> Issue Type: Bug
> Affects Versions: 1.2.15
> Environment: Production
> Reporter: Durgesh Khandal
> Priority: Blocker
>
> Hi, we got an incident in our Production CMS server (web application) related
> to log4net due to which it went down and we had to recycle the app-pool to
> fix it. Please find below exception details:
> 6524 03:18:42 ERROR Application error.
> Exception: System.IndexOutOfRangeException
> Message: Probable I/O race condition detected while copying memory. The I/O
> package is not thread safe by default. In multithreaded applications, a
> stream must be accessed in a thread-safe way, such as a thread-safe wrapper
> returned by TextReader's or TextWriter's Synchronized methods. This also
> applies to classes like StreamWriter and StreamReader.
> Source: mscorlib
> at System.Buffer.InternalBlockCopy(Array src, Int32 srcOffsetBytes, Array
> dst, Int32 dstOffsetBytes, Int32 byteCount)
> at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
> at System.IO.TextWriter.SyncTextWriter.WriteLine(String value)
> at log4net.helpers.LogLog.EmitErrorLine(String msg)
> at log4net.helpers.LogLog.Error(String msg)
> at log4net.Config.XmlConfigurator.Configure(ILoggerRepository repository)
> at Web.Infrastructure.Logger.Log4NetLogger..ctor(String loggerName)
> at Web.Extensions.Helpers.GenericHelper.SetCampaignCookie()
> at Web.MvcApplication.Application_BeginRequest(Object sender, EventArgs e)
> at
> System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
> at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously)
> This is the first time we met with this error. I tried to look into this and
> found below resources which says this issue was fixed in v.1.2.10.
> http://apache-logging.6191.n7.nabble.com/Uncaught-IndexOutOfRangeException-in-log4net-1-2-9-Beta-td20624.html
> But we are using the latest version 1.2.15 with the below configuration.
> <log4net>
> <logger name="CustomLogger">
> <level value="ALL"/>
> <appender-ref ref="CustomLogger" />
> </logger>
> <appender name="CustomLogger"
> type="log4net.Appender.RollingFileAppender, Sitecore.Logging">
> <!--Do not change the file name format [{date}]-->
> <file value="$(logFolderPath)/logs/CustomLogger.log"/>
> <rollingStyle value="Composite" />
> <datePattern value=".yyyyMMdd.HHmmss.'txt'" />
> <appendToFile value="true"/>
> <preserveLogFileNameExtension value="true" />
> <staticLogFileName value="false" />
> <maxSizeRollBackups value="60" />
> <maximumFileSize value="10MB" />
> <lockingModel type="log4net.Appender.FileAppender+MinimalLock"
> />
> <dateTimeStrategy
> type="log4net.Appender.RollingFileAppender+UniversalDateTime" />
> <layout type="log4net.Layout.PatternLayout">
> <conversionPattern value="%4t %d{ABSOLUTE} %-5p %m%n"/>
> </layout>
> <encoding value="utf-8"/>
> </appender>
> </log4net>
> In our IIS application app-pool, maximum worker process is also set to 1.
> Can you please help and suggest a fix/prevention tips to avoid this error
> again in future? Please let me know if you need more details.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)