pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: emre@hasegeli.com, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ning Yu <nyu@pivotal.io>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: New Defects reported by Coverity Scan for PostgreSQL
Date: Thu, 2 Aug 2018 11:43:45 +0200
Message-ID: <611f2223-cf96-b26b-a58e-f8b76b156780@2ndquadrant.com> (raw)
In-Reply-To: <CAE2gYzyut4=O4qLwY+AkabB7Gm=rkwODr3_9kkAqx9WCFLzfcg@mail.gmail.com>
References: <E1fjZo1-00019i-GG@gemulon.postgresql.org>
	<20180731172149.kdjl3xdjjtwxaj4s@alvherre.pgsql>
	<CAKmaiL2o6584gLFP=6YX-MUqmvOiT==uny+LA8z3=uAnriuzXA@mail.gmail.com>
	<26769.1533090136@sss.pgh.pa.us>
	<CAE2gYzw6iD1YTZ+67hA=s3AG5sbLCsGkHRYQ_Z1Kd+vhiM7ecA@mail.gmail.com>
	<5fece6c5-6a80-9694-1a24-3ae245ae2cba@2ndquadrant.com>
	<26723.1533131824@sss.pgh.pa.us>
	<CAE2gYzyut4=O4qLwY+AkabB7Gm=rkwODr3_9kkAqx9WCFLzfcg@mail.gmail.com>



On 08/01/2018 04:07 PM, Emre Hasegeli wrote:
>> I think there are three different things that need to be addressed:
>>
>> * Underspecified comments.
> 
> I agree.  My patch added comments, the next one with actual fixes adds
> more.  I just didn't want to invest even more time on them while the
> code is its current shape.
> 
>> * The function names and argument names are badly chosen IMO, because even
>> granted a convention such as the above, it's not very obvious what roles
>> "l1" and "l2" play.  I'm not exactly sure what would be better, but if you
>> used names like "ofseg" and "otherseg" you'd at least be trying.  I'd go
>> with an asymmetrical function name too, to make miswriting of calls less
>> likely.
> 
> Good idea.  I haven't though about that, but now such names makes more
> sense to me.  I will prepare another patch to improve the naming and
> comments to be applied on top of my current patches.
> 
>> * And lastly, are we sure there aren't actual *bugs* here?  I'd initially
>> supposed that lseg_closept_lseg acted as Emre says above, but reading the
>> code makes me think it's the other way around.  Its first two potential
>> assignments to *result are definitely assigning points on l2 not l1.
> 
> Yes, it is wrong beyond understanding.  The committed patch intended
> to keep answers as they were.  The next one actually fixes those.
> 

OK, so I think we should not do anything about the issues reported by 
coverity until we commit all the patches. Which may resolve some of 
those (pre-existing) issues, for example.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (13+ messages)  latest in thread

Message-ID: <611f2223-cf96-b26b-a58e-f8b76b156780@2ndquadrant.com>
Permalink:  ../611f2223-cf96-b26b-a58e-f8b76b156780@2ndquadrant.com/
Also on:    postgresql.org/message-id/611f2223-cf96-b26b-a58e-f8b76b156780@2ndquadrant.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-committers@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, tgl@sss.pgh.pa.us, nyu@pivotal.io, alvherre@2ndquadrant.com, pgsql-hackers@postgresql.org
  Subject: Re: New Defects reported by Coverity Scan for PostgreSQL
  In-Reply-To: <611f2223-cf96-b26b-a58e-f8b76b156780@2ndquadrant.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