Skip to content

Commit 949c0ad

Browse files
committed
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.
1 parent 70cc576 commit 949c0ad

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

lib/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ MODULE_big = $(EXTENSION)
1717

1818
OBJS = repack.o pgut/pgut-be.o pgut/pgut-spi.o
1919

20+
SHLIB_EXPORTS = exports.txt
21+
2022
# The version number of the program. It should be the same of the library.
2123
REPACK_VERSION = $(shell grep '"version":' ../META.json | head -1 \
2224
| sed -e 's/[ ]*"version":[ ]*"\(.*\)",/\1/')

lib/exports.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Pg_magic_func 1
2+
pg_finfo_repack_apply 2
3+
pg_finfo_repack_disable_autovacuum 3
4+
pg_finfo_repack_drop 4
5+
pg_finfo_repack_get_order_by 5
6+
pg_finfo_repack_indexdef 6
7+
pg_finfo_repack_swap 7
8+
pg_finfo_repack_trigger 8
9+
pg_finfo_repack_version 9
10+
pg_finfo_repack_index_swap 10
11+
repack_apply 11
12+
repack_disable_autovacuum 12
13+
repack_drop 13
14+
repack_get_order_by 14
15+
repack_indexdef 15
16+
repack_swap 16
17+
repack_trigger 17
18+
repack_version 18
19+
repack_index_swap 19

0 commit comments

Comments
 (0)