Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gknkc-0007RO-HZ for pgsql-bugs@arkaria.postgresql.org; Sat, 19 Jan 2019 10:21:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gknjb-0001XZ-Av for pgsql-bugs@arkaria.postgresql.org; Sat, 19 Jan 2019 10:20:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gknjb-0001XS-1F for pgsql-bugs@lists.postgresql.org; Sat, 19 Jan 2019 10:20:15 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gknjX-0007z6-PT for pgsql-bugs@lists.postgresql.org; Sat, 19 Jan 2019 10:20:13 +0000 Received: from [192.168.127.1] (port=18864 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1gknjT-000Ax9-Gk; Sat, 19 Jan 2019 10:20:07 +0000 Received: from [127.0.0.1] (port=51564 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1gknjS-0003wx-LN; Sat, 19 Jan 2019 10:20:06 +0000 From: Andrew Gierth To: pgsql-bugs@lists.postgresql.org, exclusion@gmail.com Subject: Re: BUG #15599: Segfault at MakeExpandedObjectReadOnlyInternal In-Reply-To: <15599-70ca6ed4587ab793@postgresql.org> (PG Bug reporting form's message of "Sat, 19 Jan 2019 08:58:13 +0000") Message-ID: <87pnstgde6.fsf@news-spur.riddles.org.uk> References: <15599-70ca6ed4587ab793@postgresql.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Sat, 19 Jan 2019 10:20:05 +0000 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "PG" == PG Bug reporting form writes: PG> Bug reference: 15599 PG> Logged by: Alexander Lakhin PG> Email address: exclusion@gmail.com PG> PostgreSQL version: 11.1 PG> Operating system: Ubuntu 18.04 PG> Description: PG> The PostgreSQL server crashes with the following query (excerpt PG> from regression test, run it after `make check`): Not a bug. PG> CREATE FUNCTION overpaid(emp) PG> RETURNS hobbies_r PG> AS '/src/postgres/src/test/regress/regress.so' PG> LANGUAGE C STRICT; "overpaid" in regress.so returns a boolean scalar, not a row of any kind. It is the responsibility of the person issuing CREATE FUNCTION for a C-language function to get the types right; if they are wrong, it can (as you observed) crash the server, which is why this action is restricted to database superusers. -- Andrew (irc:RhodiumToad)