thread_test.c problems

From: Wes Palmer <Wesley(dot)R(dot)Palmer(at)syntegra(dot)com>
To: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: thread_test.c problems
Date: 2004-04-03 21:32:48
Message-ID: BC9489A0.79D5%Wesley.R.Palmer@syntegra.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

When I try to run thread_test.c from the CVS tip, it hangs in an infinite
CPU loop on both linux (RedHat AS 3.0, gcc 3.2.3) and Mac OS X 10.3.3 (gcc
3.3). I've also tried down to gcc 2.96 on Mac OS X.

If I compile it with -g instead of -O2 on linux, it runs to completion and
gives me:

Add this to your template/$port file:

STRERROR_THREADSAFE=yes
GETPWUID_THREADSAFE=no
GETHOSTBYNAME_THREADSAFE=no

On Mac OS X, it gives me:

Add this to your template/$port file:

STRERROR_THREADSAFE=yes
GETPWUID_THREADSAFE=yes
GETHOSTBYNAME_THREADSAFE=yes

If I modify the two while loops

while (errno2_set == 0)

while (errno1_set == 0)

To execute a 'print' statement or a 'time(NULL)' instead of a null loop,
then it runs to completion with -O2.

If I run the 7.4.2 version of thread_test.c, for both platforms I get:

Add this to your template/$port file:

NEED_REENTRANT_FUNCS=yes

On linux, the make run is:

Browse pgsql-general by date

  From Date Subject
Next Message wespvp 2004-04-03 21:40:01 thread_test.c problems
Previous Message Tom Lane 2004-04-03 18:41:45 Re: Problem in calling prepare statement from STORED PROCEDURE