Resolving memory errors on a Dedicated server

 

Overview

This article explains how to resolve memory errors on a Dedicated Server by editing a configuration file with your admin user.

Prerequisites

The commands in this article require you to create an admin user on your Dedicated Server.

The error

Dedicated server users attempting to execute a shared binary or interpreter (such as Python pip) may see a memory error similar to the following:

MemoryError: Cannot allocate write+execute memory for ffi.callback(). 
You might be running on a system that prevents this.
For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks

This is due to grsec blocking unprivileged execution and memory allocation that the binary or interpreter needs to function. 

Fixing the error

DreamHost has added a script to the following directory on your Dedicated Server:

/root/shared-interpreters-pax.sh

This file can be modified and executed as an admin user to adjust memory allocation.

  1. Log into your server using your admin user.
  2. Edit the following file using sudo.
    [server]$ sudo nano /root/shared-interpreters-pax.sh
    The following list appears in this file:
    list=( java javac pip pip3 python python3 )
  3. Add the binary or interpreter you're using to this list.
  4. Execute the file:
    [server]$ ./root/shared-interpreters-pax.sh
  5. Rerun your original command.
    The memory errors are resolved.

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?