Re: [BUG] Possible occurrence of segfault in ecpg test - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [BUG] Possible occurrence of segfault in ecpg test
Date
Msg-id 524527.1733950832@sss.pgh.pa.us
Whole thread Raw
List pgsql-hackers
Daniil Davydov <3danissimo@gmail.com> writes:
> Thus, if the program behaves in an unexpected way and the transaction
> is aborted before it executes the
> "select data1 into :recv_vlen_buf from test" query, dump_binary will
> refer to a null pointer. So, instead of an error
> message, the user will see a segfault.

> I think that in all such cases it is worth adding some checks into
> .pgc and .c files (like in attached patch)

I cannot get excited about changing this.  In the first place,
this is hardly the only conceivable failure here --- for example,
if the query succeeds but returns only one row, the code still
segfaults.  In the second place, this is just test code and any
sort of failure is as good as any other in terms of calling our
attention to a problem.  In the third place, if we did want to
improve our standard of robustness for the ECPG tests, there are
probably many other places in them with similar issues.  Making
that happen seems like a lot of work for little return.  So I'm
inclined to just leave it alone.

            regards, tom lane



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Proposals for EXPLAIN: rename ANALYZE to EXECUTE and extend VERBOSE
Next
From: Daniel Gustafsson
Date:
Subject: Re: VACUUM cleaning of CF 2024-11