Re: LWLock deadlock and gdb advice - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: LWLock deadlock and gdb advice
Date
Msg-id CAM3SWZQYxY2_gWYog4Er8Sk1YLFdDQeWJ7PNCy2_2fVNg2gBsw@mail.gmail.com
Whole thread Raw
In response to LWLock deadlock and gdb advice  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: LWLock deadlock and gdb advice  (Amit Kapila <amit.kapila16@gmail.com>)
Re: LWLock deadlock and gdb advice  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-hackers
On Mon, Jun 29, 2015 at 5:37 PM, Jeff Janes <jeff.janes@gmail.com> wrote:
> Is there a way to use gdb to figure out who holds the lock they are waiting
> for?

Have you considered building with LWLOCK_STATS defined, and LOCK_DEBUG
defined? That might do it.

Otherwise, I suggest dereferencing the "l" argument to
LWLockAcquireWithVar() or something -- set the frame to "3" in your
example backtrace, using "f 3". Then, "p *l". You'll get the tranche
id there, and so on.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: LWLock deadlock and gdb advice
Next
From: Robert Haas
Date:
Subject: Re: anole: assorted stability problems