Uniforms the errors msgs at tuplestore paths

2022-02-20 Thread Ranier Vilela
appropriately. The error about materialize mode required, is missed. -At pl_exec.c The error mgs do not report about the materialize mode -At pltcl.c: The function pltcl_init_tuple_store does not check rsi appropriately. Patch attached. regards, Ranier Vilela v1-0001-uniform-error-msgs

Re: Uniforms the errors msgs at tuplestore paths

2022-02-20 Thread Ranier Vilela
Em dom., 20 de fev. de 2022 às 11:30, Justin Pryzby escreveu: > On Sun, Feb 20, 2022 at 11:12:42AM -0300, Ranier Vilela wrote: > > Like how the commit > > > https://github.com/postgres/postgres/commit/07daca53bfcad59618a9c6fad304e380cc9d2bc1 > > The are some paths that

Re: Uniforms the errors msgs at tuplestore paths

2022-02-20 Thread Ranier Vilela
Em dom., 20 de fev. de 2022 às 22:08, Michael Paquier escreveu: > On Sun, Feb 20, 2022 at 11:37:33AM -0300, Ranier Vilela wrote: > > I can't see: > > plperl.c > > pl_exec.c > > pttcl.c > > > > Only jsonfuncs.c, but the error about "materialize

Re: Uniforms the errors msgs at tuplestore paths

2022-02-24 Thread Ranier Vilela
Em dom., 20 de fev. de 2022 às 22:45, Ranier Vilela escreveu: > Em dom., 20 de fev. de 2022 às 22:08, Michael Paquier > escreveu: > >> On Sun, Feb 20, 2022 at 11:37:33AM -0300, Ranier Vilela wrote: >> > I can't see: >> > plperl.c >> > pl_exec.c &

Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)

2021-02-12 Thread Ranier Vilela
Em sex., 12 de fev. de 2021 às 03:56, Kyotaro Horiguchi < horikyota@gmail.com> escreveu: > At Wed, 10 Feb 2021 20:12:38 -0300, Ranier Vilela > wrote in > > Hi, > > > > Per Coverity. > > > > If xid is a subtransaction, the setup of base snapshot on

Re: Possible dereference after null check (src/backend/executor/ExecUtils.c)

2021-02-12 Thread Ranier Vilela
Em sex., 12 de fev. de 2021 às 03:28, Kyotaro Horiguchi < horikyota@gmail.com> escreveu: > At Wed, 10 Feb 2021 19:54:46 -0300, Ranier Vilela > wrote in > > Hi, > > > > Per Coverity. > > > > The functions ExecGetInsertedCols and ExecGetUpdatedCols a

Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)

2021-02-13 Thread Ranier Vilela
he caller can act accordingly. 2. SnapBuildCommitTxn can't ignore a result from ReorderBufferSetBaseSnapshot, even if it never fails. regards, Ranier Vilela reorderbuffer.patch Description: Binary data

Re: pg_cryptohash_final possible out-of-bounds access (per Coverity)

2021-02-13 Thread Ranier Vilela
;manifest_ctx, checksumbuf, > + PG_SHA256_DIGEST_LENGTH) < 0) > Here this could just use sizeof(checksumbuf)? This pattern could be > used elsewhere as well, like in md5_common.c. > Done. Attached a v4 of patch. regards, Ranier Vilela pg_cryptohash_v4.patch Description: Binary data

Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)

2021-02-13 Thread Ranier Vilela
Em sáb., 13 de fev. de 2021 às 17:35, Ranier Vilela escreveu: > > Em sáb., 13 de fev. de 2021 às 01:07, Zhihong Yu > escreveu: > >> Hi, >> How about the following patch ? >> >> ReorderBufferSetBaseSnapshot() can return a bool to indicate whether the >&

Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)

2021-02-13 Thread Ranier Vilela
."))); > > Did you mean this errdetail: > > Top transaction is not running. > Done. Thanks Zhihong. v3 based on your patch, attached. regards, Ranier Vilela reorderbuffer_v3.patch Description: Binary data

Re: pg_cryptohash_final possible out-of-bounds access (per Coverity)

2021-02-13 Thread Ranier Vilela
Em sáb., 13 de fev. de 2021 às 20:32, Michael Paquier escreveu: > On Sat, Feb 13, 2021 at 05:37:32PM -0300, Ranier Vilela wrote: > > IMO there is no necessity in back-patching. > > You are missing the point here. What you are proposing here would not > be backpatched. However

Re: pg_cryptohash_final possible out-of-bounds access (per Coverity)

2021-02-14 Thread Ranier Vilela
Em dom., 14 de fev. de 2021 às 08:22, Michael Paquier escreveu: > On Sat, Feb 13, 2021 at 09:33:48PM -0300, Ranier Vilela wrote: > > Em sáb., 13 de fev. de 2021 às 20:32, Michael Paquier < > mich...@paquier.xyz> > > escreveu: > > > >> You are missing the p

Re: pg_cryptohash_final possible out-of-bounds access (per Coverity)

