Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 2586 invoked from network); 8 Jul 2009 22:07:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Jul 2009 22:07:28 -0000 Received: (qmail 37999 invoked by uid 500); 8 Jul 2009 22:07:37 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 37930 invoked by uid 500); 8 Jul 2009 22:07:37 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 37829 invoked by uid 99); 8 Jul 2009 22:07:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jul 2009 22:07:37 +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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jul 2009 22:07:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 106D429A001A for ; Wed, 8 Jul 2009 15:07:15 -0700 (PDT) Message-ID: <1699234684.1247090835066.JavaMail.jira@brutus> Date: Wed, 8 Jul 2009 15:07:15 -0700 (PDT) From: "Rick Curtis (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-1168) NPE in UUIDGenerator.initializeForType1() In-Reply-To: <2053572264.1247090475560.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-1168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Curtis updated OPENJPA-1168: --------------------------------- Patch Info: [Patch Available] Assignee: (was: Rick Curtis) > NPE in UUIDGenerator.initializeForType1() > ----------------------------------------- > > Key: OPENJPA-1168 > URL: https://issues.apache.org/jira/browse/OPENJPA-1168 > Project: OpenJPA > Issue Type: Bug > Components: lib > Reporter: Rick Curtis > Fix For: 1.3.0, 2.0.0 > > Attachments: OPENJPA-1168.patch > > > When UUIDGenerator.createType1() is called by more than one thread at *nearly* the same time AND UUIDGenerator.createType1() wasn't called previously, a small timing window exists where a NPE will result. > Scenario: > Thread 1 calls UUIDGenerator.createType1() and RANDOM == null so initializeForType1() is called. While that thread is in initializeForType1(), it sets the static variable RANDOM so that value is no longer null. Now Thread 2 calls UUIDGenerator.createType1() and RANDOM is no longer null, so it proceeds to the call System.arraycopy(IP, 0, uuid, 10, IP.length);. At this point Thread 1 hasn't got to initializing IP yet, so Thread 2 gets hits a NPE. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.