Re: BUG #19727: pg-combinebackup fails to link

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ross Burton <ross(at)burtonini(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19727: pg-combinebackup fails to link
Date: 2026-09-30 13:36:07
Message-ID: 769387.1790775367@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Ross Burton <ross(at)burtonini(dot)com> writes:
> I now have a build tree that works and a build tree that breaks, from
> the same machine and environment, simply by re-running the build with
> make --shuffle.

> The working jsonapi.o has functions like appendStringInfoChar,
> resetStringInfo, etc. The one that fails to link has
> appendPQExpBufferChar, resetPQExpBuffer, etc.

> This is a makefile dependency bug exposed in parallel builds, and can
> be reproduced on demand with a minimal reproducer. From a clean but
> configured tree, in src/common:

> $ make jsonapi.o
> $ readelf -sW jsonapi.o | grep reset
> 64: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND resetStringInfo

> This builds a jsonapi.o using the direct target, and
> JSONAPI_USE_PQEXPBUFFER is not defined.

> $ make clean
> $ make jsonapi_shlib.o
> $ readelf -sW jsonapi.o | grep reset
> 65: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND resetPQExpBuffer

> This builds jsonapi_shlib.o, which adds JSONAPI_USE_PQEXPBUFFER to
> CPPFLAGS. However jsonapi.o hasn't been built yet so that is also
> built, but with the PQEXPBUFFER define set this time.

Very interesting! So the problem is that the scope of the effects of
this:

jsonapi_shlib.o: override CPPFLAGS += -DJSONAPI_USE_PQEXPBUFFER

isn't terribly well-defined. Looking at the rest of that Makefile,
I'm also suspicious about

$(OBJS_FRONTEND): CPPFLAGS += -DUSE_PRIVATE_ENCODING_FUNCS

Can you break that part? If not, maybe the problem is the
gratuitous-looking "override"?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jiří Kavalík 2026-09-30 13:59:13 Streaming decoding fails with "unexpected table_index_fetch_tuple call during logical decoding" when a relation has a TOASTed conbin (follow-up to BUG #18641)
Previous Message Andrey Rachitskiy 2026-09-30 13:25:32 Re: BUG #19732: first_value/last_value/nth_value return NULL with EXCLUDE TIES when the current row is outside its f