"... cannot restore segment prot after reloc Permission denied"

Last edited on

Symptom

You may get the following error message in a shell when starting Squish IDE in it:

APC Denial

libsquishinterpreter.so cannot restore segment prot after reloc: Permission denied

Squishrunner exits with status code 127.

Solutions

On some systems, when this problem occurs an SELinux message box pops up at the same time. If this happens you should be able to access the SELinux GUI configuration tool via this message box and configure SELinux to allow Squish to do its work.

Temporarily disable SELinux

The enforcement of the security enhancements can be disabled temporarily, for example before starting Squish, execute:

/usr/sbin/setenforce 0

Permanently disable SELinux

The SELinux policy can be changed from “enforcing” to “permissive” on most systems via a GUI configuration tool.

Alternatively enforcement can be disabled by changing a line in the /etc/selinux/config file. In particular, change this line:

SELINUX=enforcing

to either

SELINUX=permissive

or

SELINUX=disabled

It will be necessary to reboot after making this change for it to take effect.

More information

Due to the use of third-party code and imperfect compilers, Squish contains libraries with “text relocations”. These are harmless but a “hardened” Linux distribution with SELinux (Security Enhanced Linux) installed might block them.

Advanced

A more fine-grained solution is also possible using the chcon tool. This allows for the setting of the security context for specific files. Here is an example that worked for one customer (replace /path/to/squish with the actual path to your Squish installation):

find /path/to/squish -type f -name "*.so" | xargs chcon -t textrel_shlib_t

Related information

This error can occur in RedHat Linux (RHEL) or any other Linux with SELinux enabled.

Also see How to make SELinux trust the Squish IDE.