2021-02-15 Thread Ranier Vilela
Em dom., 14 de fev. de 2021 às 22:28, Michael Paquier escreveu: > On Sun, Feb 14, 2021 at 11:39:47AM -0300, Ranier Vilela wrote: > > What do you think? > > That's not a good idea for two reasons: > 1) There is CRC32 to worry about, which relies on a different logic. >

Re: Possible dereference after null check (src/backend/executor/ExecUtils.c)

2021-02-15 Thread Ranier Vilela
Em sex., 12 de fev. de 2021 às 13:11, Ranier Vilela escreveu: > Em sex., 12 de fev. de 2021 às 03:28, Kyotaro Horiguchi < > horikyota@gmail.com> escreveu: > >> At Wed, 10 Feb 2021 19:54:46 -0300, Ranier Vilela >> wrote in >> > Hi, >> &g

Re: Permission failures with WAL files in 13~ on Windows

2021-03-16 Thread Ranier Vilela
chine, Postgres can rename statistics files. regards, Ranier Vilela 1. https://www.postgresql.org/message-id/20200616041018.GR20404%40telsasoft.com fix_windows_rename.patch Description: Binary data

re: crash during cascaded foreign key update

2021-03-16 Thread Ranier Vilela
kmode=0x7ffe6f236dec) at heapam.c:3560 I have this report from one static analysis tool: heapam.c (9379): Dereferencing of a potential null pointer 'oldtup.t_data' regards, Ranier Vilela

Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-10-31 Thread Ranier Vilela
Hi, Per Coverity. If test set->latch against NULL, is why it can be NULL. ResetEvent can dereference NULL. regards, Ranier Vilela fix_dereference_before_null_check_latch.patch Description: Binary data

Explicit NULL dereference (src/backend/utils/adt/ruleutils.c)

2020-10-31 Thread Ranier Vilela
ot; cannot be either. Solution proposed merely as a learning experience. regards, Ranier Vilela fix_explicit_null_dereference_ruleutils.patch Description: Binary data

Re: Explicit NULL dereference (src/backend/utils/adt/ruleutils.c)

2020-11-02 Thread Ranier Vilela
taches does..). > I think that Assert is not the right solution here. For a function that returns NULL twice (SPI_getvalue), it is worth testing the result against NULL. In the future, any modification may cause further dereference. In addition, the static analysis tools would continue to note this snippet either as a bug or as a suspect. Checking "actions" pointer against NULL, and acting appropriately would do. regards, Ranier Vilela

Re: Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-11-02 Thread Ranier Vilela
> On Mon, Nov 2, 2020 at 1:49 PM Kyotaro Horiguchi > > > wrote: > > > > At Sat, 31 Oct 2020 11:40:53 -0300, Ranier Vilela < > ranier...@gmail.com> wrote in > > > > > Per Coverity. > > > > > > > > > > If test set->latch aga

Re: Dereference before NULL check (src/backend/storage/ipc/latch.c)

2020-11-04 Thread Ranier Vilela
d even if we > are not waiting on it. > > If we call WaitLatch(OrSocket) that waits on the latch, it immediately > returns because the latch is set. If we called ResetLatch before the > next call to WaitLatch(), it correctly waits on a trigger to be > pulled. > +1 The patch for me is syntactically equal to the code changed and avoids the dereference. regards, Ranier Vilela

re: pgbench stopped supporting large number of client connections on Windows

2020-11-06 Thread Ranier Vilela
t;too many client connections for select()"); >exit(1); >} It seems to me that the limit is hardcode in, src/backend/port/win32/socket.c FD_SETSIZE * 2 that would be 2048? regards, Ranier Vilela

Re: pgbench stopped supporting large number of client connections on Windows

2020-11-07 Thread Ranier Vilela
Em sáb., 7 de nov. de 2020 às 14:55, Marina Polyakova < m.polyak...@postgrespro.ru> escreveu: > On 2020-11-06 23:54, Ranier Vilela wrote: > > Hi Marina, > > Hello! > > 1) If you mean the function pgwin32_select in the file > src/backend/port/win32/socket.c, IIUC

Re: Windows regress fails (latest HEAD)

2020-11-10 Thread Ranier Vilela
Em ter., 10 de nov. de 2020 às 14:16, Russell Foster < russell.foster.cod...@gmail.com> escreveu: > On Tue, Nov 10, 2020 at 12:03 PM Ranier Vilela > wrote: > > > > Em sex., 26 de jun. de 2020 às 08:21, Ranier Vilela > escreveu: > >> > >> Em qui

pg_cryptohash_final possible out-of-bounds access (per Coverity)

2021-02-09 Thread Ranier Vilela
regards, Ranier Vilela pg_cryptohash.patch Description: Binary data

Re: pg_cryptohash_final possible out-of-bounds access (per Coverity)

