471,081 Members | 984 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,081 software developers and data experts.

time.mktime memory access violation bug

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
2 2376
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
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.

Similar topics

2 posts views Thread by Marcus | last post: by
1 post views Thread by Benoit BESSE | last post: by
5 posts views Thread by Hank | last post: by
5 posts views Thread by David Stockwell | last post: by
3 posts views Thread by Kyle Teague | last post: by
14 posts views Thread by George | last post: by
2 posts views Thread by Joshua J. Kugler | last post: by
5 posts views Thread by alcool | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.