Stacktrace shows funcion call that is not directly present in failing method

I have a website used by several person and only one person experiences a bug with a strange stacktrace :

System.FormatException: String was not recognized as a valid datetime. at System.DateTime.Parse(String s, IFormatProvider provider) at EditMandate.getFormData()`.

The strange thing is that there is no parse in the function getFormData. This function uses functions which uses DateTime.Parse but it doesn't use it directly.

Why stack trace shows function that is not directly called by my method?

Also, there is nothing strange in the string being parse as it worked several times and randomly crashed !

Jon Skeet
people
quotationmark

I suspect that:

  • The reason for the problem is due to some broken culture-specific settings on the one person's machine, e.g. a culture which uses an invalid DateTimeFormatInfo.ShortDatePattern
  • The reason the direct stack frame isn't showing is that the JIT is inlining the method which calls DateTime.Parse

Try to find anything which modifies cultures, or anything "different" about this person's machine.

people

See more on this question at Stackoverflow