2021-02-10 Thread Ranier Vilela
Em qua., 10 de fev. de 2021 às 01:44, Kyotaro Horiguchi < horikyota@gmail.com> escreveu: > At Tue, 9 Feb 2021 22:01:45 -0300, Ranier Vilela > wrote in > > Hi Hackers, > > > > Per Coverity. > > > > Coverity complaints about pg_cryptohash_final funct

Possible dereference after null check (src/backend/executor/ExecUtils.c)

2021-02-10 Thread Ranier Vilela
Hi, Per Coverity. The functions ExecGetInsertedCols and ExecGetUpdatedCols at ExecUtils.c only are safe to call if the variable "ri_RangeTableIndex" is != 0. Otherwise a possible Dereference after null check (FORWARD_NULL) can be raised. Exemple: void 1718ExecPartitionCheckEmitError(ResultRel

Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)

2021-02-10 Thread Ranier Vilela
base_snapshot == NULL); txn->base_snapshot = snap; regards, Ranier Vilela reorderbuffer.patch Description: Binary data

Operands don't affect result (CONSTANT_EXPRESSION_RESULT) (src/backend/utils/adt/jsonfuncs.c)

2021-02-10 Thread Ranier Vilela
0((path_len - level) * sizeof(enum jbvType)); - long lindex; + int64 lindex; JsonbValue newkey; /* regards, Ranier Vilela jsonfuncs.patch Description: Binary data

Re: Operands don't affect result (CONSTANT_EXPRESSION_RESULT) (src/backend/utils/adt/jsonfuncs.c)

2021-02-11 Thread Ranier Vilela
Em qui., 11 de fev. de 2021 às 01:46, Tom Lane escreveu: > Ranier Vilela writes: > > *long* 4 *long int*, *signed long int* -2.147.483.648 a 2.147.483.647 > > Therefore long never be > INT_MAX at Windows 64 bits. > > Thus lindex is always false in this expression: &g

Re: pg_cryptohash_final possible out-of-bounds access (per Coverity)

2021-02-11 Thread Ranier Vilela
Em qui., 11 de fev. de 2021 às 09:47, Michael Paquier escreveu: > On Wed, Feb 10, 2021 at 09:14:46AM -0300, Ranier Vilela wrote: > > It is necessary to correct the interfaces. To caller, inform the size of > > the buffer it created. > > Well, Coverity likes nannyism, so ea

Re: Operands don't affect result (CONSTANT_EXPRESSION_RESULT) (src/backend/utils/adt/jsonfuncs.c)

2021-02-11 Thread Ranier Vilela
Em qui., 11 de fev. de 2021 às 14:51, Tom Lane escreveu: > Ranier Vilela writes: > > Em qui., 11 de fev. de 2021 às 01:46, Tom Lane > escreveu: > >> At the same time, I think this code could be improved; but the way > >> to do that is to use strtoint(), rat

Re: pg_cryptohash_final possible out-of-bounds access (per Coverity)

2021-02-11 Thread Ranier Vilela
Em qui., 11 de fev. de 2021 às 09:47, Michael Paquier escreveu: > On Wed, Feb 10, 2021 at 09:14:46AM -0300, Ranier Vilela wrote: > > It is necessary to correct the interfaces. To caller, inform the size of > > the buffer it created. > > Now, the patch you sent has no need t

Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)

2021-04-11 Thread Ranier Vilela
Hi, Per Coverity. It seems to me that some recent commit has failed to properly initialize a structure, in extended_stats.c, when is passed to heap_copytuple. regards, Ranier Vilela fix_uninitialized_var_extend_stats.patch Description: Binary data

Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)

2021-04-11 Thread Ranier Vilela
Hi Justin, sorry for the delay. Nothing against it, but I looked for similar codes and this is the usual way to initialize HeapTupleData. Perhaps InvalidOid makes a difference. regards, Ranier Vilela Em dom., 11 de abr. de 2021 às 16:25, Justin Pryzby escreveu: > On Sun, Apr 11, 2021 at

Re: Uninitialized scalar variable (UNINIT) (src/backend/statistics/extended_stats.c)

2021-04-12 Thread Ranier Vilela
Em seg., 12 de abr. de 2021 às 03:04, Tom Lane escreveu: > Michael Paquier writes: > > On Sun, Apr 11, 2021 at 07:42:20PM -0300, Ranier Vilela wrote: > >> Em dom., 11 de abr. de 2021 às 16:25, Justin Pryzby < > pry...@telsasoft.com> > >>> I think it&#x

Re: Improving connection scalability: GetSnapshotData()

2020-07-24 Thread Ranier Vilela
_VACUUM': identificador nao declarado [C:\dll\postgres\pg_visibility.vcxproj] regards, Ranier Vilela

Re: Improving connection scalability: GetSnapshotData()

2020-07-24 Thread Ranier Vilela
Em sex., 24 de jul. de 2020 às 14:16, Andres Freund escreveu: > On 2020-07-24 14:05:04 -0300, Ranier Vilela wrote: > > Latest Postgres > > Windows 64 bits > > msvc 2019 64 bits > > > > Patches applied v12-0001 to v12-0007: > > > > C:\dll\post

Re: Improving connection scalability: GetSnapshotData()

2020-07-25 Thread Ranier Vilela
Em sex., 24 de jul. de 2020 às 21:00, Andres Freund escreveu: > On 2020-07-24 18:15:15 -0300, Ranier Vilela wrote: > > Em sex., 24 de jul. de 2020 às 14:16, Andres Freund > > escreveu: > > > > > On 2020-07-24 14:05:04 -0300, Ranier Vilela wrote: > > > &g

[ASAN] Postgres14 (Windows 64 bits)

2020-08-24 Thread Ranier Vilela
2\KERNEL32.DLL+0x180016fd3) #24 0x7ffed30fcec0 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x18004cec0) I'm not sure if ASAN can report false positives or if this CHECK error is own asan bug? Can you take a look, please? regards, Ranier Vilela

[PATCH] Resource leaks (src/backend/libpq/hba.c)

2020-08-25 Thread Ranier Vilela
not empty and as memory allocated by pg_malloc. The simplest solution is free namelist, even when calling ereport, why the level can be LOG or DEBUG3. regards, Ranier Vilela PS. Are two SplitGUCList in codebase. 1. SplitGUCList (src/bin/pg_dump/dumputils.c) 2. SplitGUCList (src/backend/utils/adt

[PATCH] Dereference null return value (NULL_RETURNS) (src/backend/commands/statscmds.c)

2020-08-25 Thread Ranier Vilela
the user "is not the owner of the existing statistics object". regards, Ranier Vilela fix_dereference_null_statscmds.patch Description: Binary data

[PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c)

2020-08-25 Thread Ranier Vilela
Hi Tom, Per Coverity. The variable root_offsets is read at line 1641, but, at this point, the content is unknown, so it is impossible to test works well. regards, Ranier Vilela fix_uninitialized_variable_heapam_handler.patch Description: Binary data

Out-of-bounds access (ARRAY_VS_SINGLETON) (src/backend/access/nbtree/nbtdedup.c)

2020-08-25 Thread Ranier Vilela
itup->t_tid; 1. Here htids is a SINGLETON? So: At line 723: htids[ui++] = *BTreeTupleGetPostingN(origtuple, i); 2. htids is accessed how ARRAY? And is acessed at positions 0 and 1, according (nhtids == 1): Assert(ui == nhtids); The htids[1] are destroying something at this memory position. regards, Ranier Vilela

Re: [PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c)

2020-08-25 Thread Ranier Vilela
Em ter., 25 de ago. de 2020 às 18:06, Alvaro Herrera < alvhe...@2ndquadrant.com> escreveu: > On 2020-Aug-25, Ranier Vilela wrote: > > > The variable root_offsets is read at line 1641, but, at this point, > > the content is unknown, so it is impossible to test works well.

Re: [PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c)

2020-08-25 Thread Ranier Vilela
Em ter., 25 de ago. de 2020 às 19:45, Alvaro Herrera < alvhe...@2ndquadrant.com> escreveu: > On 2020-Aug-25, Ranier Vilela wrote: > > > If the variable hscan->rs_cblock is InvalidBlockNumber the test can > > protect root_offsets fail. > > When does that happen? &g

Re: [PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c)

2020-08-25 Thread Ranier Vilela
Em ter., 25 de ago. de 2020 às 19:54, Ranier Vilela escreveu: > Em ter., 25 de ago. de 2020 às 19:45, Alvaro Herrera < > alvhe...@2ndquadrant.com> escreveu: > >> On 2020-Aug-25, Ranier Vilela wrote: >> >> > If the variable hscan->rs_cblock is Inval

Re: [PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c)

2020-08-25 Thread Ranier Vilela
Em ter., 25 de ago. de 2020 às 20:13, Alvaro Herrera < alvhe...@2ndquadrant.com> escreveu: > On 2020-Aug-25, Ranier Vilela wrote: > > > Em ter., 25 de ago. de 2020 às 19:45, Alvaro Herrera < > > alvhe...@2ndquadrant.com> escreveu: > > > > > On 2020-

Re: [PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c)

2020-08-25 Thread Ranier Vilela
Em ter., 25 de ago. de 2020 às 20:20, Alvaro Herrera < alvhe...@2ndquadrant.com> escreveu: > On 2020-Aug-25, Ranier Vilela wrote: > > > And it is guaranteed that, rs_cblock is not InvalidBlockNumber when the > > page is read? > > It could be InvalidBlockNumber i

Re: [PATCH] Fix Uninitialized scalar variable (UNINIT) (src/backend/access/heap/heapam_handler.c)

2020-08-25 Thread Ranier Vilela
Em ter., 25 de ago. de 2020 às 20:29, Alvaro Herrera < alvhe...@2ndquadrant.com> escreveu: > On 2020-Aug-25, Ranier Vilela wrote: > > > kkk, I think it's enough for me. > > I believe that PostgreSQL will not run on the ISS yet. > > Actually, I believe there ar

Re: [PATCH] Resource leaks (src/backend/libpq/hba.c)

2020-08-25 Thread Ranier Vilela
Em ter., 25 de ago. de 2020 às 23:02, Kyotaro Horiguchi < horikyota@gmail.com> escreveu: > At Tue, 25 Aug 2020 10:20:07 -0300, Ranier Vilela > wrote in > > Hi Tom, > > > > Per Coverity. > > > > The function parse_hba_auth_op at (src/backend/lib

Clang Address Sanitizer (Postgres14) Detected Memory Leaks

2020-08-26 Thread Ranier Vilela
/backend/postmaster/postmaster.c:884:7 Ranier Vilela

Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior

2020-08-26 Thread Ranier Vilela
ointer passed as argument 2, which is declared to never be null I stopped counting clog.c (299). If anyone wants, the full report, it has 2mb. Ranier Vilela

re: Please help for error ( file is required for XML support )

2020-08-27 Thread Ranier Vilela
>checking for libxml/parser.h... no >configure: error: header file is required for XML support sudo yum install libxml2-devel You need to install the development package before ./configure. regards, Ranier Vilela

Re: Clang Address Sanitizer (Postgres14) Detected Memory Leaks

2020-08-27 Thread Ranier Vilela
Em qui., 27 de ago. de 2020 às 12:46, Tom Lane escreveu: > Ranier Vilela writes: > > Is this something to worry about, or is it another problem with the > > analysis tool, that nobody cares about? > > As far as the first one goes, I'd bet on buggy analysis tool. >

Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior

2020-08-27 Thread Ranier Vilela
Em qui., 27 de ago. de 2020 às 13:57, Alvaro Herrera < alvhe...@2ndquadrant.com> escreveu: > On 2020-Aug-27, Ranier Vilela wrote: > > > indexcmds.c (1162): > > memcpy(part_oids, partdesc->oids, sizeof(Oid) * nparts); > > Looks legit, and at least per commit 1

Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior

2020-08-27 Thread Ranier Vilela
Em qui., 27 de ago. de 2020 às 13:57, Alvaro Herrera < alvhe...@2ndquadrant.com> escreveu: > On 2020-Aug-27, Ranier Vilela wrote: > > > indexcmds.c (1162): > > memcpy(part_oids, partdesc->oids, sizeof(Oid) * nparts); > > Looks legit, and at least per commit 1

Re: Clang Address Sanitizer (Postgres14) Detected Memory Leaks

2020-08-27 Thread Ranier Vilela
ccess/transam/xlog.c:5194 This line solve the alert: (xlog.c) 5193: memset(&checkPoint, 0, sizeof(checkPoint)); I'm starting to doubt this tool. regards, Ranier Vilela

[PATCH] Explicit null dereferenced (src/backend/access/heap/heaptoast.c)

2020-08-27 Thread Ranier Vilela
Hi, Per Coverity. When "Prepare for toasting", it is necessary to turn off the flag TOAST_NEEDS_DELETE_OLD, if there is no need to delete external values from the old tuple, otherwise, there are dereference NULL at toast_helper.c (on toast_tuple_cleanup function). regards, Ran

Re: [PATCH] Explicit null dereferenced (src/backend/access/heap/heaptoast.c)

2020-08-28 Thread Ranier Vilela
Em sex., 28 de ago. de 2020 às 04:45, escreveu: > > > > > > ‐‐‐ Original Message ‐‐‐ > On Friday, 28 August 2020 03:22, Ranier Vilela > wrote: > > > Hi, > > > > Per Coverity. > > > > When "Prepare for toasting", it is ne

Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior

2020-08-28 Thread Ranier Vilela
IdSetPageStatus was not called in these cases, memcmp, it would not have to deal with the NULL pointer. regards, Ranier Vilela

Re: Please help for error ( file is required for XML support )

2020-08-28 Thread Ranier Vilela
amp;5 > > conftest.c: In function 'main': > > *conftest.c:76:20: error: expected expression before ')' token* > > *if (sizeof ((_Bool)))* > > * ^* > > *configure:12910: $? = 1* > > *configure: failed program was:* > > *| /* confdefs.h */* > What version of gcc is being used in this environment? regards, Ranier Vilela

