Subject: | 02-lockall.t fails |
The test suite fails on all of my smokers. I looked with strace into 02-lockall.t (on a debian/jessie machine with perl 5.28.1) and these are probably the interesting lines:
...
25304 16:24:10.058637 fstat(4, {st_mode=S_IFREG|0755, st_size=15720, ...}) = 0 <0.000005>
25304 16:24:10.058654 mmap(NULL, 2107224, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x7feffb100000 <0.000008>
25304 16:24:10.058673 mprotect(0x7feffb103000, 2093056, PROT_NONE) = 0 <0.000008>
25304 16:24:10.058690 mmap(0x7feffb302000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x2000) = 0x7feffb302000 <0.000007>
25304 16:24:10.058711 close(4) = 0 <0.000004>
25304 16:24:10.058823 mlock(0x2d85e30, 4096) = 0 <0.000046>
25304 16:24:10.058887 mlockall(MCL_CURRENT|MCL_FUTURE) = -1 ENOMEM (Cannot allocate memory) <0.000005>
25304 16:24:10.059097 write(5, "not ok 1 - mlockall() call\n", 27) = 27 <0.000013>
25304 16:24:10.059356 write(6, "# Failed test 'mlockall() call'\n# at t/02-lockall.t line 14.\n", 65) = 65 <0.000055>
...
So mlockall() fails with ENOMEM. According to the mlockall manpage this seems to happen due to the RLIMIT_MEMLOCK resource limit. limit reports the following:
memorylocked 64kB
The manpage also says that this limit does not apply if the "process is privileged", and indeed, this test passes if run under root.