From: | Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Subject: | Compilation error with buildtype = release |
Date: | 2025-07-29 12:43:55 |
Message-ID: | CAExHW5tkerCufA_F6oct5dMJ61N+yVrVgYXL7M8dD-5_zXjrDw@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi Tom,
I am seeing following error only with buildtype = release
FAILED: contrib/postgres_fdw/postgres_fdw.so.p/postgres_fdw.c.o
cc -Icontrib/postgres_fdw/postgres_fdw.so.p -Isrc/include
-I../../coderoot/pg/src/include -Isrc/interfaces/libpq
-I../../coderoot/pg/src/interfaces/libpq -fdiagnostics-color=always
-D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O3
-fno-strict-aliasing -fwrapv -fexcess-precision=standard -D_GNU_SOURCE
-Wmissing-prototypes -Wpointer-arith -Werror=vla -Wendif-labels
-Wmissing-format-attribute -Wimplicit-fallthrough=3
-Wcast-function-type -Wshadow=compatible-local -Wformat-security
-Wdeclaration-after-statement -Wno-format-truncation
-Wno-stringop-truncation -fPIC -pthread -fvisibility=hidden -MD -MQ
contrib/postgres_fdw/postgres_fdw.so.p/postgres_fdw.c.o -MF
contrib/postgres_fdw/postgres_fdw.so.p/postgres_fdw.c.o.d -o
contrib/postgres_fdw/postgres_fdw.so.p/postgres_fdw.c.o -c
../../coderoot/pg/contrib/postgres_fdw/postgres_fdw.c
../../coderoot/pg/contrib/postgres_fdw/postgres_fdw.c: In function
‘postgresAcquireSampleRowsFunc’:
../../coderoot/pg/contrib/postgres_fdw/postgres_fdw.c:5287:28: error:
‘reltuples’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
5287 | *totalrows = reltuples;
| ~~~~~~~~~~~^~~~~~~~~~~
cc1: all warnings being treated as errors
meson setup command is
meson setup /build/prod --prefix /build/prod --werror --buildtype=release
Looking at the function, reltuples is indeed initialized in all the
cases. All the relevant lines of the function are at least 3 years
old, but I have started seeing this error only after
80aa9848befc13c188d2775a859deaf172fdd3a2.
Reading the code, reltuples is getting initialized in all the cases
when it's used i.e when method != ANALYZE_SAMPLE_OFF. I can't figure
out why that commit would cause this error. If I `git checkout
7d8f5957792421ec3bb9d1b9b6ca25d689d974b7` and build, I do not see the
error.
Compiler version
$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If I make the change as per attached patch, it compiles without an
error. I don't claim that the patch is the right thing to do, but it
might provide a hint.
--
Best Wishes,
Ashutosh Bapat
Attachment | Content-Type | Size |
---|---|---|
init_reltuples.diff | text/x-patch | 461 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Hayato Kuroda (Fujitsu) | 2025-07-29 12:45:17 | RE: 024_add_drop_pub.pl might fail due to deadlock |
Previous Message | Hayato Kuroda (Fujitsu) | 2025-07-29 12:38:22 | RE: 024_add_drop_pub.pl might fail due to deadlock |