Re: Please help for error ( file is required for XML support )

2020-08-28 Thread Ranier Vilela
em sex., 28 de ago. de 2020 às 11:05, Ranier Vilela escreveu: > Em sex., 28 de ago. de 2020 às 04:37, Sachin Khanna < > sachin_kha...@infosys.com> escreveu: > >> >> >> Now I can see the that libraries are identified in config.log . I also >> found s

Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior

2020-08-28 Thread Ranier Vilela
s for which we're adjusting clog should be * on the same page. Check those conditions, too. */ - if (all_xact_same_page && xid == MyProc->xid && + if (all_xact_same_page && subxids && xid == MyProc->xid && nsubxids <= THRESHOLD_SUBTRANS_CLOG_OPT && nsubxids == MyProc->subxidStatus.count && memcmp(subxids, MyProc->subxids.xids, regards, Ranier Vilela

Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior

2020-08-31 Thread Ranier Vilela
rom before relfrozenxid 4244967300 2020-08-31 12:46:30.423 -03 [8908] CONTEXT: while scanning block 0 and offset 1 of relation "pg_catalog.pg_depend" 2020-08-31 12:46:30.423 -03 [8908] STATEMENT: VACUUM FREEZE; Most of the time: id1=498 id2=498 diff32=0 diff64=0 id1=498 id2=498 diff32=0 diff64=0 regards, Ranier Vilela

Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior

