Author kulikjak
Recipients kulikjak
Date 2020-09-01.13:55:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1598968522.06.0.521626204763.issue41687@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2020-09-01 13:55:22kulikjaksetrecipients: + kulikjak
2020-09-01 13:55:22kulikjaksetmessageid: <1598968522.06.0.521626204763.issue41687@roundup.psfhosted.org>
2020-09-01 13:55:22kulikjaklinkissue41687 messages
2020-09-01 13:55:21kulikjakcreate