Re: futex lockup? - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: futex lockup?
Date
Msg-id 20060208092817.GA1985@svana.org
Whole thread Raw
In response to futex lockup?  (Rob Newton <robn@mirrabooka.com>)
List pgsql-general
On Wed, Feb 08, 2006 at 04:22:30PM +1000, Rob Newton wrote:
> Hi,
>
> I wrote a program using pgsql's ESQL/C.  Occasionally it blocks
> forever on a system call futex(), and I'm wondering if pgsql's
> libraries use this futex call?? (because my code doesn't use it).

futexes are Fast Userspace mutexes. The kernel call is to arbitrate
conflicts and handle blocking. About the only place they're going to be
used is when doing threads.

> Because the problem only occurs occasionally I can't really trace
> it while it's running.  But when I discover it's locked up, and
> then do a trace, I get the following:
>
>   Process 19893 attached - interrupt to quit
>   futex(0x238f20, FUTEX_WAIT, 2, NULL

Is your program multithreaded? futexes require processes sharing an
address space. If you want better info, you're better off trying to
attach gdb to it and getting a backtrace (bt).

> I'm using psql 8.0.3 on Linux FC4 (kernel 2.6.11-1).

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Is there a way to limit CPU usage per user
Next
From: Martijn van Oosterhout
Date:
Subject: Re: alter superuser...