Page 1 of 1

Error when loading heap snapshot for .NET 1.1 application

Posted: Fri Aug 24, 2007 4:23 pm
by aaronlerch
On multiple machines, spanning Windows Vista and Server 2003, every time I attempt to collect a memory snapshot of our .NET 1.1 application, the profiler tool encounters an error and cannot continue. This does not happen with the version of our app that runs under .NET 2.0.

Here is the error dialog I get:
---------------------------
Setup Error
---------------------------
Failed to load resources from resource file
Please check your Setup
---------------------------
OK
---------------------------

I turned on logging, and here is some relevant-looking output. I can reproduce this every time so if there's more info needed, let me know.

2007-08-24 12:12:37.7347|3|INFO|SciTech.NetMemProfiler.ProfilerClient|Memory tracked
2007-08-24 12:12:37.7347|3|INFO|SciTech.NetMemProfiler.ProfilerClient|Pulse snapshot resume
2007-08-24 12:12:37.7347|4|INFO|SciTech.NetMemProfiler.ProfilerClient|Resume event pulsed.
2007-08-24 12:14:01.1889|5|INFO|SciTech.NetMemProfiler.ProfilerClient|ProfilerClient.RequestStop entered, reason=ApplicationTerminated, error=
2007-08-24 12:14:01.3452|4|ERROR|SciTech.NetMemProfiler.ProfilerClient|Exception caught in ReportListener:
System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.__Error.EndOfFile()
at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
at System.IO.BinaryReader.ReadInt16()
at SciTech.NetMemProfiler.dd.c()
2007-08-24 12:14:01.3452|3|INFO|SciTech.NetMemProfiler.dl|ReleaseHeap begin, releaseMemory=False
2007-08-24 12:14:01.3608|5|INFO|SciTech.NetMemProfiler.ProfilerClient|Setting event for wake-up in RequestStop
2007-08-24 12:14:01.7202|5|INFO|SciTech.NetMemProfiler.ProfilerClient|Wake-up event set in RequestStop
2007-08-24 12:14:01.7827|3|INFO|SciTech.NetMemProfiler.dl|ReleaseHeap end
2007-08-24 12:14:01.7827|3|INFO|SciTech.NetMemProfiler.ResourceTracker.e|ReleaseHeap begin, releaseMemory=False
2007-08-24 12:14:01.7827|3|INFO|SciTech.NetMemProfiler.ResourceTracker.e|ReleaseHeap end
2007-08-24 12:14:01.7983|3|INFO|SciTech.NetMemProfiler.ProfilerComparison|RetrieveSnapshotData enter
2007-08-24 12:14:01.7983|3|INFO|SciTech.NetMemProfiler.ProfilerComparison|RetrieveSnapshotData leave - SnapshotData already updated
2007-08-24 12:14:01.8764|1|WARN|SciTech.NetMemProfiler.ProfilerAsyncWorker|Async operation failed
System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.__Error.EndOfFile()
at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
at System.IO.BinaryReader.ReadInt64()
at SciTech.NetMemProfiler.dd.a(r A_0, ar A_1, Boolean A_2)
at SciTech.NetMemProfiler.ActiveSession.b(Object A_0, String A_1, Boolean A_2)
at SciTech.NetMemProfiler.ActiveSession.a(Object A_0, String A_1, Boolean A_2)
2007-08-24 12:14:02.2202|4|INFO|SciTech.NetMemProfiler.ProfilerClient|ProfilerClient.RequestStop entered, reason=ConnectionLost, error=Unable to read beyond the end of the stream.
2007-08-24 12:14:03.5171|5|INFO|SciTech.NetMemProfiler.ActiveSession|Stopping profiled process.
2007-08-24 12:14:03.5483|5|INFO|SciTech.NetMemProfiler.ProfilerClient|ProfilerClient.Stop entered, reason=ApplicationTerminated, error=
2007-08-24 12:14:03.5483|5|INFO|SciTech.NetMemProfiler.ProfilerClient|Setting event for wake-up in Stop
2007-08-24 12:14:03.5483|5|INFO|SciTech.NetMemProfiler.ProfilerClient|Wake-up events set in Stop
2007-08-24 12:14:03.5483|5|INFO|SciTech.NetMemProfiler.ProfilerClient|Trying to end session
2007-08-24 12:14:03.6265|5|INFO|SciTech.NetMemProfiler.ProfilerClient|EndSession returned, set state to Stopped

