Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-838

libhdfs causes a segfault due to race condition

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.20.1, 0.20.2, 0.21.0, 0.22.0
    • Fix Version/s: 1.0.0
    • Component/s: libhdfs
    • Labels:
      None

      Description

      The first libhdfs operation that is performed is not thread-safe; this is because the creation of a JVM is not protected by a mutex.

      We have been able to trigger this by doing the following:
      1) Start a few GNOME sessions on the box. Make sure you are running the gnome volume manager. The volume manager will perform a GETATTR operation on any newly mounted file system.
      2) Start fuse-dfs in debug mode. As soon as it starts, you will see two or more GETATTR calls almost instantly.
      3) fuse-dfs segfaults; if you ran this with GDB, you'll see a stack trace coming from libhdfs starting up a new JVM.

      I imagine you could replicate this more simply by having two threads that call libhdfs simultaneously.

      I have a patch for fuse-dfs which avoids the problem, but we probably need to fix it in libhdfs itself.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bockelman Brian Bockelman
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: