Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-5281

Memory leak when userspace code uses mmap on lustre files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • Lustre 2.5.1
    • None
    • Kernel version: 3.4.93 (also 3.2.58)
      Lustre version: 2.5.1 (patchless client)
    • 3
    • 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;
      }

      Attachments

        Activity

          People

            wc-triage WC Triage
            aprout Andrew Prout
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: