Modify kernel parameters (mmap operation not permitted, EPERM)

2.9k views Asked by At

I am trying to run this code on a server (RedPitaya) as well as a client (ubuntu virtual machine).

The program returns the following error messages when it is run on the client with root privileges:

root@VirtualBox:/.../rp_remote_acquire# ./rp_remote_acquire -m 1 -a 192.169.1.100 -p 5000 -k 0 -c 0 -d 64
mmap scope io failed (non-fatal), 1
mmap scope ddr a failed (non-fatal), 1
Segmentation fault (core dumped)

I am not sure if the segmentation fault is related to the first two errors because I only get a segmentation fault when the server is running...

The error seems to be coming from here:

if (param->mapped_io == MAP_FAILED) {
    fprintf(stderr, "mmap scope io failed (non-fatal), %d\n", errno);
    param->mapped_io = NULL;
}

I am aware that a similar problem has already been resolved on stackoverflow.

I tried

sysctl dev.mem.restricted

and I tried adding

linux   /boot/vmlinuz-linux iomem=relaxed

to the end of

/boot/grub/grub.cfg

and rebooting, but the problem still persists...

I would like to allow this program to access the computers virtual memory and thereby hopefully resolve all the errors. It could well be that I didn't manage to set the kernel parameters correctly.

Could someone please point me in the right direction?

0

There are 0 answers