Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M10 (2.0.0.v20151221-M10)
    • Fix Version/s: 2.0.0-M11, 2.0.0-M12
    • Component/s: studio-ldapbrowser
    • Labels:
      None
    • Environment:
      x86_64, Linux Debian 8, GTK

      Description

      Hello,
      perhaps I am wrong, but I suspect myself of seeing a bug in Apache Directory Studio 2.0.0.v20151221-M10.

      In method EntryEditorManager.updateAutoSaveSharedReferenceCopy (runs in main thread):

      Firstly:
      -> EntryEditorUtils.ensureAttributesInitialized(entry);
      -> StudioBrowserJob runs InitializeAttributesRunnable in a thread
      -> InitializeAttributesRunnable.run
      -> initializeAttributes( entry, monitor ) -> initializeAttributes( entry, returningAttributes, true, monitor )
      -> entry.deleteAttribute( oldAttribute ) -> ai.attributeMap.remove(Strings.toLowerCase(oidString));

      Secondly:
      -> new CompoundModification().replaceAttributes(entry, workingCopy, this);
      -> fromEntry.getAttributes() -> ai.attributeMap.values()

      Thus, the 1st thread modifies ai.attributeMap and at the same time the 2nd thread reads it. Only initializeAttributes is synchronized, but on its class object.

      Is it not a race condition?

      Thank you. With regards Vaclav Havlik.

        Attachments

          Activity

            People

            • Assignee:
              seelmann Stefan Seelmann
              Reporter:
              havlikv Václav Havlík
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: