[issue22396] AIX posix_fadvise and posix_fallocate
Roundup Robot added the comment: New changeset 8e5e19b3cd4e by Victor Stinner in branch '3.4': Issue #22396: On 32-bit AIX platform, don't expose os.posix_fadvise() nor https://hg.python.org/cpython/rev/8e5e19b3cd4e New changeset 5ade1061fa3d by Victor Stinner in branch 'default': (Merge 3.4) Issue #22396: On 32-bit AIX platform, don't expose https://hg.python.org/cpython/rev/5ade1061fa3d -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22396 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22396] AIX posix_fadvise and posix_fallocate
STINNER Victor added the comment: Or can we simply keep the function and skip the test? Usually, we prefer to not provide the function in Python if it is known to be broken. Other examples: - HAVE_BROKEN_POLL: don't declare select.poll() - HAVE_BROKEN_PTHREAD_SIGMASK: don't declare signal.pthread_sigmask() There are also HAVE_BROKEN_NICE and HAVE_BROKEN_UNSETENV. Sorry, I'm too lazy to hack configure.ac, so I used a simple #ifdef in Modules/posixmodule.c to define POSIX_FADVISE_AIX_BUG. If you feel more confortable with autotools, don't hesitate to propose a better patch :-) I consider that the issue is now fixed. @David: You should check with IBM why they don't fix the issue. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22396 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22396] AIX posix_fadvise and posix_fallocate
David Edelsohn added the comment: Attached is a revised patch that disables posix_fadvise() and posix_fallocate() when building on 32 bit AIX with _LARGE_FILES defined. -- Added file: http://bugs.python.org/file36699/22396_aix.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22396 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22396] AIX posix_fadvise and posix_fallocate
STINNER Victor added the comment: Attached is a revised patch that disables posix_fadvise() and posix_fallocate() when building on 32 bit AIX with _LARGE_FILES defined. Good. You should add a reference to this issue, something like Issue #22396: To avoid code duplication, you may write something like: /* Issue #22396: AIX currently does not support a 32-bit call to posix_fallocate() if _LARGE_FILES is defined. */ #if defined(HAVE_POSIX_FALLOCATE) !(defined(_AIX) defined(_LARGE_FILES) !defined(__64BIT__)) # undef HAVE_POSIX_FALLOCATE #endif or #define BROKEN_POSIX_FALLOCATE. Which Python versions should be patched? 3.4 and 3.5? Python 2.7 doesn't have the function (introduced in Python 3.3). For Python 3.4, it means that between two Python minor versions, the function disappears on AIX 32-bit :-/ Is it a problem since the function didn't work on this platform? (always fail with EINVAL) I suggest to patch 3.4 and 3.5. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22396 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22396] AIX posix_fadvise and posix_fallocate
Serhiy Storchaka added the comment: I think that some time AIX bug will be fixed. May be it would be better to introduce special macros, and set it in the configure script (similar to HAVE_GLIBC_MEMMOVE_BUG or HAVE_IPA_PURE_CONST_BUG). Or may be just udefine HAVE_POSIX_FADVISE at such circumstances. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22396 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22396] AIX posix_fadvise and posix_fallocate
Antoine Pitrou added the comment: Or can we simply keep the function and skip the test? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22396 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22396] AIX posix_fadvise and posix_fallocate
David Edelsohn added the comment: The declaration of the two system calls should be fixed in the AIX header, but the clueless response to the AIX problem report is underwhelming. I don't understand the keep the function and skip the test suggestion. I thought that was my first patch -- catch the exception of invalid argument and allow it to fail on AIX. If AIX eventually is fixed, the test will pass, no harm, no foul. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22396 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22396] AIX posix_fadvise and posix_fallocate
David Edelsohn added the comment: Any feedback about which approach would be acceptable? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22396 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22396] AIX posix_fadvise and posix_fallocate
STINNER Victor added the comment: 10812_aix.patch just hides the problem. I understand that AIX doesn't declare the function prototype correctly? I would prefer to disable the function in the posix module (don't declare it) if it's the case. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22396 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22396] AIX posix_fadvise and posix_fallocate
STINNER Victor added the comment: I understand that AIX doesn't declare the function prototype correctly? AIX bug report: http://www-01.ibm.com/support/docview.wss?uid=isg1IV56170 I like Ruby's patch: -#ifdef HAVE_POSIX_FADVISE +/* AIX currently does not support a 32-bit call to posix_fadvise() + * if _LARGE_FILES is defined. + */ +#if defined(HAVE_POSIX_FADVISE) !(defined(_AIX) defined(_LARGE_FILES) !defined(_ARCH_PPC64)) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22396 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22396] AIX posix_fadvise and posix_fallocate
New submission from David Edelsohn: As with Solaris and Issue10812, test_posix fadvise and fallocate fail on AIX. Python is compiled with _LARGE_FILES, which changes the function signature for posix_fadvise and posix_fallocate so that off_t is long long on 32 bit system passed in two registers. The Python call to those functions does not place the arguments in the correct registers, causing an EINVAL error. This patch fixes the failures in a similar way to Solaris ZFS kludge for Issue10812. -- components: Tests files: 10812_aix.patch keywords: patch messages: 226834 nosy: David.Edelsohn, pitrou priority: normal severity: normal status: open title: AIX posix_fadvise and posix_fallocate type: behavior versions: Python 3.3, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file36611/10812_aix.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22396 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22396] AIX posix_fadvise and posix_fallocate
Antoine Pitrou added the comment: The Python call to those functions does not place the arguments in the correct registers Well... isn't there a way to fix this? I don't understand how this issue can come up. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22396 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22396] AIX posix_fadvise and posix_fallocate
Serhiy Storchaka added the comment: See similar Ruby issue: https://bugs.ruby-lang.org/issues/9914 . As workaround we can redeclare posix_fadvise as int posix_fadvise(int fd, long offset, long len, int advice) on 32-bit AIX with enabled _LARGE_FILES. More safe option is to disable posix_fadvise in such case (as Ruby had done). -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22396 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com