Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kulikjak mannequin opened this issue Dec 10, 2018 · 10 comments
Closed

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

kulikjak mannequin opened this issue Dec 10, 2018 · 10 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@kulikjak
Copy link
Mannequin

kulikjak mannequin commented Dec 10, 2018

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']

    @kulikjak
    Copy link
    Mannequin Author

    kulikjak mannequin commented Dec 10, 2018

    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.

    @kulikjak kulikjak mannequin added 3.7 (EOL) end of life extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump 3.8 only security fixes labels Dec 10, 2018
    @kulikjak
    Copy link
    Mannequin Author

    kulikjak mannequin commented Jun 19, 2019

    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.

    @kulikjak kulikjak mannequin closed this as completed Jun 19, 2019
    @kulikjak kulikjak mannequin added the invalid label Jun 19, 2019
    @isidentical
    Copy link
    Sponsor Member

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

    @isidentical isidentical added the 3.9 only security fixes label Apr 2, 2020
    @isidentical isidentical reopened this Apr 2, 2020
    @kulikjak
    Copy link
    Mannequin Author

    kulikjak mannequin commented Apr 8, 2020

    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).

    @kulikjak
    Copy link
    Mannequin Author

    kulikjak mannequin commented Apr 8, 2020

    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 ;).

    @kulikjak
    Copy link
    Mannequin Author

    kulikjak mannequin commented Nov 2, 2020

    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.

    @kulikjak kulikjak mannequin changed the title Solaris thread_time doesn't work with current implementation Solaris: thread_time doesn't work with current implementation Nov 2, 2020
    @kulikjak kulikjak mannequin added the 3.10 only security fixes label Nov 2, 2020
    @pablogsal
    Copy link
    Member

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

    @serhiy-storchaka
    Copy link
    Member

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

    @pablogsal
    Copy link
    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

    @kulikjak kulikjak mannequin removed the 3.7 (EOL) end of life label Nov 4, 2020
    @pablogsal
    Copy link
    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

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes 3.10 only security fixes extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants