This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: sendfile implementation is not compatible with Solaris
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.10, Python 3.9, Python 3.8
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, kulikjak, lukasz.langa, miss-islington, yselivanov
Priority: normal Keywords: patch

Created on 2020-09-01 13:55 by kulikjak, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 22040 merged kulikjak, 2020-09-01 14:02
PR 22128 merged kulikjak, 2020-09-07 08:25
PR 22273 merged lukasz.langa, 2020-09-16 11:09
PR 22274 merged miss-islington, 2020-09-16 11:53
Messages (6)
msg376191 - (view) Author: Jakub Kulik (kulikjak) * Date: 2020-09-01 13:55

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.

msg376439 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2020-09-05 19:10
New changeset 8c0be6fd9101746235b63ddfb84106d1e9ca286b by Jakub Kulík in branch 'master':
bpo-41687: Fix sendfile implementation to work with Solaris (#22040)
msg376475 - (view) Author: Jakub Kulik (kulikjak) * Date: 2020-09-07 08:31
I just realized that the recently merged PR has broken error handling, so I opened another one with a followup fix.
msg376658 - (view) Author: miss-islington (miss-islington) Date: 2020-09-09 19:30
New changeset fa8c9e70104b0aef966a518eb3a80a4881906ae0 by Jakub Kulík in branch 'master':
bpo-41687: Fix error handling in Solaris sendfile implementation (GH-22128)
msg376988 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2020-09-16 11:52
New changeset 7e356f17e4c91392b6fa45a512efc95923388813 by Łukasz Langa in branch '3.9':
[3.9] bpo-41687: Fix sendfile implementation to work with Solaris (GH-22040) (GH-22273)
msg376990 - (view) Author: miss-islington (miss-islington) Date: 2020-09-16 12:25
New changeset 6a39888c2c4bcfbcdc61a1953911ad30c62da1ef by Miss Islington (bot) in branch '3.9':
bpo-41687: Fix error handling in Solaris sendfile implementation (GH-22128)
Date User Action Args
2022-04-11 14:59:35adminsetgithub: 85853
2020-09-16 12:25:16miss-islingtonsetmessages: + msg376990
2020-09-16 11:53:00miss-islingtonsetpull_requests: + pull_request21329
2020-09-16 11:52:52lukasz.langasetmessages: + msg376988
2020-09-16 11:09:46lukasz.langasetnosy: + lukasz.langa

pull_requests: + pull_request21328
2020-09-09 19:30:04miss-islingtonsetnosy: + miss-islington
messages: + msg376658
2020-09-07 08:31:23kulikjaksetmessages: + msg376475
2020-09-07 08:25:29kulikjaksetpull_requests: + pull_request21209
2020-09-05 19:10:31yselivanovsetstatus: open -> closed
type: behavior
resolution: fixed
stage: patch review -> resolved
2020-09-05 19:10:10yselivanovsetnosy: + yselivanov
messages: + msg376439
2020-09-04 23:04:33terry.reedysetversions: - Python 3.7
2020-09-01 14:02:22kulikjaksetkeywords: + patch
stage: patch review
pull_requests: + pull_request21137
2020-09-01 13:57:04BTaskayasetnosy: + BTaskaya
2020-09-01 13:55:22kulikjakcreate