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 vstinner
Recipients neologix, rosslagerwall, rpointel, vstinner
Date 2011-08-29.21:45:07
SpamBayes Score 7.377432e-14
Marked as misclassified No
Message-id <1314654308.8.0.353970953192.issue12852@psf.upfronthosting.co.za>
In-reply-to
Content
I think that the problem is that fdopendir() is not defined. If a function is not defined, C uses int as the result type. An int is not enough to store a 64-bit pointer. See in gdb output: dirp is 0x0afb0e80 whereas other pointers look like 0x20973fc30. You missed the highest hexa digit (0x2).

fdopendir() requires IEEE 1003.1-2008 and so "#define _POSIX_C_SOURCE 200809L", whereas pyconfig.h defines _POSIX_C_SOURCE to 200112L (POSIX 2001).

Something should be done in configure.in, near:
-----------------------------------------
case $ac_sys_system/$ac_sys_release in
  # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
  # even though select is a POSIX function. Reported by J. Ribbens.
  # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
  # In addition, Stefan Krah confirms that issue #1244610 exists through
  # OpenBSD 4.6, but is fixed in 4.7.
  OpenBSD/2.* | OpenBSD/3.* | OpenBSD/4.@<:@0123456@:>@) 
    define_xopen_source=no
    # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
    # also defined. This can be overridden by defining _BSD_SOURCE
    # As this has a different meaning on Linux, only define it on OpenBSD
    AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features])
    ;;
  OpenBSD/*)
    # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
    # also defined. This can be overridden by defining _BSD_SOURCE
    # As this has a different meaning on Linux, only define it on OpenBSD
    AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features])
    ;;
-----------------------------------------

or maybe in

-----------------------------------------
if test $define_xopen_source = yes
then
  AC_DEFINE(_XOPEN_SOURCE, 600, 
            Define to the level of X/Open that your system supports)

  # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
  # definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else
  # several APIs are not declared. Since this is also needed in some
  # cases for HP-UX, we define it globally.
  AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,
   	    Define to activate Unix95-and-earlier features)

  AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001)  
fi
-----------------------------------------

I tried "AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features from IEEE Stds 1003.1-2008)" but it doesn't work.

Add "#define _POSIX_C_SOURCE 200809L" at the beginning of Modules/posixmodule.c does works around this issue.
History
Date User Action Args
2011-08-29 21:45:08vstinnersetrecipients: + vstinner, neologix, rosslagerwall, rpointel
2011-08-29 21:45:08vstinnersetmessageid: <1314654308.8.0.353970953192.issue12852@psf.upfronthosting.co.za>
2011-08-29 21:45:08vstinnerlinkissue12852 messages
2011-08-29 21:45:07vstinnercreate