Modify kernel parameters (mmap operation not permitted, EPERM)

旧时模样 提交于 2020-01-03 05:44:25

问题


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?

来源:https://stackoverflow.com/questions/54597068/modify-kernel-parameters-mmap-operation-not-permitted-eperm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!