fu_util/fobj: fix autorelease pool cleanup in glibc

glibc's pthread_exit runs stack unwinding for C++ destructor's handling,
and calls destructors for pthread specifics only after unwinding.

This way fobj_destroy_thread_AR is called too lately.

We have to compile with '-fexception' to register all our
attribute((cleanup)) for autorelease pools as "C++ desctructors".

Found in debug session with Sergey Fucanchik <s.fukanchik@postgrespro.ru>
This commit is contained in:
Yura Sokolov
2022-12-15 18:57:40 +03:00
parent 8efe4d4bc7
commit 401bccf0b7
+1
View File
@@ -81,6 +81,7 @@ PG_CPPFLAGS += -Isrc
endif
override CPPFLAGS := -DFRONTEND $(CPPFLAGS) $(PG_CPPFLAGS)
PG_LIBS_INTERNAL = $(libpq_pgport) ${PTHREAD_CFLAGS}
CFLAGS += -fexception
# additional dependencies on borrowed files
src/backup.o src/catchup.o src/pg_probackup.o: src/compatibility/streamutil.h