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

From Jeff Janes
Subject Re: LWLock deadlock and gdb advice
Date
Msg-id CAMkU=1wL4WDyNmBLrmztdhpmgjMM_CPAStcxbtAOvk+Q16sy5g@mail.gmail.com
Whole thread Raw
In response to Re: LWLock deadlock and gdb advice  (Peter Geoghegan <pg@heroku.com>)
Responses Re: LWLock deadlock and gdb advice  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-hackers
On Mon, Jun 29, 2015 at 5:55 PM, Peter Geoghegan <pg@heroku.com> wrote:
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.

I hadn't planned on running into this problem, so had not compiled accordingly.  

I thought LOCK_DEBUG would produce too much output, but now I see it doesn't print anything unless Trace_lwlocks is on (but it still makes more info available to gdb, as Amit mentioned), so I think that should be OK.  

Since I messed up the gdb session causing the postmaster to SIGKILL all the children and destroy the evidence, I'll repeat the run compiled with LOCK_DEBUG and see what it looks like in the morning.

Thanks,

Jeff
 

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Reduce ProcArrayLock contention
Next
From: Amit Kapila
Date:
Subject: Re: Reduce ProcArrayLock contention