[New-bugs-announce] [issue41687] sendfile implementation is not compatible with Solaris

Jakub Kulik report at bugs.python.org
Tue Sep 1 09:55:22 EDT 2020


New submission from Jakub Kulik <kulikjak at gmail.com>:

Hi,

Sendfile on Solaris raises EINVAL if offset is equal or bigger than the size of the file. This is different from Linux, where similar sendfile call returns 0, which is used in an ad-hoc fashion to indicate EOF. Since Python sendfile implementation expects 0 to be returned, it breaks. I already reported this in issue 36610, which led to sendfile eventually being disabled on Solaris to be safe before the 3.8 release.

We were first looking into a possibility to change Solaris behavior of sendfile to reflect that of Linux but decided not to because of the significant risk that it can break existing programs. The other reason is that sendfile isn't standardized (Linux manpage explicitly states that) and hence Solaris implementation isn't broken, just different. Because of that, we patched the runtime and added #ifdef branch (of which there are already many due to os differences) with additional offset check. It is tested with the current master and also 3.7, which we are using internally.

Thanks

----------
components: Library (Lib)
messages: 376191
nosy: kulikjak
priority: normal
severity: normal
status: open
title: sendfile implementation is not compatible with Solaris
versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41687>
_______________________________________


More information about the New-bugs-announce mailing list