Обсуждение: Recently-introduced segfault in initdb?

Поиск
Список
Период
Сортировка

Recently-introduced segfault in initdb?

От
Isaac Morland
Дата:
I am trying to develop a small proof-of-concept patch for a proposal I have, but recently I found that initdb started segfaulting after I did a git pull. I used git bisect and it identified the following commit as the first one with the problem:

1733460f0205fc6d6bbe4c14911049a918c6e073 is the first bad commit

commit 1733460f0205fc6d6bbe4c14911049a918c6e073

Author: Robert Haas <rhaas@postgresql.org>

Date:   Fri Mar 2 13:16:01 2018 -0500


    postgres_fdw: Fourth attempt to stabilize regression tests.

    

    Commit 1bc0100d270e5bcc980a0629b8726a32a497e788 added this test, and

    commits 882ea509fe7a4711fe25463427a33262b873dfa1,

    958e20e42d6c346ab89f6c72e4262230161d1663,

    4fa396464e5fe238b7994535182f28318c61c78e tried to stabilize it.  It's

    still not stable, so keep trying.

    

    The latest comment from Tom Lane is that disabling autovacuum seems

    like a good strategy, but we might need to do it on more tables, hence

    this patch.

    

    Etsuro Fujita

    

    Discussion: http://postgr.es/m/5A9928F1.2010206@lab.ntt.co.jp


:040000 040000 97d2b695bc44dd6c50ccc2c73e626ae453507299 c3e23dd08d4f9d0576401d63e375cbb3460e2d33 M contrib

bisect run success

01:01 ijmorlan@scsmac161$ 


I'm not particularly confident I've done this right but if anybody else is having trouble with systems compiled from recent commits this might be a starting point to look at.

Incidentally I'm working on Mac OS X 10.11.6 in case that's helpful.

And I just looked at the commit and as far as I can tell it only affects tests, which shouldn't affect whether initdb segfaults, which makes me think I've done something wrong.

So is anybody else finding that initdb segfaults with a newly-compiled system?

Re: Recently-introduced segfault in initdb?

От
Isaac Morland
Дата:
OK, I must have done something wrong with the bisect the first time. Now I'm getting the following as the problem commit:

fd1a421fe66173fb9b85d3fe150afde8e812cbe4 is the first bad commit

commit fd1a421fe66173fb9b85d3fe150afde8e812cbe4

Author: Peter Eisentraut <peter_e@gmx.net>

Date:   Fri Mar 2 08:57:38 2018 -0500


    Add prokind column, replacing proisagg and proiswindow

    

    The new column distinguishes normal functions, procedures, aggregates,

    and window functions.  This replaces the existing columns proisagg and

    proiswindow, and replaces the convention that procedures are indicated

    by prorettype == 0.  Also change prorettype to be VOIDOID for procedures.

    

    Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>

    Reviewed-by: Michael Paquier <michael@paquier.xyz>


:040000 040000 43854d518b5fdb6b36b6cc5d1f625f75f6b1974c 96aefd013c0ccf730e69a2a3611de9ab4f12294d M doc

:040000 040000 5f0e806094bdeb8e14ddf098ec7c318f574ec548 2916aea3ab2049c0317d5edd788968c167aecfde M src

bisect run success

01:52 ijmorlan@scsmac161$ 


When it's not working, I get the following output from initdb:

The files belonging to this database system will be owned by user "ijmorlan".

This user must also own the server process.


The database cluster will be initialized with locale "C".

The default text search configuration will be set to "english".


Data page checksums are enabled.


creating directory ./test/pgdata ... ok

creating subdirectories ... ok

selecting default max_connections ... 100

selecting default shared_buffers ... 128MB

selecting dynamic shared memory implementation ... posix

creating configuration files ... ok

running bootstrap script ... ok

performing post-bootstrap initialization ... TRAP: FailedAssertion("!(!isNull)", File: "catcache.c", Line: 365)

sh: line 1: 45094 Abort trap: 6           "/usr/local/pgsql/bin/postgres" --single -F -O -j -c search_path=pg_catalog -c exit_on_error=true template1 > /dev/null

child process exited with exit code 134

initdb: removing data directory "./test/pgdata"


I hope this is more helpful.

On 18 March 2018 at 01:08, Isaac Morland <isaac.morland@gmail.com> wrote:
I am trying to develop a small proof-of-concept patch for a proposal I have, but recently I found that initdb started segfaulting after I did a git pull. I used git bisect and it identified the following commit as the first one with the problem:
[....] 

Re: Recently-introduced segfault in initdb?

От
Alvaro Herrera
Дата:
Isaac Morland wrote:
> OK, I must have done something wrong with the bisect the first time. Now
> I'm getting the following as the problem commit:
> 
> fd1a421fe66173fb9b85d3fe150afde8e812cbe4 is the first bad commit

Did you run "make distclean" before git-pulling?  If not, maybe what you
have is an incomplete rebuild after the code update.  Unless you have
--enable-depend in your configure line ...?


-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: Recently-introduced segfault in initdb?

От
Isaac Morland
Дата:
On 18 March 2018 at 05:57, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
Isaac Morland wrote:
> OK, I must have done something wrong with the bisect the first time. Now
> I'm getting the following as the problem commit:
>
> fd1a421fe66173fb9b85d3fe150afde8e812cbe4 is the first bad commit

Did you run "make distclean" before git-pulling?  If not, maybe what you
have is an incomplete rebuild after the code update.  Unless you have
--enable-depend in your configure line ...?

Thank you, and sorry everybody for the noise. Yes, I just did a "make distclean" and then the build worked. Which still leaves the question of why some commits work and others don't, but some mysteries just aren't worth figuring out. I actually remember reading about distclean but didn't think of it when I actually ran into the problem. Thanks again.

Re: Recently-introduced segfault in initdb?

От
Tom Lane
Дата:
Isaac Morland <isaac.morland@gmail.com> writes:
> Thank you, and sorry everybody for the noise. Yes, I just did a "make
> distclean" and then the build worked.

Yeah, this is something most of us have learned the hard way over
time ;-).  Either use --enable-depend, or religiously do "make
distclean" before any git pull, git bisect, etc.  I prefer the
latter because it avoids leaving junk files laying around, such
as .o files that should exist in one version but not another;
but if you're less annoyed by that sort of thing than I am,
--enable-depend is a good alternative.

In any case, using ccache is recommendable if your platform doesn't
already set you up to use that automatically.  Also, if you choose
the "make distclean" approach, you're going to be re-running
configure a lot, so it's good to use --cache-file with that.
These together with "make -j" will get the rebuild time down to
maybe 15 seconds on modern hardware.

            regards, tom lane