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.
- Log into your server using your admin user.
- 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 )
- The following list appears in this file:
- Add the binary or interpreter you're using to this list.
- Execute the file:
[server]$ ./root/shared-interpreters-pax.sh
- Rerun your original command.
- The memory errors are resolved.