[LU-5281] Memory leak when userspace code uses mmap on lustre files Created: 01/Jul/14  Updated: 31/Jul/14  Resolved: 01/Jul/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.5.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Andrew Prout Assignee: WC Triage
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Kernel version: 3.4.93 (also 3.2.58)
Lustre version: 2.5.1 (patchless client)


Severity: 3
Rank (Obsolete): 14741

 Description   

We're seeing kernel a memory leak when a userspace process uses mmap'd files on lustre. It looks like memory is leaked for each unique file that is mmap'd. The code does not need to run as root. The same code on local disk does not cause a leak. The leak will eventually consume all system memory and take the machine down.

To reproduce the bug, compile the below code and run something similar to: find /lustre/ -type f -print0 | xargs -0 -I{} ./mmap_bug "{}"

Kernel version: 3.4.93 (also 3.2.58)
Lustre version: 2.5.1 (patchless client)

#include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>

int main(int argc, char **argv) {
int f = open(argv[1], O_RDONLY);
void *m = mmap(NULL, 8192, PROT_READ, MAP_SHARED, f, 0);
munmap(m, 8192);
close(f);

return 0;
}



 Comments   
Comment by Jinshan Xiong (Inactive) [ 01/Jul/14 ]

This should be a reproduction of LU-5179. Please reopen this ticket if the patch can't fix this issue.

Comment by Andrew Prout [ 31/Jul/14 ]

The LU-5179 patch did fix it. I had seen that bug, but we didn't match the conditions described by Oleg (we do not have the jobid functionality enabled).

Generated at Sat Feb 10 01:50:07 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.