2020-08-31 Thread Ranier Vilela
Em seg., 31 de ago. de 2020 às 14:00, Alvaro Herrera < alvhe...@2ndquadrant.com> escreveu: > On 2020-Aug-31, Ranier Vilela wrote: > > > More troubles with undefined-behavior. > > > > This type of code can leaves overflow: > > var = (cast) (expression); > &g

Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior

2020-08-31 Thread Ranier Vilela
Em seg., 31 de ago. de 2020 às 14:43, Ranier Vilela escreveu: > Em seg., 31 de ago. de 2020 às 14:00, Alvaro Herrera < > alvhe...@2ndquadrant.com> escreveu: > >> On 2020-Aug-31, Ranier Vilela wrote: >> >> > More troubles with undefined-behavior. >> &g

Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior

2020-08-31 Thread Ranier Vilela
avior. At least Ranier's sample output didn't seem to > indicate it. > 4294901763 can not store at unsigned int (TransactionID is uint32_t). TransactionId id2 at TransactionIdPrecedes already has an overflow, before anything is done. Ranier Vilela

Re: Clang UndefinedBehaviorSanitize (Postgres14) Detected undefined-behavior

2020-08-31 Thread Ranier Vilela
tion > > (see -fsanitize=implicit-conversion). > > So it seems Rainier needs to turn this test off, because it actually is > intentional. > No problem. If intentional, the code at TransactionIdPrecedes, already knows that overflow can occur and trusts that the compiler will save it. Ranier Vilela

