Re: Reinitialize stack base after fork (for the benefit of rr)?

2020-04-05 Thread Peter Geoghegan
On Sun, Apr 5, 2020 at 8:56 PM Andres Freund wrote: > Perhaps put it on a wiki page? I added a new major section to the "getting a stack trace" wiki page:

Re: Reinitialize stack base after fork (for the benefit of rr)?

2020-04-05 Thread Andres Freund
Hi, On 2020-04-05 20:35:50 -0700, Peter Geoghegan wrote: > I have found that it's useful to use rr to debug Postgres by following > certain recipes. I'll share some of the details now, in case anybody > else wants to start using rr and isn't sure where to start. Perhaps put it on a wiki page? >

Re: Reinitialize stack base after fork (for the benefit of rr)?

2020-04-05 Thread Peter Geoghegan
On Sun, Apr 5, 2020 at 6:54 PM Andres Freund wrote: > I just pushed that. Great! I have found that it's useful to use rr to debug Postgres by following certain recipes. I'll share some of the details now, in case anybody else wants to start using rr and isn't sure where to start. I have a

Re: Reinitialize stack base after fork (for the benefit of rr)?

2020-04-05 Thread Andres Freund
On 2020-04-04 21:02:56 -0700, Peter Geoghegan wrote: > On Fri, Mar 27, 2020 at 11:22 AM Andres Freund wrote: > > I've found rr [1] very useful to debug issues in postgres. The ability > > to hit a bug, and then e.g. identify a pointer with problematic > > contents, set a watchpoint on its

Re: Reinitialize stack base after fork (for the benefit of rr)?

2020-04-04 Thread Peter Geoghegan
On Fri, Mar 27, 2020 at 11:22 AM Andres Freund wrote: > I've found rr [1] very useful to debug issues in postgres. The ability > to hit a bug, and then e.g. identify a pointer with problematic > contents, set a watchpoint on its contents, and reverse-continue is > extremely powerful. I agree

Re: Reinitialize stack base after fork (for the benefit of rr)?

2020-03-27 Thread Andres Freund
Hi, On 2020-03-27 14:59:56 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2020-03-27 14:34:56 -0400, Tom Lane wrote: > >> Andres Freund writes: > >>> Tom, while imo not a fix of the right magnitude here: Are you planning / > >>> hoping to work again on your postmaster latch patch? > >

Re: Reinitialize stack base after fork (for the benefit of rr)?

2020-03-27 Thread Tom Lane
Andres Freund writes: > On 2020-03-27 14:34:56 -0400, Tom Lane wrote: >> Andres Freund writes: >>> Tom, while imo not a fix of the right magnitude here: Are you planning / >>> hoping to work again on your postmaster latch patch? >> Um ... -ESWAPPEDOUT. What are you thinking of? >

Re: Reinitialize stack base after fork (for the benefit of rr)?

2020-03-27 Thread Andres Freund
Hi, On 2020-03-27 14:34:56 -0400, Tom Lane wrote: > Andres Freund writes: > > I've locally fixed the issue by computing the stack base address anew > > for postmaster children. Currently in InitPostmasterChild(). > > > I'd like to get that change upstream. The rr hackers have fixed a number > >

Re: Reinitialize stack base after fork (for the benefit of rr)?

2020-03-27 Thread Tom Lane
Andres Freund writes: > I've locally fixed the issue by computing the stack base address anew > for postmaster children. Currently in InitPostmasterChild(). > I'd like to get that change upstream. The rr hackers have fixed a number > of other issues that could be hit with postgres, but they

Reinitialize stack base after fork (for the benefit of rr)?

2020-03-27 Thread Andres Freund
Hi, I've found rr [1] very useful to debug issues in postgres. The ability to hit a bug, and then e.g. identify a pointer with problematic contents, set a watchpoint on its contents, and reverse-continue is extremely powerful. Unfortunately, when running postgres, it currently occasionally