0

I am getting a CLR20R3 error in a running ASP.NET application. And I know in the end I need to be catching this error - clearly - but that's a maintenance task I'll get to after I get this resolved in PROD. The reason I can't just jump right into the maintenance task is because it will take an excessive amount of work, and time, to get those changes tested and approved in all lower environments and then finally to PROD.

The error states that the P7 value is 4dd, so after getting an IL dump from the offending assembly (which is not my assembly), I found that code. I'm also showing a couple lines after the method token too because I think those are referencing the offending line in the called method:

IL_0040:  callvirt   instance int32 IBM.WMQ.MQTCPConnection/*02000072*/::SendData(uint8[],
                                                                                  int32,
                                                                                  int32) /* 060004DD */
IL_0045:  stloc.0
IL_0046:  leave.s    IL_0055

Now, with that in mind, that's a good segue into the question because I'm trying to map this back to the decompiled code of the offending assembly.

Does the IL_0046: leave.s IL_0055 line refer to the line in the called method that's failing?

Because if so, below is that matched line, along with some of the preceding code that appears to be relevant:

IL_0044:  callvirt   instance int32 [System/*23000002*/]System.Net.Sockets.Socket/*0100000E*/::Send(uint8[],
                                                                                                    int32,
                                                                                                    int32,
                                                                                                    valuetype [System/*23000002*/]System.Net.Sockets.SocketFlags/*01000060*/) /* 0A0000F9 */
IL_0049:  stloc.0
IL_004a:  ldarg.0
IL_004b:  ldc.i4     0x92
IL_0050:  ldstr      "Send returned " /* 700028D5 */
IL_0055:  ldloc.0

but, I'm having a little trouble justifying that's what it refers to because Hans stated in this post that the P8 value is the offset, or offending line, and that wouldn't jive with the exception. The exception says that the P8 value is 7d.

Community
  • 1
  • 1
Mike Perrenoud
  • 66,820
  • 29
  • 157
  • 232

2 Answers2

1

The leave.s IL_0055 has no reference to the called method. The P7 value indicates that the error occurs within IBM.WMQ.MQTCPConnection.SendData, so you need to be looking in there (not in the method that calls it).

Since P8 is 7d, you should be looking at IL_007d within IBM.WMQ.MQTCPConnection.SendData - the same method you took the second snippet from.

Iridium
  • 23,323
  • 6
  • 52
  • 74
1

P7 refers to the method token of the method within which the exception occurred. Thus, the crash is within the IBM.WMQ.MQTCPConnection::SendData, since, apparently, that's the method that corresponds to the 4DD token. What you found is only a call to that method (possibly unrelated to the problem), not the method itself.

To verify this you could open the assembly in ILDASM and click View->MetaInfo->Show! Search for 060004DD and something like Method #123 (060004DD) will come up in the metadata. That method is the first method in this appdomain that saw the exception.

The P8 is the offset within that method to the failing instruction.

Stefan Dragnev
  • 14,143
  • 6
  • 48
  • 52