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
Solaris: thread_time doesn't work with current implementation #79636
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-11-02.23:10:46.599>created_at=<Date2018-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=<Date2020-11-04.14:19:21.585>user='https://github.com/kulikjak'
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.
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.
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 commented on Apr 8, 2020
kulikjakmannequin
MannequinAuthor
More actions
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 ;).
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
Activity
kulikjak commentedon 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 commentedon 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.
isidentical commentedon Apr 2, 2020
This issue is still valid under other solaris/sunos versions. @kulikjak are you still interested in resolving this issue?
kulikjak commentedon 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 commentedon 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 commentedon 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.
[-]Solaris thread_time doesn't work with current implementation[/-][+]Solaris: thread_time doesn't work with current implementation[/+]pablogsal commentedon Nov 2, 2020
New changeset 9568622 by Jakub Kulík in branch 'master':
bpo-35455: Fix thread_time for Solaris OS (GH-11118)
9568622
serhiy-storchaka commentedon Nov 3, 2020
Perhaps we should also use gethrtime() and gethrvtime() on HP-UX, but this is a different issue.
pablogsal commentedon Nov 4, 2020
New changeset 72bb4c6 by Miss Skeleton (bot) in branch '3.9':
bpo-35455: Fix thread_time for Solaris OS (GH-11118) (GH-23130)
72bb4c6
pablogsal commentedon Nov 4, 2020
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