Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 22333 invoked from network); 20 Jun 2007 12:26:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jun 2007 12:26:49 -0000 Received: (qmail 81945 invoked by uid 500); 20 Jun 2007 12:26:52 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 81923 invoked by uid 500); 20 Jun 2007 12:26:52 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 81600 invoked by uid 99); 20 Jun 2007 12:26:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jun 2007 05:26:51 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jun 2007 05:26:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1C1DC71404B for ; Wed, 20 Jun 2007 05:26:26 -0700 (PDT) Message-ID: <8727530.1182342386112.JavaMail.jira@brutus> Date: Wed, 20 Jun 2007 05:26:26 -0700 (PDT) From: "Pavel Pervov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-4238) [drlvm][kernel] Race conditions in statics initialization In-Reply-To: <7026659.1182266727135.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-4238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506510 ] Pavel Pervov commented on HARMONY-4238: --------------------------------------- This issue is more generic than HARMONY-4230 though. > [drlvm][kernel] Race conditions in statics initialization > --------------------------------------------------------- > > Key: HARMONY-4238 > URL: https://issues.apache.org/jira/browse/HARMONY-4238 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Environment: Windows > Reporter: Pavel Pervov > > It is known problem on Windows - statics are compiled the way their initialization is not thread safe. > The construct like this: > void bar() { > static A* a = new A(); > a->foo(); > } > may produce access violation. > I suggest changing that code to > void bar() > { > static A a; > if(a == NULL) { > a = new A(); > } > a->foo(); > } > This may produce multiple initializations but if we can guarantee that second (and all subsequent) initialization returns the same result - it is false-positive. > I fixed one place described in HARMONY-4230 but about 4 more places are left in kernel classes' natives which are sources of such race conditions. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.