You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sendfile implementation is not compatible with Solaris #85853
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2020-09-05.19:10:31.396>created_at=<Date2020-09-01.13:55:22.051>labels= ['3.8', 'type-bug', 'library', '3.9', '3.10']
title='sendfile implementation is not compatible with Solaris'updated_at=<Date2020-09-16.12:25:16.758>user='https://github.com/kulikjak'
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 bpo-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.
Activity
kulikjak commentedon Sep 1, 2020
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 bpo-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
1st1 commentedon Sep 5, 2020
New changeset 8c0be6f by Jakub Kulík in branch 'master':
bpo-41687: Fix sendfile implementation to work with Solaris (bpo-22040)
8c0be6f
kulikjak commentedon Sep 7, 2020
I just realized that the recently merged PR has broken error handling, so I opened another one with a followup fix.
miss-islington commentedon Sep 9, 2020
New changeset fa8c9e7 by Jakub Kulík in branch 'master':
bpo-41687: Fix error handling in Solaris sendfile implementation (GH-22128)
fa8c9e7
ambv commentedon Sep 16, 2020
New changeset 7e356f1 by Łukasz Langa in branch '3.9':
[3.9] bpo-41687: Fix sendfile implementation to work with Solaris (GH-22040) (GH-22273)
7e356f1
miss-islington commentedon Sep 16, 2020
New changeset 6a39888 by Miss Islington (bot) in branch '3.9':
bpo-41687: Fix error handling in Solaris sendfile implementation (GH-22128)
6a39888