Running strace on the sample program produces:
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
write(1, "Testing 00401978\n", 23) = 23
mlock(0x401978, 1073831936) = 0
write(1, "Return 0, errno 0\n", 18) = 18
munmap(0x40016000, 4096) = 0
The length is 1024 (passed to kernel correctly, verified).
The number garbage number 1073831936 is 0x40016000, which was returned
by mmap above.
[zaitcev@devel6 ltp]$ cat /proc/version
Linux version 2.4.21-1.1931.2.338.z31 (email@example.com) (gcc
version 3.2.3 20030422 (Red Hat Linux 3.2.3-4)) #6 SMP Tue Jul 29 20:17:24 EDT 2003
[zaitcev@devel6 ltp]$ rpm -q glibc
[zaitcev@devel6 ltp]$ rpm -q strace
The run above was done at Taroon.
The test is called "munlock" because it degenerated from an LTP test
for munlock(2) which Brock runs for QA regression testing.
Created attachment 93343 [details]
The argument count for the mlock syscall was wrong in the table.
I fixed it upstream, and a new rpm will roll through before long.
An errata has been issued which should help the problem described in this bug report.
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen
this bug report if the solution does not work for you.