Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVHS2-000649-E6 for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Aug 2016 12:08:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bVHS1-0002a5-SC for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Aug 2016 12:08:37 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bVHS1-0002Zy-8V for pgsql-hackers@postgresql.org; Thu, 04 Aug 2016 12:08:37 +0000 Received: from newmail.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVHRw-0003fK-B4 for pgsql-hackers@postgresql.org; Thu, 04 Aug 2016 12:08:36 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id A965421C295D for ; Thu, 4 Aug 2016 15:08:31 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Received: from mail.postgrespro.ru ([127.0.0.1]) by localhost (mail.postgrespro.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id atI2_l-ebXEN for ; Thu, 4 Aug 2016 15:08:31 +0300 (MSK) Received: from localhost (unknown [192.168.27.1]) by mail.postgrespro.ru (Postfix) with ESMTPSA id 8029C21C294E for ; Thu, 4 Aug 2016 15:08:31 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1470312511; bh=qoAMSAvK0IkTjxqqUrjq17X5lufyPV13JnUf0CsWv88=; h=From:To:Subject:Date:In-Reply-To:References; b=KamkQLRD9MMt5DkrAmjSNLMKdwZQ1de07EAtLtmjfgqoUXo8D/L4vk4QGK6B0PDTh XiPJ/9yZvPQ1K+i12Bu5t+C9XRymto7WOLYy6CSS4NhrvH4sETKdy4Sc2svx0x7Snk LZ2RkAYHyMrdwmSdUY1o4VhvyQSJvTw9rVmlz4ZM= From: Yury Zhuravlev To: Subject: Re: Bug in WaitForBackgroundWorkerShutdown() =?iso-8859-1?Q?[REL9=5F5=5FSTABLE]?= Date: Thu, 04 Aug 2016 15:08:13 +0300 MIME-Version: 1.0 Message-ID: <8629a08e-f3e0-4caa-9478-d85a454f656c@postgrespro.ru> In-Reply-To: <1996641.25QjV5kv6m@abook> References: <1637882.WfYN5gPf1A@abook> <1996641.25QjV5kv6m@abook> Organization: postgrespro User-Agent: Trojita/v0.6-216-g795fa33; Qt/5.6.1; xcb; Linux; Gentoo Base System release 2.2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Dmitry Ivanov wrote: >> Recently I've encountered a strange crash while calling elog(ERROR, "...= ") >> after the WaitForBackgroundWorkerShutdown() function. It turns out that >> _returns_ inside the PG_TRY()..PG_CATCH() block are *highly* undesirable, >> since they leave PG_exception_stack pointing to a local struct in a dead >> frame, which is an obvious UB. I've attached a patch which fixes this >> behavior in the aforementioned function, but there might be more errors >> like that elsewhere. > > Forgot some curly braces, my bad. v2 attached. > Good catch. But in 9.6 it has been fixed by=20 db0f6cad4884bd4c835156d3a720d9a79dbd63a9 commit.=20 --=20 Yury Zhuravlev Postgres Professional: http://www.postgrespro.com The Russian Postgres Company --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers