Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6679

Possible Atomicity Violation in BaseMonitor.shutdown()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.10.2.0
    • Fix Version/s: None
    • Component/s: Services
    • Labels:
      None
    • Environment:
      all
    • Urgency:
      Normal

      Description

      I'm developing a tool for atomicity violation detection and I think it have found an atomicity violations in derby.

      In org.apache.derby.impl.services.monitor.BaseMonitor there might be an atomicity violation in method shutdown(), lines 181-206:

      		for ( ; ; ) {
      			synchronized (this) {
       181:    		position = services.size()  - 1;
      			if (position == 0)
      				break;
                                     ...
      	        	}
                             ...
      	        }
      	       ...
      206:	      ((TopService) services.get(0)).shutdown();
      

      Between the execution of lines 181 and 206 a concurrent thread may remove the only remaining service, causing the access to "services" in line 206 to fail.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              orium Diogo Sousa
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: