Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 57132 invoked from network); 12 Jan 2011 18:09:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Jan 2011 18:09:11 -0000 Received: (qmail 19804 invoked by uid 500); 12 Jan 2011 18:09:10 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 19655 invoked by uid 500); 12 Jan 2011 18:09:10 -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 19541 invoked by uid 99); 12 Jan 2011 18:09:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jan 2011 18:09:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jan 2011 18:09:09 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p0CI8mSg003554 for ; Wed, 12 Jan 2011 18:08:49 GMT Message-ID: <1737947.318451294855728842.JavaMail.jira@thor> Date: Wed, 12 Jan 2011 13:08:48 -0500 (EST) From: "Kathey Marsden (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-4960) Race condition in FileContainer#allocCache when reopening RAFContainer after interrupt In-Reply-To: <537563.201391294356045728.JavaMail.jira@thor> 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-4960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kathey Marsden updated DERBY-4960: ---------------------------------- Fix Version/s: 10.8.0.0 > Race condition in FileContainer#allocCache when reopening RAFContainer after interrupt > -------------------------------------------------------------------------------------- > > Key: DERBY-4960 > URL: https://issues.apache.org/jira/browse/DERBY-4960 > Project: Derby > Issue Type: Bug > Components: Store > Affects Versions: 10.8.0.0 > Reporter: Dag H. Wanvik > Assignee: Dag H. Wanvik > Fix For: 10.8.0.0 > > Attachments: derby-4960-1.diff, derby-4960-1.stat, derby-4960-2.diff, derby-4960-2.stat, InterruptTest.java > > > The symptom is an ArrayIndexOutOfBoundsException: > java.lang.ArrayIndexOutOfBoundsException: -1 > at org.apache.derby.impl.store.raw.data.AllocationCache.validate(AllocationCache.java:581) > at org.apache.derby.impl.store.raw.data.AllocationCache.getLastPageNumber(AllocationCache.java:122) > at org.apache.derby.impl.store.raw.data.FileContainer.pageValid(FileContainer.java:2067) > at org.apache.derby.impl.store.raw.data.FileContainer.getUserPage(FileContainer.java:2522) > at org.apache.derby.impl.store.raw.data.FileContainer.getInsertablePage(FileContainer.java:2867) > at org.apache.derby.impl.store.raw.data.FileContainer.getPageForInsert(FileContainer.java:3017) > at org.apache.derby.impl.store.raw.data.BaseContainerHandle.getPageForInsert(BaseContainerHandle.java:372) > at org.apache.derby.impl.store.access.heap.HeapController.doInsert(HeapController.java:244) > at org.apache.derby.impl.store.access.heap.HeapController.insertAndFetchLocation(HeapController.java:599) > at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(RowChangerImpl.java:452) > at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(InsertResultSet.java:1028) > at org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:505) > at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436) > at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317) > at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1241) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1686) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:308) > at InterruptTest$WorkerThread.run(InterruptTest.java:261 > This can only happen if another thread has called allocCache.reset while the thread above is in the loop in validate, so as to set numExtents to 0. > The synchronization of allocCache is documented in the Javadoc of the FileContainer class: all accesses to allocCache should synchronize. > This is omitted when we reopen: FileContainer#openContainer calls readHeader -> readHeaderFromArray -> allocCache.reset -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.