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.

classification
Title: settimer / gettimer functionality on FreeBSD 6.3 (not 7.x)
Type: behavior Stage:
Components: Versions: Python 3.2
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: aimacintyre, terry.reedy, tleeuwenburg@gmail.com
Priority: normal Keywords:

Created on 2009-04-08 10:49 by tleeuwenburg@gmail.com, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg85765 - (view) Author: Tennessee Leeuwenburg (tleeuwenburg@gmail.com) (Python triager) Date: 2009-04-08 10:49
Tests fail on FreeBSD 6.3

http://www.python.org/dev/buildbot/trunk/x86%20FreeBSD%203%20trunk/build
s/77/step-test/0


Relevant extract from parent issue, post by Guilherme Polo:
-----------------------------------------------------------

Trent Nelson kindly gave me access to his FreeBSD 6.2 buildbot so I had
chance to do some tests. The problem happens when Python is built
against or libc_r, or if you are using libmap you won't need to
recompile but the problem still happens when using libc_r.

I started searching in the FreeBSD bug tracker and found this issue:
http://www.freebsd.org/cgi/query-pr.cgi?pr=threads/49087 which seems
very similar to the problem related here.

I've also done a very simple "test" in C, just to demonstrate that this
issue isn't related to Python at all:

#include <stdio.h>
#include <signal.h>
#include <sys/time.h>

void h(int signo)
{
    struct itimerval t;

    getitimer(ITIMER_PROF, &t);
    printf("%d %d\n", t.it_value.tv_sec, t.it_value.tv_usec);

    printf("deactive ITIMER_PROF\n");
    t.it_value.tv_sec = 0;
    t.it_value.tv_usec = 0;
    setitimer(ITIMER_PROF, &t, &t);
}

int main(void)
{
    struct itimerval ival;

    ival.it_value.tv_sec = 1;
    ival.it_value.tv_usec = 0;
    ival.it_interval.tv_sec = 1;
    ival.it_interval.tv_usec = 0;

    signal(SIGPROF, h);
    printf("%d\n", setitimer(ITIMER_PROF, &ival, NULL));
    alarm(2);

    while (1) {
        getitimer(ITIMER_PROF, &ival);
        if (ival.it_value.tv_sec == 0 && ival.it_value.tv_usec == 0)
            break;
        }

    return 0;
}

When I compile this using -lc_r then the callback "h" is never called
and then the alarm is fired. Compiling against pthread, thr or nothing
(since this example doesn't need any threading library) doesn't
demonstrate this problem and all is fine (callback "h" is invoked,
infinite loop finishes and test returns 0).

Should further discussion be moved to python-dev ? I'm somewhat stuck on
how to resolve this, besides saying to upgrade to FreeBSD 7 which uses
libthr by default.
msg85767 - (view) Author: Tennessee Leeuwenburg (tleeuwenburg@gmail.com) (Python triager) Date: 2009-04-08 10:50
This issue is a follow-up to Issue 2240 (now closed).
http://bugs.python.org/issue2240
msg85845 - (view) Author: Andrew I MacIntyre (aimacintyre) * (Python triager) Date: 2009-04-11 09:19
I've just built (using ./configure; make) 3.1a on FreeBSD 6.4 amd64.
libpthread is used by the resulting binary, not libc_r, according to ldd.

I would expect then that explicit action is required to use libc_r, and
given that FreeBSD people have indicated that it is deprecated and no
fixes are likely to be made, I would suggest documenting this as a
"don't do that" (ie use -lc_r) and close this as "won't fix".

The README file in the root of the source tree would seem an appropriate
place for such documentation, though I note that there appears to be a
lot of out of date information in there already...
msg139201 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-06-26 19:46
I am following Andrew's suggestion. This issue can serve as 'don't do that' doc.

The 3.2 README has been edited and slimmed down by Georg Brandl. It is limited to general build instructions. It would not be the place for such a nit. It does say "You can pass many options to the configure script; run "./configure --help" to find out more." I do not know if that gives system specific hints.

It seems to me that the wiki might be a place for system-specific instructions, with a page like BuildingWithFreeBSD, etc.
History
Date User Action Args
2022-04-11 14:56:47adminsetgithub: 49972
2011-06-26 19:46:25terry.reedysetstatus: open -> closed
versions: + Python 3.2, - Python 3.1
nosy: + terry.reedy

messages: + msg139201

resolution: wont fix
2009-04-11 09:19:59aimacintyresetnosy: + aimacintyre
messages: + msg85845
2009-04-08 10:50:05tleeuwenburg@gmail.comsetmessages: + msg85767
2009-04-08 10:49:02tleeuwenburg@gmail.comcreate