time.mktime memory access violation bug

Bengt Richter bokr at oz.net
Tue Nov 18 18:44:03 EST 2003


 Python 2.3.2 (#49, Oct  2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on win32
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import time
 >>> time.mktime((1969, 12, 31, 17, 0, 0, 0, 0, 0))
 3600.0
 >>> time.mktime((1969, 12, 31, 17, 0, 0, 0, 0, 1))
 0.0
 >>> time.mktime((1969, 12, 31, 16, 0, 0, 0, 0, 1))
 [crash with popup]


I got:

   The instruction at "0x7802a7ff" referenced memory at "0x00000000". The memory
   could not be "read".

I would have hoped for an informative ValueError exception.

This is on NT4. My local time zone is PST.

If I let the MSVC++6 debugger try to chase it, it says
    Unhandled exception in python.exe (MSVCRT.DLL): 0xC0000005: Access Violation

and fwiw without source it's pointing to the rep movs in this context:

7802A7F1   call        7802A4BF
7802A7F6   pop         ecx
7802A7F7   push        9
7802A7F9   mov         esi,eax
7802A7FB   mov         eax,dword ptr [ebp+8]
7802A7FE   pop         ecx
7802A7FF   rep movs    dword ptr [edi],dword ptr [esi]
7802A801   pop         edi
7802A802   pop         esi
7802A803   pop         ebp
7802A804   ret
7802A805   test        ecx,ecx


and esi is zero, so I guess that did it.

Someone have a debug version to check this out?

Regards,
Bengt Richter




More information about the Python-list mailing list