pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Avoid orphaned objects dependencies, take 3
Date: Mon, 22 Apr 2024 15:00:00 +0300
Message-ID: <a0e850b9-31c6-86cd-351d-6b8a7a1d6bf7@gmail.com> (raw)
In-Reply-To: <ZiZBZSgWuSC0C1RJ@ip-10-97-1-34.eu-west-3.compute.internal>
References: <ZiYjn0eVc7pxVY45@ip-10-97-1-34.eu-west-3.compute.internal>
	<b206ef05-275d-7306-9ee2-ece738beb371@gmail.com>
	<ZiZBZSgWuSC0C1RJ@ip-10-97-1-34.eu-west-3.compute.internal>

22.04.2024 13:52, Bertrand Drouvot wrote:
>
> That's weird, I just launched it several times with the patch applied and I'm not
> able to see the seg fault (while I can see it constently failing on the master
> branch).
>
> Are you 100% sure you tested it against a binary with the patch applied?
>

Yes, at least I can't see what I'm doing wrong. Please try my
self-contained script attached.

Best regards,
Alexander
#!/bin/bash

git reset --hard HEAD; git clean -dfx >/dev/null
wget https://www.postgresql.org/message-id/attachment/159685/v1-0001-Avoid-orphaned-objects-dependencies....
git apply v1-0001-Avoid-orphaned-objects-dependencies.patch || exit 1
CPPFLAGS="-Og" ./configure --enable-debug --enable-cassert -q && make -j8 -s && TESTS="test_setup" make -s check-tests

PGROOT=`pwd`/tmp_install
export PGDATA=`pwd`/tmpdb

export PATH="$PGROOT/usr/local/pgsql/bin:$PATH"
export LD_LIBRARY_PATH="$PGROOT/usr/local/pgsql/lib"

initdb >initdb.log 2>&1

export PGPORT=55432
echo "
port=$PGPORT
fsync = off
" > $PGDATA/postgresql.auto.conf

pg_ctl -l server.log start
export PGDATABASE=regression

createdb regression

for ((i=1;i<=300;i++)); do
  ( { for ((n=1;n<=20;n++)); do echo "DROP SCHEMA s;"; done } | psql ) >psql1.log 2>&1 & 
  echo "
CREATE SCHEMA s;
CREATE FUNCTION s.func1() RETURNS int LANGUAGE SQL AS 'SELECT 1;';
CREATE FUNCTION s.func2() RETURNS int LANGUAGE SQL AS 'SELECT 2;';
CREATE FUNCTION s.func3() RETURNS int LANGUAGE SQL AS 'SELECT 3;';
CREATE FUNCTION s.func4() RETURNS int LANGUAGE SQL AS 'SELECT 4;';
CREATE FUNCTION s.func5() RETURNS int LANGUAGE SQL AS 'SELECT 5;';
  "  | psql >psql2.log 2>&1 &
  wait
  psql -c "DROP SCHEMA s CASCADE" >psql3.log
done
echo "
SELECT pg_identify_object('pg_proc'::regclass, pp.oid, 0), pp.oid FROM pg_proc pp
  LEFT JOIN pg_namespace pn ON pp.pronamespace = pn.oid WHERE pn.oid IS NULL" | psql

pg_ctl -w -t 5 -D "$PGDATA" stop


Attachments:

  [text/plain] repro-17182.sh.txt (1.4K, ../a0e850b9-31c6-86cd-351d-6b8a7a1d6bf7@gmail.com/2-repro-17182.sh.txt)
  download | inline:
#!/bin/bash

git reset --hard HEAD; git clean -dfx >/dev/null
wget https://www.postgresql.org/message-id/attachment/159685/v1-0001-Avoid-orphaned-objects-dependencies.patch
git apply v1-0001-Avoid-orphaned-objects-dependencies.patch || exit 1
CPPFLAGS="-Og" ./configure --enable-debug --enable-cassert -q && make -j8 -s && TESTS="test_setup" make -s check-tests

PGROOT=`pwd`/tmp_install
export PGDATA=`pwd`/tmpdb

export PATH="$PGROOT/usr/local/pgsql/bin:$PATH"
export LD_LIBRARY_PATH="$PGROOT/usr/local/pgsql/lib"

initdb >initdb.log 2>&1

export PGPORT=55432
echo "
port=$PGPORT
fsync = off
" > $PGDATA/postgresql.auto.conf

pg_ctl -l server.log start
export PGDATABASE=regression

createdb regression

for ((i=1;i<=300;i++)); do
  ( { for ((n=1;n<=20;n++)); do echo "DROP SCHEMA s;"; done } | psql ) >psql1.log 2>&1 & 
  echo "
CREATE SCHEMA s;
CREATE FUNCTION s.func1() RETURNS int LANGUAGE SQL AS 'SELECT 1;';
CREATE FUNCTION s.func2() RETURNS int LANGUAGE SQL AS 'SELECT 2;';
CREATE FUNCTION s.func3() RETURNS int LANGUAGE SQL AS 'SELECT 3;';
CREATE FUNCTION s.func4() RETURNS int LANGUAGE SQL AS 'SELECT 4;';
CREATE FUNCTION s.func5() RETURNS int LANGUAGE SQL AS 'SELECT 5;';
  "  | psql >psql2.log 2>&1 &
  wait
  psql -c "DROP SCHEMA s CASCADE" >psql3.log
done
echo "
SELECT pg_identify_object('pg_proc'::regclass, pp.oid, 0), pp.oid FROM pg_proc pp
  LEFT JOIN pg_namespace pn ON pp.pronamespace = pn.oid WHERE pn.oid IS NULL" | psql

pg_ctl -w -t 5 -D "$PGDATA" stop

view thread (93+ messages)  latest in thread

Message-ID: <a0e850b9-31c6-86cd-351d-6b8a7a1d6bf7@gmail.com>
Permalink:  ../a0e850b9-31c6-86cd-351d-6b8a7a1d6bf7@gmail.com/
Also on:    postgresql.org/message-id/a0e850b9-31c6-86cd-351d-6b8a7a1d6bf7@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: exclusion@gmail.com, bertranddrouvot.pg@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Avoid orphaned objects dependencies, take 3
  In-Reply-To: <a0e850b9-31c6-86cd-351d-6b8a7a1d6bf7@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox