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

noreply@sourceforge.net noreply@sourceforge.net
Fri, 30 Nov 2001 18:53:45 -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: 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