locked
CLR Profiler for the .NET Framework 2.0 : A bug (with possible fix!) - It throws exception - null object RRS feed

  • Question

  • CLR Profiler for the .NET Framework 2.0

     

    I tied to profile a service on my machine. But when I try to see the heap data (during reading of the log file) it throws exception that the object reference is not set (null object).

     

    I debugged the CLR profiler and found that in class ReadNewLog, there is method "ReadFile"

    internal void ReadFile(long startFileOffset, long endFileOffset, ReadLogResult readLogResult, int requestedIndex)

    ...

        if (matched > 0 && c != -1)
        {
            /* use some other stack trace as a reference */
            int otherStackTraceId = ReadInt();
            otherStackTraceId = stacktraceTable.MapTypeSizeStacktraceId(otherStackTraceId);
            int[] stacktrace = stacktraceTable.IndexToStacktrace(otherStackTraceId);
            if (matched > stacktrace.Length - hadTypeId)
                matched = stacktrace.Length - hadTypeId;
            for(int i = 0; i < matched; i++)
            {
                int funcId = stacktrace[i + hadTypeId];
                Debug.Assert(funcId < funcName.Length);
                if (funcName[funcId] == null)
                    funcName[funcId] = String.Empty;
                intStack[stackPtr++] = funcId;
                if (stackPtr >= intStack.Length)
                {
                    intStack = GrowIntVector(intStack);
                }
            }
        }
    ...

     

    The error comes because the array object "stacktrace" is null. Here,

    int[] stacktrace = stacktraceTable.IndexToStacktrace(otherStackTraceId);

     

    Since its null, the next code which uses "stacktrace" fails.

     

    If developers of CLR Profiler read this info and use it correctly, it might help lot of people.

    Monday, September 13, 2010 11:40 AM

Answers

  • Please direct .NET Framework bug reports to https://connect.microsoft.com/VisualStudio.  It will get looked at there.  Not nearly as likely to get attention if you post it to just this forum alone as this is not the spot for bug reports.

     

     

    • Marked as answer by eryang Wednesday, September 29, 2010 1:31 AM
    Monday, September 13, 2010 11:06 PM
  • You could try under Visual Studio, which covers .NET too, any they should route it to the right place.

    That being said, a quick search did not reveal a CLR Profiler for .NET 4.0.  So perhaps this is moot because the software is no longer maintained.

     

    • Marked as answer by eryang Wednesday, September 29, 2010 1:31 AM
    Monday, September 20, 2010 10:57 PM

All replies

  • Please direct .NET Framework bug reports to https://connect.microsoft.com/VisualStudio.  It will get looked at there.  Not nearly as likely to get attention if you post it to just this forum alone as this is not the spot for bug reports.

     

     

    • Marked as answer by eryang Wednesday, September 29, 2010 1:31 AM
    Monday, September 13, 2010 11:06 PM
  • Hi Nayan,

    After submitted the feedback, could you please also post the link here? So that other community members who encounter similar question can vote/monitor the issue via your link.


    Sincerely,
    Eric
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, September 15, 2010 10:04 AM
  • Hi,

    This is not a .NET framework bug, but bug in a tool by Microsoft. Do you think it should be reported there?

     

    Thanks & regards

    Nayan

    Monday, September 20, 2010 10:25 PM
  • Unfortunately I cannot find any place where I can report bugs of CLR profiler tool. Since its not part of VS or .NET, its neglected.

    Regards

    Nayan

    Monday, September 20, 2010 10:27 PM
  • You could try under Visual Studio, which covers .NET too, any they should route it to the right place.

    That being said, a quick search did not reveal a CLR Profiler for .NET 4.0.  So perhaps this is moot because the software is no longer maintained.

     

    • Marked as answer by eryang Wednesday, September 29, 2010 1:31 AM
    Monday, September 20, 2010 10:57 PM