[NBTREE] Possible NULL pointer dereference (backend/access/nbtree/nbutils.c)

2020-09-02 Thread Ranier Vilela
d) at runtime (release version). itemptr.h: #define ItemPointerCopy(fromPointer, toPointer) \ ( \ AssertMacro(PointerIsValid(toPointer)), \ AssertMacro(PointerIsValid(fromPointer)), \ *(toPointer) = *(fromPointer) \ ) regards, Ranier Vilela

Re: [NBTREE] Possible NULL pointer dereference (backend/access/nbtree/nbutils.c)

2020-09-02 Thread Ranier Vilela
ItemPointerGetBlockNumberNoCheck(pointer) \ ( \ BlockIdGetBlockNumber(&(pointer)->ip_blkid) \ ) #define ItemPointerGetOffsetNumberNoCheck(pointer) \ ( \ (pointer)->ip_posid \ ) regards, Ranier Vilela

Re: [NBTREE] Possible NULL pointer dereference (backend/access/nbtree/nbutils.c)

2020-09-02 Thread Ranier Vilela
> Even if BTreeTupleGetHeapTID() did somehow return a NULL > pointer, then the user would be getting off lightly by experiencing a > hard crash instead of data corruption. > Oh, I'm sorry, I thought that "hard crash" was a bad thing. Ranier Vilela

Re: [NBTREE] Possible NULL pointer dereference (backend/access/nbtree/nbutils.c)

2020-09-03 Thread Ranier Vilela
Em qua., 2 de set. de 2020 às 20:17, Peter Geoghegan escreveu: > On Wed, Sep 2, 2020 at 3:16 PM Ranier Vilela wrote: > Perhaps you recall our discussion of a similar false positive in > nbtsplitloc.c; that had a similar feel to it. For example, if your > static analysis tool sa

Re: [PATCH] Redudant initilization

2020-09-04 Thread Ranier Vilela
Em qui., 3 de set. de 2020 às 23:57, Bruce Momjian escreveu: > On Wed, Apr 1, 2020 at 08:57:18AM -0300, Ranier Vilela wrote: > > Hi, > > New patch with yours suggestions. > > Patch applied to head, thanks. > Thank you Bruce. regards, Ranier Vilela

Re: [PATCH] Redudant initilization

2020-09-04 Thread Ranier Vilela
Em sex., 4 de set. de 2020 às 11:01, Bruce Momjian escreveu: > On Fri, Sep 4, 2020 at 09:39:45AM -0300, Ranier Vilela wrote: > > Em qui., 3 de set. de 2020 às 23:57, Bruce Momjian > escreveu: > > > > On Wed, Apr 1, 2020 at 08:57:18AM -0300, Ranier Vilela wrote: >

Re: [PATCH] Redudant initilization

2020-09-04 Thread Ranier Vilela
s sent but did not make the list. Would you mind taking a look? Certainly, if accepted, rebasing would have to be done. regards, Ranier Vilela variables_assigned_unused_value.patch Description: Binary data

