Reputation: 11
I'm investigating the cause of the huge amount of ArgumentException
in an application (and I'm suspecting that its main reason for memory fragmentation/out of memory exception).
The problem is that I can't find where this exception is coming from.
I have memory dump of the problematic service but all I can see is that it happened on one of the threads and that it is related to reflection stuff, other than that it seems that I can't find the cause of the exception.
ArgumentException details:
Exception type: System.ArgumentException
Message: Missing parameter does not have a default value.
InnerException: <none>
StackTrace (generated):
SP IP Function
0347D2F0 72B006F2 mscorlib_ni!System.Reflection.MethodBase.CheckArguments(System.Object[], System.Reflection.Binder, System.Reflection.BindingFlags, System.Globalization.CultureInfo, System.Signature)+0xc27c02
0347D328 71EC0EDB mscorlib_ni!System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)+0x9b
0347D35C 71EC0DD7 mscorlib_ni!System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)+0x37
0347D390 71EC0D8E mscorlib_ni!System.Reflection.RuntimePropertyInfo.GetValue(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)+0x3e
StackTraceString: <none>
HResult: 80070057
Output of ~#s; !clrstack
:
OS Thread Id: 0x524 (1)
Child SP IP Call Site
033fcf00 7726a8fc [HelperMethodFrame: 033fcf00]
033fcfb0 72b006f2 System.Reflection.MethodBase.CheckArguments(System.Object[], System.Reflection.Binder, System.Reflection.BindingFlags, System.Globalization.CultureInfo, System.Signature)
033fcfe8 71ec0edb System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
033fd01c 71ec0dd7 System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
033fd050 71ec0d8e System.Reflection.RuntimePropertyInfo.GetValue(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
033fda64 730eebe6 [DebuggerU2MCatchHandlerFrame: 033fda64]
033fda34 730eebe6 [GCFrame: 033fda34]
033fda18 730eebe6 [GCFrame: 033fda18]
How to find out where this exception came from? It looks like its missing part of the stack trace.
Upvotes: 0
Views: 255
Reputation: 101
According to the Microsoft documentation, The PropertyInfo.GetValue()
method throws an ArgumentException
when either of the following is true:
"The index array does not contain the type of arguments needed.
-or-
The property's get accessor is not found."
I would look for any calls in the source code that are calling GetValue()
and inspect the arguments being passed into them. One of the two scenarios outlined above is likely the culprit.
Upvotes: 3