pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Noah Misch <noah@leadboat.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@postgresql.org
Subject: Re: Re: pgsql: Convert contrib/seg's bool-returning SQL functions to V1 call co
Date: Tue, 26 Apr 2016 19:44:15 -0700
Message-ID: <20160427024415.6mv2dtyifpkv7g6v@alap3.anarazel.de> (raw)
In-Reply-To: <20160427023828.GA2150695@tornado.leadboat.com>
References: <E1atdPs-0005zu-Re@gemulon.postgresql.org>
	<20160427023828.GA2150695@tornado.leadboat.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

On 2016-04-26 22:38:28 -0400, Noah Misch wrote:
> On Fri, Apr 22, 2016 at 03:54:48PM +0000, Tom Lane wrote:
> > Convert contrib/seg's bool-returning SQL functions to V1 call convention.
> > 
> > It appears that we can no longer get away with using V0 call convention
> > for bool-returning functions in newer versions of MSVC.  The compiler
> > seems to generate code that doesn't clear the higher-order bits of the
> > result register, causing the bool result Datum to often read as "true"
> > when "false" was intended.  This is not very surprising, since the
> > function thinks it's returning a bool-width result but fmgr_oldstyle
> > assumes that V0 functions return "char *"; what's surprising is that
> > that hack worked for so long on so many platforms.
> 
> Does this warrant a change to the "Section 2" comment of postgres.h,
> explaining that its precautions no longer suffice everywhere?

I don't understand why we don't just drop V0. It makes debugging harder,
exploitation easier (call arbitrary functions), and really has no
features making it desirable.

Andres


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



view thread (13+ messages)  latest in thread

Message-ID: <20160427024415.6mv2dtyifpkv7g6v@alap3.anarazel.de>
Permalink:  ../20160427024415.6mv2dtyifpkv7g6v@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20160427024415.6mv2dtyifpkv7g6v@alap3.anarazel.de

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, noah@leadboat.com, tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Convert contrib/seg's bool-returning SQL functions to V1 call co
  In-Reply-To: <20160427024415.6mv2dtyifpkv7g6v@alap3.anarazel.de>
  References: <E1atdPs-0005zu-Re@gemulon.postgresql.org> <20160427023828.GA2150695@tornado.leadboat.com> <20160427024415.6mv2dtyifpkv7g6v@alap3.anarazel.de>

* 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