[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

STINNER Victor report at bugs.python.org
Tue Aug 30 10:08:24 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

>> I tried "AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features from IEEE Stds 1003.1-2008)" but it doesn't work.
>
> You mean that the patch you attached doesn't work, correct?

I ran autoconf, re-ran configure and it doesn't work. You can test 
without touching configure.in: edit pyconfig.h directly.

On Linux, all "features" flags are defined/undefined in 
/usr/include/features.h. Depending on _POSIX_C_SOURCE, _XOPEN_SOURCE, 
_BSD_SOURCE, ..., you get a different POSIX level.

For example:

/* If _GNU_SOURCE was defined by the user, turn on all the other 
features.  */
#ifdef _GNU_SOURCE
# undef  _ISOC99_SOURCE
# define _ISOC99_SOURCE	1
# undef  _POSIX_SOURCE
# define _POSIX_SOURCE	1
# undef  _POSIX_C_SOURCE
# define _POSIX_C_SOURCE	200809L
# undef  _XOPEN_SOURCE
# define _XOPEN_SOURCE	700
# ...
#endif

I suppose that there is a conflict between Python's _POSIX_C_SOURCE and 
other defines related to the POSIX level.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12852>
_______________________________________


More information about the Python-bugs-list mailing list