[Python-de] Python 2.2 64-bit und 0xffffffff != -1

Hartmut Goebel h.goebel at goebel-consult.de
Di Mär 4 13:10:38 CET 2014


Hallo zusammen,

ich versuche momentan Python 2.2.3 auf einer 64-bit Maschine zum Laufen
zu bekommen. Leider schlägt ein Test in test_compile fehl:

eval('0xffffffff') sollte -1 sein, ist aber 4294967295

Der gleiche Code mit den gleichen Patches auf einem 32-bit System
funktioniert. Auf beiden Maschinen nutze ich
GCC 4.7.2 on linux3.

Die Docu für Python 2.2 [1] sagt ausdrücklich: "Plain octal and
hexadecimal literals may be as large as 4294967295, but values larger
than 2147483647 are converted to a negative value by subtracting
4294967296". Offensichtlich wird dieser Oberflow also nicht geprüft. Bei
Python 1.5 und 2.3 ist es der gleiche Effekt. Das wundert mich
insbesondere, weil es im README für 2.2.3 bereits Hinweise auf 64-Bit
Systeme gibt.

Ist das jemanden von Euch auch schon aufgefallen? Gibt es eine Patch?
Oder hat jmd. eine Idee, nach was ich suchen kann? (Ich habe mich
bereits durch den C-Code gewühlt, aber keinen Ansatzpunkt gefunden.)


[1] http://docs.python.org/release/2.2/ref/integers.html

-- 
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP
Information Security Management, Security Governance, Secure Software
Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: http://www.goebel-consult.de/blog/quelltext-fur-tolino-shine
Kolumne: http://www.cissp-gefluester.de/2010-08-scheingefechte-um-rim

Goebel Consult ist Mitglied bei http://www.7-it.de/

-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: <http://mail.python.org/pipermail/python-de/attachments/20140304/7eed4271/attachment.html>
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : smime.p7s
Dateityp    : application/pkcs7-signature
Dateigröße  : 3883 bytes
Beschreibung: S/MIME Cryptographic Signature
URL         : <http://mail.python.org/pipermail/python-de/attachments/20140304/7eed4271/attachment.bin>


Mehr Informationen über die Mailingliste python-de