From 949c0ad1500369f696e4b47417b05d062ee5093c Mon Sep 17 00:00:00 2001 From: Josh Kupershmidt Date: Sun, 31 May 2015 18:59:05 -0400 Subject: [PATCH] Avoid symbol conflict causing segfault when pg_statsinfo is installed. Control symbol visibility for functions exported in the pg_repack shared library, to avoid symbol conflicts with other libraries, particularly those which may be loaded via shared_preload_libraries and use conflicting function definitions of our common pgut code, such as pg_statsinfo. Verified this fix on my Debian x86_64 machine with PostgreSQL 9.4 and pg_statsinfo 3.0.2. Would be nice to test this fix on a few other platforms such as OS X, though I had some difficulty getting pg_statsinfo to build on OS X. Hopefully closes Issue #43, thanks to bwtakacy for the report and demonstration of the commited fix in pg_reorg. --- lib/Makefile | 2 ++ lib/exports.txt | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 lib/exports.txt diff --git a/lib/Makefile b/lib/Makefile index 56d9b4f..83351da 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -17,6 +17,8 @@ MODULE_big = $(EXTENSION) OBJS = repack.o pgut/pgut-be.o pgut/pgut-spi.o +SHLIB_EXPORTS = exports.txt + # The version number of the program. It should be the same of the library. REPACK_VERSION = $(shell grep '"version":' ../META.json | head -1 \ | sed -e 's/[ ]*"version":[ ]*"\(.*\)",/\1/') diff --git a/lib/exports.txt b/lib/exports.txt new file mode 100644 index 0000000..ebc1092 --- /dev/null +++ b/lib/exports.txt @@ -0,0 +1,19 @@ +Pg_magic_func 1 +pg_finfo_repack_apply 2 +pg_finfo_repack_disable_autovacuum 3 +pg_finfo_repack_drop 4 +pg_finfo_repack_get_order_by 5 +pg_finfo_repack_indexdef 6 +pg_finfo_repack_swap 7 +pg_finfo_repack_trigger 8 +pg_finfo_repack_version 9 +pg_finfo_repack_index_swap 10 +repack_apply 11 +repack_disable_autovacuum 12 +repack_drop 13 +repack_get_order_by 14 +repack_indexdef 15 +repack_swap 16 +repack_trigger 17 +repack_version 18 +repack_index_swap 19