Posted: Mon Aug 27, 2007 12:33 pm
by Andreas Suurkuusk
What kind of application are you profiling? There is a known problem with root referee identification in some applications that are started as unmanaged and later loads the .NET Runtime. This problem does not exist in .NET Framework 2.0. Are you seeing the same problem if you disable root referee identification (under the "General" page in the "Tools->Settings" dialog)?

The log-file contents you sent are from the ProfilerClientLog.txt file, and are unfortunately not detailed enough. If you provided the "/log" switch to the profiler executable you should also be able to find a file named ProfilerLog.txt. If you send this file (preferably zipped) to support@scitech.se, we will get better information about your problem.

Posted: Mon Aug 27, 2007 2:50 pm
by aaronlerch
Logs sent, thanks.

Also, for everybody's benefit, yes, my application is started as an unmanaged application that loads the runtime dynamically. Turning off root referee identification worked, and allowed me to continue.

Thanks!

Posted: Wed Aug 29, 2007 8:51 pm
by Andreas Suurkuusk
Thanks for the log-file. We have taken a quick look at it, but unfortunately it didn't provide much useful information about your problem.

We will investigate this issue a bit further, and hopefully we will be able to come up with a solution. However, since this problem only occurs under special cases when root referee identification is enabled and only when running under .NET Framework 1.x, I must admit that it's currently not a high priority issue.

EndOfStreamException

Posted: Mon Dec 17, 2007 6:54 pm
by markjhvt
I'm seeing the EndOfStreamException when working w/ ASP.Net applications, even when they're (supposedly) running under .Net 2.0:

2007-12-17 13:40:56.3372|12|INFO|SciTech.NetMemProfiler.ProfilerComparison|RetrieveSnapshotData enter
2007-12-17 13:40:56.3372|12|INFO|SciTech.NetMemProfiler.ProfilerComparison|RetrieveSnapshotData leave - SnapshotData already updated
2007-12-17 13:40:56.3812|1|WARN|SciTech.NetMemProfiler.ProfilerAsyncWorker|Async operation failed
System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.__Error.EndOfFile()
at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
at System.IO.BinaryReader.ReadInt64()
at SciTech.NetMemProfiler.cp.a(s A_0, as A_1, Boolean A_2)
at SciTech.NetMemProfiler.ActiveSession.b(Object A_0, String A_1, Boolean A_2)
at SciTech.NetMemProfiler.ActiveSession.a(Object A_0, String A_1, Boolean A_2)
2007-12-17 13:40:56.3812|15|ERROR|SciTech.NetMemProfiler.ProfilerClient|Exception caught in ReportListener:
System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.__Error.EndOfFile()
at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
at System.IO.BinaryReader.ReadUInt32()
at SciTech.NetMemProfiler.cp.c()


Technically the application is a WCF app hosted under IIS - if that makes any difference...

-Mark-

Posted: Tue Dec 18, 2007 10:19 pm
by Andreas Suurkuusk
An EndOfStreamException in the log-file normally indicates that the profiled process has terminated. Is .NET Framework 3.5 installed on the computer you use? If it is, I recommend that you download the latest release of .NET Memory Profiler 3.0 (or that you try the beta of .NET Memory Profiler 3.1). You can download the latest release from http://memprofiler.com/download.aspx. This release fixes some problems that only occur when running under .NET Framework 3.5. Under certain circumstances, they could cause the profiled process to terminate unexpectedly.