[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-30 Thread Remi Pointel
Remi Pointel added the comment: Hi, this is the result of gcc -E on Modules/posixmodule.o, asked by haypo. Thanks for your help, Cheers, Remi. -- Added file: http://bugs.python.org/file23072/gcc-E-Modules_posixmodule_output ___ Python tracker

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-30 Thread STINNER Victor
STINNER Victor 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

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-30 Thread Charles-François Natali
Charles-François Natali added the comment: > 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 0

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-29 Thread STINNER Victor
STINNER Victor added the comment: 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 m

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-29 Thread Charles-François Natali
Charles-François Natali added the comment: [Switching to process 21658, thread 0x20a519000] _readdir_unlocked (dirp=0xafb0e80, result=0x7f7d7ac0, skipdeleted=1) at /usr/src/lib/libc/gen/readdir.c:44 44 if (dirp->dd_loc >= dirp->dd_size) Looks like dirp points to an

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-29 Thread STINNER Victor
STINNER Victor added the comment: > It looks like a kernel bug !? And you know what? fdopendir() function has been introducted in OpenBSD 5.0! -- ___ Python tracker ___ ___

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-29 Thread Ross Lagerwall
Ross Lagerwall added the comment: I'm not sure what the status of Python and OpenBSD support is but I just tried the latest stable version of OpenBSD (4.9) in VirtualBox and it won't compile fully. It segfaults while trying to run setup.py (I think). I see you're running OpenBSD 5.0. Does it

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-29 Thread Remi Pointel
Remi Pointel added the comment: Hi, I tested with this program in C: #include #include #include #include int main(void) { DIR *d; struct dirent *dp; int dfd; if ((d = fdopendir((dfd = open("/tmp", O_RDONLY == NULL) { fprintf(stderr, "Cannot open /tmp directory

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-29 Thread Ross Lagerwall
Ross Lagerwall added the comment: > It looks like a kernel bug !? That's what I thought given that it appears to be working on all the other platforms. -- ___ Python tracker _

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-29 Thread STINNER Victor
STINNER Victor added the comment: It looks like a kernel bug !? Are you able to write a C script reproducing the problem? If not, I can try to write it. -- nosy: +haypo ___ Python tracker

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-29 Thread Remi Pointel
Remi Pointel added the comment: Hi, thanks for your response. Yes it always segfault: $ ./python -c 'import os; print(os.fdlistdir(os.open("/tmp", os.O_RDONLY)))' zsh: segmentation fault (core dumped) ./python -c 'import os; print(os.fdlistdir(os.open("/tmp", os.O_RDONLY)))' $ ./python -c

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-29 Thread Ross Lagerwall
Ross Lagerwall added the comment: Does it always segfault? Try: ./python -c 'import os; print(os.fdlistdir(os.open("/tmp", os.O_RDONLY)))' with various values for /tmp. >From what I can see, the code for fdlistdir is basically the same as >os.listdir(). If possible, try os.listdir() as well.

[issue12852] test_posix.test_fdlistdir() segfault on OpenBSD

2011-08-29 Thread Remi Pointel
New submission from Remi Pointel : Hi, During the regress tests on OpenBSD, test_posix.test_fdlistdir() segfault. Details: $ ./python ./Tools/scripts/run_tests.py test_posix /home/remi/dev/cpython_test/python -W default -bb -E -m test -r -w -j 0 -u all,-largefile,-network,-urlfetch,-audio,-gu