By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,695 Members | 1,473 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,695 IT Pros & Developers. It's quick & easy.

time.mktime memory access violation bug

P: n/a
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
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Bengt Richter wrote:
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]


Curious. I get (windows XP):

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)) Traceback (most recent call last):
File "<stdin>", line 1, in ?
OverflowError: mktime argument out of range time.mktime((1969, 12, 31, 17, 0, 0, 0, 0, 1)) Traceback (most recent call last):
File "<stdin>", line 1, in ?
OverflowError: mktime argument out of range time.mktime((1969, 12, 31, 16, 0, 0, 0, 0, 1)) Traceback (most recent call last):
File "<stdin>", line 1, in ?
OverflowError: mktime argument out of range


On Linux I get the same results. Something fishy is going
on with your Python...

--Irmen de Jong

Jul 18 '05 #2

P: n/a
On Wed, 19 Nov 2003 02:10:36 +0100, Irmen de Jong <irmen@-NOSPAM-REMOVETHIS-xs4all.nl> wrote:
Bengt Richter wrote:
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]


Curious. I get (windows XP):

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))Traceback (most recent call last):
File "<stdin>", line 1, in ?
OverflowError: mktime argument out of range time.mktime((1969, 12, 31, 17, 0, 0, 0, 0, 1))Traceback (most recent call last):
File "<stdin>", line 1, in ?
OverflowError: mktime argument out of range time.mktime((1969, 12, 31, 16, 0, 0, 0, 0, 1))Traceback (most recent call last):
File "<stdin>", line 1, in ?
OverflowError: mktime argument out of range


On Linux I get the same results. Something fishy is going
on with your Python...

Well, you're in a different time zone. I think you have to compensate for
that in setting up the equivalent of zero time epoch. Then hit that with dst=1.
Or there could be something fishy ;-)

Regards,
Bengt Richter
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.