Re: [PATCH] Redudant initilization

2020-09-05 Thread Ranier Vilela
Em sex., 4 de set. de 2020 às 18:20, Ranier Vilela escreveu: > Em sex., 4 de set. de 2020 às 14:40, Tom Lane > escreveu: > >> Bruce Momjian writes: >> > I have to say, I am kind of stumped why compilers do not warn of such >> > cases, and why we haven't g

Re: [PATCH] Redudant initilization

2020-09-05 Thread Ranier Vilela
Em sáb., 5 de set. de 2020 às 14:29, Tom Lane escreveu: > Ranier Vilela writes: > > Attached is a patch I made in March/2020, but due to problems, > > it was sent but did not make the list. > > Would you mind taking a look? > > I applied some of this, but other

Re: A micro-optimisation for walkdir()

2020-09-05 Thread Ranier Vilela
; char d_name[MAX_PATH]; }; Or even better if possible: struct dirent { char d_name[MAX_PATH]; long d_ino; unsigned short d_reclen; unsigned short d_namlen; unsigned char d_type; }; regards, Ranier Vilela v4-0001-Skip-unnecessary-stat-calls-in-walkdir.patch Description: Binary data v4

Re: Windows regress fails (latest HEAD)

2020-09-10 Thread Ranier Vilela
Em sex., 26 de jun. de 2020 às 08:21, Ranier Vilela escreveu: > Em qui., 11 de jun. de 2020 às 10:28, Ranier Vilela > escreveu: > >> Em qui., 11 de jun. de 2020 às 10:01, Andrew Dunstan < >> andrew.duns...@2ndquadrant.com> escreveu: >> >>> >>>

Re: Eval expression R/O once time (src/backend/executor/execExpr.c)

2021-11-03 Thread Ranier Vilela
Em ter., 2 de nov. de 2021 às 15:33, Andres Freund escreveu: > On 2021-11-02 13:43:46 -0400, Tom Lane wrote: > > Ranier Vilela writes: > > > It seems that 1ec7679f1b67e84be688a311dce234eeaa1d5de8 caused the > problem. > > > > Indeed. Fix pushed. > > T

[BUG FIX] Uninitialized var fargtypes used.

2019-11-11 Thread Ranier Vilela
Hi, Can anyone check this bug fix? Thanks. Ranier Vilela --- \dll\postgresql-12.0\a\backend\commands\event_trigger.c Mon Sep 30 17:06:55 2019 +++ event_trigger.c Mon Nov 11 13:52:35 2019 @@ -171,7 +171,7 @@ HeapTuple tuple; Oid funcoid

RE: [BUG FIX] Uninitialized var fargtypes used.

2019-11-12 Thread Ranier Vilela
] = {InvalidOid}; /* dummy */ Oid evtowner = GetUserId(); ListCell *lc; List *tags = NULL; De: Michael Paquier Enviado: terça-feira, 12 de novembro de 2019 03:31 Para: Ranier Vilela Cc: pgsql-hackers@lists.postgresql.org Assunto: Re: [BUG FIX] Uninitialized var

[PATCH][BUG_FIX] Potential null pointer dereferencing.

2019-11-12 Thread Ranier Vilela
Hi, ExecClearTuple don't check por NULL pointer arg and according TupIsNull slot can be NULL. Can anyone check this buf fix? --- \dll\postgresql-12.0\a\backend\executor\nodeUnique.cMon Sep 30 17:06:55 2019 +++ nodeUnique.cTue Nov 12 09:54:34 2019 @@ -74,7 +74,8 @@

RE: [PATCH][BUG_FIX] Potential null pointer dereferencing.

