The error "failed to map segment from shared object" occurs when running esm-maintenance


When running the SAS® Enterprise Session Monitor esm-maintenance utility, you might encounter the following error:

./esm-maintenance --extract-data --temp-dir /apps/esm/maintenance/extract_data

./esm-maintenance: error while loading shared libraries: libz.so.1: failed to map segment from shared object 

Cause

The error occurs when the temporary directory is not executable. There are two possible workarounds.

Method 1

1. Specify an alternate temporary directory.

mkdir /path/to/another/temp/dir
export TMPDIR=/path/to/another/temp/dir

2. Re-run the esm-maintenance utility.

3. Unset the environment variable with this command:  unset TMPDIR

Method 2

Make the default temporary directory (/tmp) executable by running this command:

sudo mount /tmp -o remount,exec

Note: This command remounts the system /tmp directory as executable.