Skip to content

sendfile implementation is not compatible with Solaris #85853

Description

@kulikjak
mannequin
BPO 41687
Nosy @ambv, @1st1, @miss-islington, @isidentical, @kulikjak
PRs
  • bpo-41687: Fix sendfile implementation to work with Solaris #22040
  • bpo-41687: Fix error handling in Solaris sendfile implementation #22128
  • [3.9] bpo-41687: Fix sendfile implementation to work with Solaris (GH-22040) #22273
  • [3.9] bpo-41687: Fix error handling in Solaris sendfile implementation (GH-22128) #22274
  • 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 = None
    closed_at = <Date 2020-09-05.19:10:31.396>
    created_at = <Date 2020-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 = <Date 2020-09-16.12:25:16.758>
    user = 'https://github.com/kulikjak'

    bugs.python.org fields:

    activity = <Date 2020-09-16.12:25:16.758>
    actor = 'miss-islington'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-09-05.19:10:31.396>
    closer = 'yselivanov'
    components = ['Library (Lib)']
    creation = <Date 2020-09-01.13:55:22.051>
    creator = 'kulikjak'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41687
    keywords = ['patch']
    message_count = 6.0
    messages = ['376191', '376439', '376475', '376658', '376988', '376990']
    nosy_count = 5.0
    nosy_names = ['lukasz.langa', 'yselivanov', 'miss-islington', 'BTaskaya', 'kulikjak']
    pr_nums = ['22040', '22128', '22273', '22274']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue41687'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    Activity

    1. kulikjak commented on Sep 1, 2020

      kulikjakmannequin
      MannequinAuthor

      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

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Sep 1, 2020
    3. 1st1 commented on Sep 5, 2020

      @1st1
      Member

      New changeset 8c0be6f by Jakub Kulík in branch 'master':
      bpo-41687: Fix sendfile implementation to work with Solaris (bpo-22040)
      8c0be6f

    4. added
      type-bugAn unexpected behavior, bug, or error
      on Sep 5, 2020
    5. added
      type-bugAn unexpected behavior, bug, or error
      on Sep 5, 2020
    6. kulikjak commented on Sep 7, 2020

      kulikjakmannequin
      MannequinAuthor

      I just realized that the recently merged PR has broken error handling, so I opened another one with a followup fix.

    7. miss-islington commented on Sep 9, 2020

      @miss-islington
      Contributor

      New changeset fa8c9e7 by Jakub Kulík in branch 'master':
      bpo-41687: Fix error handling in Solaris sendfile implementation (GH-22128)
      fa8c9e7

    8. ambv commented on Sep 16, 2020

      @ambv
      Contributor

      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

    9. miss-islington commented on Sep 16, 2020

      @miss-islington
      Contributor

      New changeset 6a39888 by Miss Islington (bot) in branch '3.9':
      bpo-41687: Fix error handling in Solaris sendfile implementation (GH-22128)
      6a39888

    10. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10 (EOL)end of life3.8 (EOL)end of life3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions