I was following this exercise. This page has instructions to install Valgrind 3.6.1 but this version of Valgrind is not supported by my current Linux kernel version. So, I installed Valgrind 3.11.0 and followed the instructions there after and on running this command:
$ valgrind ./ex4
got this error:
valgrind: mmap(0x600000, 8192) failed in UME with error 12 (Cannot allocate memory).
How to do I fix it?
I’m using Ubuntu 14.04 LTS with kernel version 4.4.0
Advertisement
Answer
The error which you have encountered is actually a kernel bug, which was fixed in the subsequent versions. More details here:
https://bugzilla.redhat.com/show_bug.cgi?id=1301093
To overcome the error, I would suggest you to update the kernel.
Note: I am myself using running Ubuntu 14.04 on kernel version 3.16.0-67 and it runs without any hassles.
Edit: As pointed out by the OP in comments, the bug has been fixed in kernel version 4.5.2.