Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D9B4711219 for ; Tue, 29 Jul 2014 07:59:39 +0000 (UTC) Received: (qmail 4947 invoked by uid 500); 29 Jul 2014 07:59:39 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 4773 invoked by uid 500); 29 Jul 2014 07:59:39 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 4639 invoked by uid 99); 29 Jul 2014 07:59:39 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jul 2014 07:59:39 +0000 Date: Tue, 29 Jul 2014 07:59:39 +0000 (UTC) From: "Diogo Sousa (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DERBY-6679) Possible Atomicity Violation in BaseMonitor.shutdown() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-6679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Diogo Sousa updated DERBY-6679: ------------------------------- 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: {noformat} for ( ; ; ) { synchronized (this) { 181: position = services.size() - 1; if (position == 0) break; ... } ... } ... 206: ((TopService) services.get(0)).shutdown(); {noformat} 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. was: 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: {quote} for ( ; ; ) { synchronized (this) { 181: position = services.size() - 1; if (position == 0) break; ... } ... } ... 206: ((TopService) services.get(0)).shutdown(); {quote} 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. > Possible Atomicity Violation in BaseMonitor.shutdown() > ------------------------------------------------------ > > Key: DERBY-6679 > URL: https://issues.apache.org/jira/browse/DERBY-6679 > Project: Derby > Issue Type: Bug > Components: Services > Affects Versions: 10.10.2.0 > Environment: all > Reporter: Diogo Sousa > Priority: Minor > > 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: > {noformat} > for ( ; ; ) { > synchronized (this) { > 181: position = services.size() - 1; > if (position == 0) > break; > ... > } > ... > } > ... > 206: ((TopService) services.get(0)).shutdown(); > {noformat} > 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. -- This message was sent by Atlassian JIRA (v6.2#6252)