2019-11-12 Thread Ranier Vilela
least 2 more possible cases, envolving ExecClearTuple: nodeFunctionscan.c and nodeWindowAgg.c Best regards, Ranier Vilela De: Daniel Gustafsson Enviado: terça-feira, 12 de novembro de 2019 13:43 Para: Ranier Vilela Cc: PostgreSQL Hackers Assunto: Re: [

[PATCH][BUG FIX] Potential uninitialized vars used.

2019-11-12 Thread Ranier Vilela
Hi, Var TargetEntry *tle; Have several paths where can it fail. Can anyone check this bug fix? --- \dll\postgresql-12.0\a\backend\parser\parse_expr.c Mon Sep 30 17:06:55 2019 +++ parse_expr.cTue Nov 12 12:43:07 2019 @@ -349,6 +349,7 @@ errmsg("DEF

[PATCH] Improve AtSubCommit_childXids

2019-11-13 Thread Ranier Vilela
" is > 0, naturally. That way we can improve the function and avoid calling and setting unnecessarily! Bonus: silent compiler warning potential null pointer derenferencing. Best regards, Ranier Vilela --- \dll\postgresql-12.0\a\backend\access\transam\xact.cMon Sep 30 17:06:55

RE: [PATCH] Improve AtSubCommit_childXids

2019-11-13 Thread Ranier Vilela
avoid leakage */ if (s->childXids != NULL) // Check null pointer! pfree(s->childXids); /* We must reset these to avoid double-free if fail later in commit */ s->childXids = NULL; // ever set to 0 s->nChildXids = 0; // ever set to

[PATCH][BUG FIX] Unsafe access pointers.

2019-11-15 Thread Ranier Vilela
Hi, Last time, I promise. It's probably not happening, but it can happen, I think. Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\access\brin\brin_validate.c Mon Sep 30 17:06:55 2019 +++ brin_validate.c Fri Nov 15 08:14:58 2019 @@ -57,8 +57,10 @@ /* Fetch op

RE: [PATCH][BUG FIX] Unsafe access pointers.

2019-11-15 Thread Ranier Vilela
Hi, Thank you for the explanation. Best regards. Ranier Vilela De: Daniel Gustafsson Enviado: sexta-feira, 15 de novembro de 2019 11:58 Para: Ranier Vilela Cc: pgsql-hackers@lists.postgresql.org Assunto: Re: [PATCH][BUG FIX] Unsafe access pointers. >

[PATCH][BUG FIX] Uninitialized variable parsed

2019-11-22 Thread Ranier Vilela
Hi, Typo mystake? Memset only fill a pointer size, not the size of struct. Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\access\rmgrdesc\xactdesc.c Mon Sep 30 17:06:55 2019 +++ xactdesc.c Fri Nov 22 13:40:13 2019 @@ -35,7 +35,7 @@ { char *data = ((char

[PATCH][BUG FIX] Pointer arithmetic with NULL

2019-11-22 Thread Ranier Vilela
Hi, Pointer addition with NULL, is technically undefined behavior. Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\access\transam\xlog.cMon Sep 30 17:06:55 2019 +++ xlog.c Fri Nov 22 13:57:17 2019 @@ -1861,7 +1861,7 @@ { Assert

[PATCH][BUG FIX] Pointer var initilialized with boolean.

2019-11-22 Thread Ranier Vilela
Hi, Typo mystake? Pointer var initilialized with boolean. Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\commands\trigger.c Mon Sep 30 17:06:55 2019 +++ trigger.c Fri Nov 22 14:20:56 2019 @@ -2536,7 +2536,7 @@ TupleTableSlot *slot

[PATCH] Tiny optmization.

2019-11-22 Thread Ranier Vilela
Hi, Maybe it doesn't matter, but, I think it's worth discussing. The expression "if(pstate)" is redundant or is possible null dereference. Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\commands\copy.c Mon Sep 30 17:06:55 2019 +++ copy.c Fri

[PATCH] Tiny optmization or is a bug?

2019-11-22 Thread Ranier Vilela
Hi, Maybe this is a real bug. The assignment has no effect, or forget dereferencing it? Best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\commands\lockcmds.c Mon Sep 30 17:06:55 2019 +++ lockcmds.c Fri Nov 22 18:45:01 2019 @@ -285,7 +285,7 @@ LockViewRecurse_walker

[PATCH] Tiny optimization.

2019-11-22 Thread Ranier Vilela
Hi, Remove redutant test. best regards. Ranier Vilela --- \dll\postgresql-12.0\a\backend\executor\execExpr.c Mon Sep 30 17:06:55 2019 +++ execExpr.c Fri Nov 22 18:50:32 2019 @@ -2426,7 +2426,7 @@ { desc = parent->scandesc; - if (parent && pare

RE: [PATCH] Tiny optmization.

2019-11-22 Thread Ranier Vilela
Hi, Redudant because he it's been dereferenced here: line 3410: cstate = BeginCopy(pstate, true, rel, NULL, InvalidOid, attnamelist, options); Best regards. Ranier Vilela De: Tomas Vondra Enviado: sexta-feira, 22 de novembro de 2019 22:05

RE: [PATCH] Tiny optmization.

2019-11-22 Thread Ranier Vilela
(ERRCODE_SYNTAX_ERROR), errmsg("conflicting or redundant options"), parser_errposition(pstate, defel->location))); best regards. Ranier Vilela

[BUG] (firsttupleslot)==NULL is redundant or is possible null dereference?

2019-11-22 Thread Ranier Vilela
Hi, This is real bug? firsttupleslot == NULL. \backend\executor\nodeGroup.c if (TupIsNull(firsttupleslot)) { outerslot = ExecProcNode(outerPlanState(node)); if (TupIsNull(outerslot)) { /* empty input, so return

RE: [BUG] (firsttupleslot)==NULL is redundant or is possible null dereference?

2019-11-22 Thread Ranier Vilela
Hi, Sorry, you are right. Had not seen this line: firsttupleslot = node->ss.ss_ScanTupleSlot; Best regards. Ranier Vilela De: Tomas Vondra Enviado: sexta-feira, 22 de novembro de 2019 22:54 Para: Ranier Vilela Cc: pgsql-hack...@postgresql.org Assunto:

  1   2   3   4   5   6   7   8   9   10   >