Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D152A173A8 for ; Wed, 25 Feb 2015 22:08:04 +0000 (UTC) Received: (qmail 64518 invoked by uid 500); 25 Feb 2015 22:08:04 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 64408 invoked by uid 500); 25 Feb 2015 22:08:04 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 64344 invoked by uid 99); 25 Feb 2015 22:08:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Feb 2015 22:08:04 +0000 Date: Wed, 25 Feb 2015 22:08:04 +0000 (UTC) From: "Thomas Neidhart (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MATH-1134) unsafe initialization in BicubicSplineInterpolatingFunction 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/MATH-1134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14337312#comment-14337312 ] Thomas Neidhart commented on MATH-1134: --------------------------------------- BicubicSplineInterpolatingFunction has been already been deprecated for 3.4 and now removed in 4.0 so I would suggest to close this issue or is there still anything planned for 3.5? > unsafe initialization in BicubicSplineInterpolatingFunction > ----------------------------------------------------------- > > Key: MATH-1134 > URL: https://issues.apache.org/jira/browse/MATH-1134 > Project: Commons Math > Issue Type: Bug > Affects Versions: 3.3 > Reporter: Derek Scherger > Priority: Minor > Attachments: MATH-1134.patch > > > The lazy initialization of the internal array of partialDerivatives in BicubicSplineInterpolatingFunction is not thread safe. If multiple threads call any of the partialDerivative functions concurrently one thread may start the initialization and others will see the array is non-null and assume it is fully initialized. If the internal array of partial derivatives was initialized in the constructor this would not be a problem. > i.e. the following check in partialDerivative(which, x, y) > if (partialDerivatives == null) { > computePartialDerivatives(); > } > will start the initialization. However in computePartialDerivatives() > partialDerivatives = new BivariateFunction[5][lastI][lastJ]; > makes it appear to other threads as the the initialization has completed when it may not have. -- This message was sent by Atlassian JIRA (v6.3.4#6332)