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 1gkoJW-0000bG-OO for pgsql-bugs@arkaria.postgresql.org; Sat, 19 Jan 2019 10:57:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gkoJU-0002JP-Ll for pgsql-bugs@arkaria.postgresql.org; Sat, 19 Jan 2019 10:57:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gkoJU-0002FI-Ct for pgsql-bugs@lists.postgresql.org; Sat, 19 Jan 2019 10:57:20 +0000 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gkoJT-0004bT-0F for pgsql-bugs@lists.postgresql.org; Sat, 19 Jan 2019 10:57:20 +0000 Received: by mail-lf1-x143.google.com with SMTP id c16so12305253lfj.8 for ; Sat, 19 Jan 2019 02:57:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=ZblN9Z/CWHsjNDuELQvyLEONSZ5ARKpcsgSlTqj92hc=; b=bGF2bGj4uuEI6pqZuw4fzASJC07UrHZZhAP8AnXFn0wgCn+HxJUnhroKcWx0GwHS2w Y3MvXxpg7RoziDNDZzfDTbzhaLif4Bmu6dUJwcDpFOCZfBUep7vo9Sz3SzmzKAn1Gwun dRltyuwL9LHQfHRr1QuLMTlhtygWPI+BPHGJSO7Su3IFvT2mhRpOGqfYwKt2TRNquGRG ITKTlSdVhxDgjFZRKNwAFIvVdcwDK7e5kLv6RA8L00xd+izfrqJu1L/cJ5LDYyehlvRW iWDf1ZN56DKtT+qT4FgoWZpiUc7Cdk8akEpU15m6qdlh7zCIWkQcBGQ6O/Kbh7GII+lg bs6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=ZblN9Z/CWHsjNDuELQvyLEONSZ5ARKpcsgSlTqj92hc=; b=gmlYHJgpGjbModuPEqYN97QjYxZ2dC7ihPKkyt1qMWGHpr14vFhGhEKp7e9Y1+oW20 OenBAtHAQ5fwsyN5PV/hiMEOTCdK2fNmVDnPY8LC1B6WyMzTQufUhlDWOJ5LrJZ9Nfs4 pxNQPli2q99NcailKlS1iHJqiOB2vmIFgDsh07O7F6BFqfGlDysbxnu38MTT/lLDK+jm 7p0YmwYHFf5YuZ8zZBq2+ZeUQJ/JtorKbErsizMseUI7pKxcWeUhPhwHX57lKeCzUqMU B16M0MriO0cm7BwybiURDh0olLrRrluIzu17TZKxHDQHU22JRtvCrI0fhPsX2QJqUqjm 7lZg== X-Gm-Message-State: AJcUukekbApGZZQXFInc8YdGsJuz3gOV63dkDdqfmwsEmF3i02AclHMh ptO2PU1oGCEpuJ+2nW285HXneCM9 X-Google-Smtp-Source: ALg8bN4W5SpgxeBXfaVVk3XB/eLPTr5Es3DYjPyib4mQl4wFT6NUl8bz+//36c0L/SQqhoFGd/0Zqw== X-Received: by 2002:a19:d242:: with SMTP id j63mr15284092lfg.26.1547895436787; Sat, 19 Jan 2019 02:57:16 -0800 (PST) Received: from [1.0.0.7] ([178.155.4.147]) by smtp.gmail.com with ESMTPSA id b22sm1244417lfg.32.2019.01.19.02.57.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Jan 2019 02:57:16 -0800 (PST) Subject: Re: BUG #15599: Segfault at MakeExpandedObjectReadOnlyInternal To: Andrew Gierth , pgsql-bugs@lists.postgresql.org References: <15599-70ca6ed4587ab793@postgresql.org> <87pnstgde6.fsf@news-spur.riddles.org.uk> From: Alexander Lakhin Message-ID: Date: Sat, 19 Jan 2019 13:57:15 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <87pnstgde6.fsf@news-spur.riddles.org.uk> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: ru-RU List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 19.01.2019 13:20, Andrew Gierth wrote: > 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. Hello Andrew, Thank you for the explanation. I will take this into account. Best regards, Alexander