Re: futex lockup?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Rob Newton <robn(at)mirrabooka(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: futex lockup?
Date: 2006-02-08 09:28:17
Message-ID: 20060208092817.GA1985@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-02-08 09:30:33 Re: alter superuser...
Previous Message Richard Huxton 2006-02-08 09:26:23 Re: Is there a way to limit CPU usage per user