[Python-bugs-list] [ python-Bugs-487743 ] test_builtin fails on 64 bit platform

noreply@sourceforge.net noreply@sourceforge.net
Sat, 01 Dec 2001 02:29:28 -0800


Bugs item #487743, was opened at 2001-11-30 18:07
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=487743&group_id=5470

Category: Python Interpreter Core
Group: Python 2.2
Status: Open
Resolution: None
Priority: 8
Submitted By: Mark Favas (mfavas)
Assigned to: Tim Peters (tim_one)
Summary: test_builtin fails on 64 bit platform

Initial Comment:
test_builtin fails on Tru64 platform with current (1
Dec) version of CVS - traced to following code: CVS of
26 Nov works, CVS of 1 Dec fails

*************** older CVS works ***************
201 mark@gonzo python
Python 2.2b2+ (#539, Nov 26 2001, 09:52:25) [C] on
osf1V4
Type "help", "copyright", "credits" or "license" for
more information.
>>> import sys
>>> s=-1-sys.maxint
>>> d=`s`
>>> d
'-9223372036854775808'
>>> s
-9223372036854775808
>>> ^D

*************** current CVS fails *****************
202 mark@gonzo cd dist/src
203 mark@gonzo ./python
Python 2.2b2+ (#541, Dec  1 2001, 08:04:58) [C] on
osf1V4
Type "help", "copyright", "credits" or "license" for
more information.
>>> import sys
>>> s=-1-sys.maxint
>>> d=`s`
>>> d
'8t\x10@\x01'
>>> s
-9223372036854775808
>>> ^D


----------------------------------------------------------------------

>Comment By: Mark Favas (mfavas)
Date: 2001-12-01 02:29

Message:
Logged In: YES 
user_id=44979

Yes, rev 2.77 of Objects/intobject.c  (buf[20] -> buf[64])
fixes the problem. (Note also that Tru64 has no native
snprintf implementation - at least in V4.)

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-11-30 18:53

Message:
Logged In: YES 
user_id=31435

Please see whether revision: 2.77 of Objects/intobject.c 
fixes your problem.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-11-30 18:44

Message:
Logged In: YES 
user_id=31435

As discussed on Python-Dev, I suspect this is because 
int_repr only allocates 20 bytes for the output buffer, but 
needs 21 in this case.  Changing a bunch of sprintf calls 
to PyOS_snprintf calls very recently would make this matter 
on a sizeof(long) == 8 box.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=487743&group_id=5470