I've been trying hard to track down a problem in the VC++ runtime mktime() function.

I have an application that, given min date: 1 Jan 1970 and max date: Jan 19 2038, doesn't AV on my machine.

On another machine, it AVs. Using the Delphi 2005 Win32 debugger's Attach to Process functionality, I've managed to isolate the fault to a call to the MSVCRT.dll's mktime() function from within the application.

My machine: XP SP2. The AV machine: XP SP2. Another machine which AVs: XP SP1.

My first impression was: XP's Data Execution Protection, but no go. Our machines are configured similarly for DEP.

I've checked for regional settings, locale, but I've not come up with anything. mktime() looks like its C++'s equivalent of Delphi's EncodeDate / EncodeDateTime.

Does anyone know under what circumstances mktime() would AV?