TextAnalysisTool / Releases

Repository for storing release artifacts (ex: binaries).
94 stars 26 forks source link

Error opening Log4Net file #14

Closed ax4413 closed 9 years ago

ax4413 commented 9 years ago

Hi just tried to open a file generated by log4net and received the following exception. I cant include the log as its full of confidential data. Hope the stack trace helps a bit. Just a side note. The tool successfully opened all of the other log4net files just not this one.


TextAnalysisTool.NET

Sorry, an unhandled exception has occurred and the application is about to terminate!

Please report this problem and include the following details:

TextAnalysisTool.NET, Version=1.0.5485.18509, Culture=neutral, PublicKeyToken=d0f1991e18299f1d - 2015-01-07 System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.

at System.Drawing.Graphics.CheckErrorStatus(Int32 status)

at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)

at TextAnalysisTool.NET.LineCollectionDisplay.OnDrawItem(DrawItemEventArgs e)

at System.Windows.Forms.ListBox.WmReflectDrawItem(Message& m)

at System.Windows.Forms.ListBox.WndProc(Message& m)

at TextAnalysisTool.NET.LineCollectionDisplay.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

DavidAnson commented 9 years ago

Unfortunately, the crash above is due to a bug in the .NET Framework component GDI+ that TextAnalysisTool.NET uses for rendering. Enough people have hit it that it's discussed briefly in the ReadMe:

* GDI+ occasionally throws a System.Runtime.InteropServices.ExternalException
  with the message "A generic error occurred in GDI+.". This exceptional
  condition causes TextAnalysisTool.NET to exit after notifying the user.

I've tried to work around this on multiple occasions, but not been successful so far. What seems to make the crash more likely to occur are very long lines and unusual (i.e., non-letter/number) characters. I'm guessing that's what makes it happen with the problematic file in your case.

The only work around I know of is to filter problematic files before loading them into TextAnalysisTool.NET. This can be done by a separate utility or possibly by a plugin within the app. If you'd like to explore the latter, please refer to http://dlaa.me/blog/post/tatplugins.

Sorry for the trouble - I hope this helps!

ax4413 commented 9 years ago

Thanks for the quick response. That will teach me to RTFM. I'm going to spend some time and look through at the posibility of using a custom filter plugin.

DavidAnson commented 9 years ago

No need to apologize! This one issue accounts for 99% of the crashes. :(