This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ghazel
Recipients ghazel, theller
Date 2010-07-15.12:55:46
SpamBayes Score 6.398486e-09
Marked as misclassified No
Message-id <1279198550.56.0.12735266712.issue9266@psf.upfronthosting.co.za>
In-reply-to
Content
ctypes on Windows on a 64bit Python installation gets a NULL pointer access where one is not expected.

To reproduce the problem, run make.bat then "python ctypes_test.py"


Failure output looks like this:

Three! 1 2 <__main__.LP_Some object at 0x000000000209C4C8>
<__main__.Some object at 0x000000000209C548>
91
Four! 1 2 3 <__main__.LP_Some object at 0x000000000209C4C8>
Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 291, in 'calling callback function'
  File "ctypes_test.py", line 21, in fourprinter
    print(to.contents)
ValueError: NULL pointer access


Otherwise, successful output looks something like:

Three! 1 2 <ctypes.LP_Some object at 0x2acc9482aed0>
<__main__.Some object at 0x2acc9482ae50>
91
Four! 1 2 3 <ctypes.LP_Some object at 0x2acc9482aed0>
<__main__.Some object at 0x2acc9482ae50>
91



Environments exhibiting this problem:

Python 2.7 (r27:82525, Jul  4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.architecture()
('64bit', 'WindowsPE')

Python 3.1.2 (r312:79149, Mar 20 2010, 22:55:39) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.architecture()
('64bit', 'WindowsPE')


Environments NOT exhibiting the problem:

Python 2.4.3 (#1, Sep  3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.architecture()
('64bit', 'ELF')

Also Windows on a 32bit architecture seems unaffected.
History
Date User Action Args
2010-07-15 12:55:51ghazelsetrecipients: + ghazel, theller
2010-07-15 12:55:50ghazelsetmessageid: <1279198550.56.0.12735266712.issue9266@psf.upfronthosting.co.za>
2010-07-15 12:55:48ghazellinkissue9266 messages
2010-07-15 12:55:46ghazelcreate