Pivotal Knowledge Base

Follow

Create function fails with "/lib64/libc.so.6: version 'GLIBC_2.14' not found"

Environment

Product Version
Pivotal Greenplum (GPDB) 4.3.x
OS RHEL 6.x
Others  

Symptom

Several errors were seen when attempting to create a function included in a self-written C library file.

Error 1:

symphony_reporting_stage=# CREATE OR REPLACE FUNCTION containsprofanity(text) RETURNS bool AS '$libdir/searchterms','containsprofanity' LANGUAGE C WITH (iscachable, isstrict); 
ERROR: could not access file "$libdir/searchterms": No such file or directory

Error 2:

symphony_reporting_stage=# CREATE OR REPLACE FUNCTION containsprofanity(text) 
symphony_reporting_stage-# RETURNS bool
symphony_reporting_stage-# AS '$libdir/searchterms','containsprofanity'
symphony_reporting_stage-# LANGUAGE C WITH (iscachable, isstrict);
ERROR: could not load library "/usr/local/greenplum-db-4.3.8.1/lib/postgresql/searchterms.so": /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/local/greenplum-db-4.3.8.1/lib/postgresql/searchterms.so) 

Error 3:

symphony_reporting_stage=# CREATE OR REPLACE FUNCTION containsprofanity(text) 
symphony_reporting_stage-# RETURNS bool
symphony_reporting_stage-# AS '$libdir/searchterms','containsprofanity'
symphony_reporting_stage-# LANGUAGE C WITH (iscachable, isstrict);
ERROR: could not load library "/usr/local/greenplum-db-4.3.8.1/lib/postgresql/searchterms.so": /usr/local/greenplum-db-4.3.8.1/lib/postgresql/searchterms.so: undefined symbol: MemoryContextAlloc

Cause

Error 1

The library file was put to $GPHOME/lib/ which is not correct for GPDB. Instead it should be in $GPHOME/lib/postgresql/

Error 2

Library file searchterms.so was compiled on a system with different version of GLIBC from system running GPDB software. In this case GPDB system has GLIBC_2.12, however searchterms.so was built in a system with GLIBC_2.14.

Error 3

The library file was built in a non-GPDB environment containing some symbol that is not provided by GPDB libraries. In this case searchterms.so was built in Postgresql environment instead of GPDB.

Resolution

Error 1

Put the library file to $GPHOME/lib/postgresql/

Error 2

Build library file in a system which has compatible GLIBC with the one running GPDB software.

Error 3

Rebuild the library file in a GPDB environment by sourcing greenplum_path.sh to let compiler link libraries shipped with GPDB. 

 

Comments

Powered by Zendesk