[ python-Bugs-1470353 ] test_ctypes fails on FreeBSD 4.x

SourceForge.net noreply at sourceforge.net
Fri Apr 14 22:09:06 CEST 2006


Bugs item #1470353, was opened at 2006-04-14 15:11
Message generated for change (Settings changed) made by theller
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1470353&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Andrew I MacIntyre (aimacintyre)
>Assigned to: Thomas Heller (theller)
Summary: test_ctypes fails on FreeBSD 4.x

Initial Comment:
$ ./python Lib/test/regrtest.py test_ctypes
test_ctypes
test test_ctypes failed -- Traceback (most recent call
last):
  File
"/home/andymac/dev/python-svn-head/Lib/ctypes/test/test_functions.py",
line 333, in test_struct_return_2H
    self.failUnlessEqual((s2h.x, s2h.y), (99*2, 88*3))
AssertionError: (-1004, 2123) != (198, 264)

1 test failed:
    test_ctypes
[41158 refs]

This is with a subversion checkout updated to 5am AEST
(Aust) 14Apr06, debug build.

The returned tuple values (s2h.x, s2h.y) appear to vary
from run to run, so it looks like something isn't where
its expected.

This is with a FreeBSD 4.8 i386 system (not
particularly recent), using gcc 2.95.4.  A quick and
dirty test (in C) suggests that its not an alignment
issue for the 2 shorts in the S2H struct.

Ideas for trying to debug this further?

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

Comment By: Thomas Heller (theller)
Date: 2006-04-14 21:09

Message:
Logged In: YES 
user_id=11105

Of course I meant FreeBSD instead of NetBSD, sorry.

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

Comment By: Thomas Heller (theller)
Date: 2006-04-14 21:08

Message:
Logged In: YES 
user_id=11105

This looks very similar to a problem I recently 'fixed' on
OpenBSD - maybe it is even a bug in libffi.  On OpenBSD x86
the problem seemed to be that small structures are passed
like  short or int.  You could try to fix it by adding the
appropriate definition in
Modules/_ctypes/libffi/src/x86/ffi.c, at lines 124 and lines
138.  Maybe changing them to

#if !defined(X86_WIN32) && !defined(__OpenBSD__) &&
!defined(__NetBSD__)

or whatever the magic symbol for Netbsd is.

Unfortunately I do not have access to a netbsd machine myself.

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

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


More information about the Python-bugs-list mailing list