Skip to content

Solaris: thread_time doesn't work with current implementation #79636

Closed

Description

@kulikjak
mannequin
BPO 35455
Nosy @serhiy-storchaka, @pablogsal, @miss-islington, @isidentical, @kulikjak
PRs
  • bpo-35455: Fix thread_time for Solaris OS #11118
  • [3.9] bpo-35455: Fix thread_time for Solaris OS (GH-11118) #23130
  • [3.8] bpo-35455: Fix thread_time for Solaris OS (GH-11118). #23145
  • Files
  • thread_time.diff: Possible patch
  • 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-11-02.23:10:46.599>
    created_at = <Date 2018-12-10.14:32:21.917>
    labels = ['extension-modules', '3.10', '3.8', '3.9', 'type-crash']
    title = "Solaris: thread_time doesn't work with current implementation"
    updated_at = <Date 2020-11-04.14:19:21.585>
    user = 'https://github.com/kulikjak'

    bugs.python.org fields:

    activity = <Date 2020-11-04.14:19:21.585>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-11-02.23:10:46.599>
    closer = 'pablogsal'
    components = ['Extension Modules']
    creation = <Date 2018-12-10.14:32:21.917>
    creator = 'kulikjak'
    dependencies = []
    files = ['47984']
    hgrepos = []
    issue_num = 35455
    keywords = ['patch']
    message_count = 10.0
    messages = ['331509', '346027', '365635', '366000', '366001', '380213', '380255', '380264', '380321', '380326']
    nosy_count = 5.0
    nosy_names = ['serhiy.storchaka', 'pablogsal', 'miss-islington', 'BTaskaya', 'kulikjak']
    pr_nums = ['11118', '23130', '23145']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue35455'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    Activity

    1. kulikjak commented on Dec 10, 2018

      kulikjakmannequin
      MannequinAuthor

      Implementation of time.thread_time() doesn't work on Solaris because clock_id CLOCK_THREAD_CPUTIME_ID is not known (it is defined, but clock_gettime returns EINVAL error). Solaris, however, has function gethrvtime() which can substitute this functionality.

      I attached a possible patch which does work during tests and I further tested it with some basic scripts.

    2. added
      type-crashA hard crash of the interpreter, possibly with a core dump
      on Dec 10, 2018
    3. kulikjak commented on Jun 19, 2019

      kulikjakmannequin
      MannequinAuthor

      Since I created this pull request, clock_gettime(CLOCK_THREAD_CPUTIME_ID, ..) was implemented into the Solaris kernel, so I guess that this is no longer relevant.

    4. isidentical commented on Apr 2, 2020

      @isidentical
      SponsorMember

      This issue is still valid under other solaris/sunos versions. @kulikjak are you still interested in resolving this issue?

    5. kulikjak commented on Apr 8, 2020

      kulikjakmannequin
      MannequinAuthor

      I was speaking for Oracle Solaris 11.4, where CLOCK_THREAD_CPUTIME_ID is now implemented (and we don't need it in older releases). But you are right that other Solaris/SunOS versions might not have this and hence would find this useful.

      I can rebase and reopen the original PR, but I cannot test it that well now that our Solaris doesn't use that part of the code (I can change the #define for testing, that should be sufficient).

    6. kulikjak commented on Apr 8, 2020

      kulikjakmannequin
      MannequinAuthor

      Correction: looking at the PR, I made it so that it checks for SunOS, so even with CLOCK_THREAD_CPUTIME_ID available, new code would be executed.

      So if you believe that this should be implemented for other SunOSes, I can do it ;).

    7. kulikjak commented on Nov 2, 2020

      kulikjakmannequin
      MannequinAuthor

      Comment from https://bugs.python.org/issue42173#msg380205 confirmed that this issue is still relevant to Illumos based systems. Because of that, I am happy to resolve it.

    8. changed the title [-]Solaris thread_time doesn't work with current implementation[/-] [+]Solaris: thread_time doesn't work with current implementation[/+] on Nov 2, 2020
    9. pablogsal commented on Nov 2, 2020

      @pablogsal
      Member

      New changeset 9568622 by Jakub Kulík in branch 'master':
      bpo-35455: Fix thread_time for Solaris OS (GH-11118)
      9568622

    10. serhiy-storchaka commented on Nov 3, 2020

      @serhiy-storchaka
      Member

      Perhaps we should also use gethrtime() and gethrvtime() on HP-UX, but this is a different issue.

    11. pablogsal commented on Nov 4, 2020

      @pablogsal
      Member

      New changeset 72bb4c6 by Miss Skeleton (bot) in branch '3.9':
      bpo-35455: Fix thread_time for Solaris OS (GH-11118) (GH-23130)
      72bb4c6

    12. pablogsal commented on Nov 4, 2020

      @pablogsal
      Member

      New changeset a12f459 by Jakub Kulík in branch '3.8':
      [3.8] bpo-35455: Fix thread_time for Solaris OS (GH-11118). (GH-23145)
      a12f459

    13. 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 lifeextension-modulesC modules in the Modules dirtype-crashA hard crash of the interpreter, possibly with a core dump

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions