Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, April 15, 2015 11:07:45 PM(UTC)

dhvik  
dhvik

Groups: Registered
Posts: 9


Hi!
I have a problem when it comes to unit testing the leadtools RasterCodecs methods.
I have a simple test that tries to get information about a file that is not supported by leadtools. This should generate a RasterException with the RasterExceptionCode.FileFormat. This works alright but when I run this test on our build server the nunit process registers the following event in the event log.

Application: nunit-agent.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an internal error in the .NET Runtime at IP 000007FD898236FC (000007FD89820000) with exit code 80131506.

(Stacktrace from testrunner shown below)

It seems that the test works alright but when the program that executes the tests tries to end the error occurs.

It would normally be a nunit issue but when I remove the call to codec.GetInformation or if I supply a file that Leadtools can load, then I don't get this error.

My suspicion is that the error that occurs in the RasterCodec class, don't dispose all resources used and when the process ends, cleanup fails to do its job.

I have tried the RasterCodec.Load method and it behaves the same.

Can you help me with this?

I am using Leadtools 18.0.4.0 (FileVersion 18.0.0.43) for 64 bit


------------------------------------------------------------------------------------------------------
The test itself
------------------------------------------------------------------------------------------------------
[Test]
public void TryToLoadAnXmlFileInLeadtools() {
var path = Path.GetTempFileName();
using (var w = new StreamWriter(File.OpenWrite(path))) {
w.WriteLine("");
}
try {
using (var codec = new RasterCodecs()) {
using (var codecsImageInfo = codec.GetInformation(path, true)) {
if (codecsImageInfo != null) throw new ApplicationException("This should only happen on supported files");
}
}
} catch (RasterException ex) {
if (ex.Code == RasterExceptionCode.FileFormat) {
//we should end up here.
return;
}
throw;
} finally {
File.Delete(path);
}
}
------------------------------------------------------------------------------------------------------
The stacktrace from nunit shows
------------------------------------------------------------------------------------------------------
Starting: "f:\Program files\NUnit-2.6.4\bin\nunit-console.exe" MyTest.dll /framework=net-4.5 /nodots /nologo
in directory: F:\TeamCity\buildAgent\work\4dfb625a271e7acf\Core\MyTest\bin\Debug
ProcessModel: Default DomainUsage: Single
Execution Runtime: net-4.5

Tests run: 1, Errors: 0, Failures: 0, Inconclusive: 0, Time: 2,35907887734335 seconds
Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0

Unhandled Exception:
System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

Server stack trace:
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Runtime.Remoting.Channels.SocketStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Runtime.Remoting.Channels.SocketHandler.ReadFromSocket(Byte[] buffer, Int32 offset, Int32 count)
at System.Runtime.Remoting.Channels.SocketHandler.BufferMoreData()
at System.Runtime.Remoting.Channels.SocketHandler.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.Runtime.Remoting.Channels.SocketHandler.ReadAndMatchFourBytes(Byte[] buffer)
at System.Runtime.Remoting.Channels.Tcp.TcpSocketHandler.ReadAndMatchPreamble()
at System.Runtime.Remoting.Channels.Tcp.TcpSocketHandler.ReadVersionAndOperation(UInt16& operation)
at System.Runtime.Remoting.Channels.Tcp.TcpClientSocketHandler.ReadHeaders()
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.IDisposable.Dispose()
at NUnit.Core.ProxyTestRunner.Dispose()
at NUnit.Util.ProcessRunner.Dispose()
at NUnit.ConsoleRunner.ConsoleUi.Execute(ConsoleOptions options)
at NUnit.ConsoleRunner.Runner.Main(String[] args)
Process exited with code -100
Step Nunit ImageVault.Core.Conversion.Test cmdline (1) (1) (Command Line) failed
------------------------------------------------------------------------------------------------------

Regards
/Dan
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, April 16, 2015 7:13:04 AM(UTC)

NathanM  
Guest

Groups: Guests
Posts: 3,040

Was thanked: 1 time(s) in 1 post(s)

This problem would require more testing on our end to determine if it is a bug in the source or if perhaps something that is happening on your end. Would it be possible for you to provide a small sample project that duplicates this issue for us to test here? We do not need your whole solution just a simple one button forum that easily illustrates the problem, and any sample files that are required to duplicate the issue. Do not forget to clean the solution as we do not need any dlls.

You can send the sample project to support@leadtools.com with steps to duplicate the issue.

Thank you.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2019, Yet Another Forum.NET
This page was generated in 0.143 seconds.