[WinDbg Script] Displaying Parameters for Microsoft.ReportingServices.ReportProcessing

Here is a new script from a PFE from Portugal, Marcio Parente.

Marcio kindly shared his source code in this blog post, so here is the story behind the script followed by its source code.

One report on a Reporting Server started to give this error:

String: Syntax error converting the varchar value 'AA' to a column of data type int.

Exploring the situation Marcio had the need to find out what was the value of one parameter, and because there were 14380 parameters an script was needed.

0x1f014e88 0x09ae5e84 28 -1 Microsoft.ReportingServices.ReportProcessing.ParameterValue

Statistics:

        MT Count TotalSize Class Name

0x09ae5e84 14,380 402,640 Microsoft.ReportingServices.ReportProcessing.ParameterValue

Total 14,380 objects, Total size: 402,640

What Marcio needs is the name and value.

0:000> !dumpobj 0x10546834

Name: Microsoft.ReportingServices.ReportProcessing.ParameterValue

MethodTable 0x09ae5e84

EEClass 0x09b009cc

Size 28(0x1c) bytes

GC Generation: 2

mdToken: 0x020000e6 (c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\reportserver\94eb9a55\49df36c9\assembly\dl2\02d1b52f\00398a5b_d238c501\microsoft.reportingservices.processing.dll)

FieldDesc*: 0x09ae5d48

        MT Field Offset Type Attr Value Name

0x09ae5e84 0x40003dc 0x4 CLASS instance 0x10546850 m_name

0x09ae5e84 0x40003dd 0x8 CLASS instance 0x1054688c m_value

0x09ae5e84 0x40003de 0xc CLASS instance 0x00000000 m_omit

0x09ae5e84 0x40003df 0x14 System.Int32 instance 1 m_exprHostID

0x09ae5e84 0x40003e0 0x10 CLASS instance 0x1c53f980 a

Content:

0:000> !do 0x10546850

String: @chrCultureCode

0:000> !do 0x1054688c

Name: Microsoft.ReportingServices.ReportProcessing.ExpressionInfo

MethodTable 0x09ae4860

EEClass 0x09b004d4

Size 60(0x3c) bytes

GC Generation: 2

mdToken: 0x02000127 (c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\reportserver\94eb9a55\49df36c9\assembly\dl2\02d1b52f\00398a5b_d238c501\microsoft.reportingservices.processing.dll)

FieldDesc*: 0x09ae4490

        MT Field Offset Type Attr Value Name

0x09ae4860 0x40005d7 0x24 System.Int32 instance 0 m_type

0x09ae4860 0x40005d8 0x4 CLASS instance 0x00000000 m_stringValue

0x09ae4860 0x40005d9 0x34 System.Boolean instance 0 m_boolValue

0x09ae4860 0x40005da 0x28 System.Int32 instance 0 m_intValue

0x09ae4860 0x40005db 0x2c System.Int32 instance -1 m_exprHostID

0x09ae4860 0x40005dc 0x8 CLASS instance 0x00000000 a

0x09ae4860 0x40005dd 0xc CLASS instance 0x00000000 b

0x09ae4860 0x40005de 0x10 CLASS instance 0x00000000 c

0x09ae4860 0x40005df 0x14 CLASS instance 0x00000000 d

0x09ae4860 0x40005e0 0x18 CLASS instance 0x00000000 e

0x09ae4860 0x40005e1 0x1c CLASS instance 0x00000000 f

0x09ae4860 0x40005e2 0x20 CLASS instance 0x00000000 g

0x09ae4860 0x40005e3 0x30 System.Int32 instance -1 h

So Marcio decided to create the script below to get the content of the correspondent parameter.

This is the output from the script below:

Scanning all Microsoft.ReportingServices.ReportProcessing.ParameterValue ...

*****

String: @chrCultureCode

String: pt

*****

*****

String: @chrCultureCode

String: pt

*****

*****

String: @chrCultureCode

String: pt

*****

*****

String: @chrCultureCode

String: pt

*****

*****

String: @chrCultureCode

String: pt

*****

*****

String: @chrCultureCode

String: pt

*****

*****

String: @chrCultureCode

*****

*****

String: @chrCultureCode

String: pt

*****

Stop scanning all Microsoft.ReportingServices.ReportProcessing.ParameterValue ...

Source code of REPORTING_SERVICES_PARAMETER.TXT:

$$

$$ =========================================================

$$ REPORTING_SERVICES_PARAMETER.TXT

$$

$$ Displays the values of Microsoft.ReportingServices.ReportProcessing.ParameterValue.

$$

$$ Compatibility: Win32 (not tested on x64).

$$

$$ Example: $$><myscripts\REPORTING_SERVICES_PARAMETER.TXT

$$

$$ Marcio Parente

$$

$$ All my scripts are provided "AS IS" with no warranties, and confer no rights.

$$

$$ =========================================================

$$

$$

.printf /D "<b>Scanning all Microsoft.ReportingServices.ReportProcessing.ParameterValue ...</b>\n\n"

.foreach (runtime {!dumpheap -type Microsoft.ReportingServices.ReportProcessing.ParameterValue -short})

                {

                               .foreach(obj {!dumpobj poi(${runtime}+0x4)})

                               {

                                               .if(0 == $sicmp("${obj}", "@chrCultureCode"))

                                               {

                                                               .echo *****

                                                               !dumpobj poi(${runtime}+0x4)

                                                               !dumpobj poi(poi(${runtime}+0x8)+0x4)

                                                               .echo *****

                                               }

                               }

                }

.printf /D "<b>Stop scanning all Microsoft.ReportingServices.ReportProcessing.ParameterValue ...</b>"

Comments

  • Anonymous
    August 29, 2010
    Since the inclusion of !DumpField in psscor2, I've been doing something similar.  I like Marcio's method using offsets because it gives you more flexibility when not faced with string types for the value of a parameter.  Here's my method (which I either type in or copy from OneNote since I haven't bothered to put it in a script yet):   .foreach (var {!dumpheap -type System.Data.SqlClient.SqlParameter -short}) {.echo *****;.echo var;!DumpField -field _parameterName -string var;!DumpField -field _value -string var}

  • Anonymous
    September 03, 2010
    Cool! Thanks for sharing. :)