Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 10693 invoked from network); 8 Dec 2006 23:50:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Dec 2006 23:50:23 -0000 Received: (qmail 57849 invoked by uid 500); 8 Dec 2006 23:50:29 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 57830 invoked by uid 500); 8 Dec 2006 23:50:29 -0000 Mailing-List: contact dev-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 dev@harmony.apache.org Received: (qmail 57821 invoked by uid 99); 8 Dec 2006 23:50:29 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Dec 2006 15:50:29 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of alexei.fedotov@gmail.com designates 64.233.182.186 as permitted sender) Received: from [64.233.182.186] (HELO nf-out-0910.google.com) (64.233.182.186) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Dec 2006 15:50:18 -0800 Received: by nf-out-0910.google.com with SMTP id a4so1316986nfc for ; Fri, 08 Dec 2006 15:49:56 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=b5xvV7YIwvrRG75Z91aV+dGVOUG/0jdMVvpJ4XLS06LigcdkrTdNYl48WS7VRlU7lO/8q9NjGE52wvzMkmUTMWILgOINXFgODZrj0lZZ7AJNDDbtI+cx/n3oMw1DGwSRAVpt3WWjiYco0owFM6wd5cT3KOv7IdrJanMUcsp0QIM= Received: by 10.82.179.9 with SMTP id b9mr497798buf.1165621796454; Fri, 08 Dec 2006 15:49:56 -0800 (PST) Received: by 10.78.133.6 with HTTP; Fri, 8 Dec 2006 15:49:56 -0800 (PST) Message-ID: Date: Fri, 8 Dec 2006 15:49:56 -0800 From: "Alexei Fedotov" To: dev@harmony.apache.org Subject: Re: [drlvm][ti] thread unsafe global list of compiled stubs In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org Gregory, Thank you for explaining. As far as I unerstand writing to the thread unsafe list is enough to cause segmentation fault on smp. You need to update two fields, and this cannot be done atomically. According to the wiki page [1] I need to cleanup CodeChunkInfo structures anyway. Access to the code chunks is synchronized via method locks. I believe it would be a good idea to unify these chunk storages. Won't you object? [1] http://wiki.apache.org/harmony/Code_Inspection%3a_compile%2ecpp On 12/8/06, Gregory Shimansky wrote: > Alexei Fedotov wrote: > > Gregory, Ilya, TI gurus, > > > > Could you please help me to understand why do we need a global list of > > ia32 specific code chunks VM_Global_State::loader_env->dcList? Cannot > > we use good old CodeChunkInfo structure? > > The information contained in dcList is different from CodeChunks. It > contains generated stubs which are not compiled Java methods. It is > necessary for GenerateEvents [1] function implementation with > JVMTI_EVENT_DYNAMIC_CODE_GENERATED argument. An agent may request to > receive all missed DynamicCodeGenerated events which it could have > missed, and therefore it is necessary to store information about > generated stubs in VM. > > > I have noticed that access to the list is not thread safe (you put > > TODO comment here). Does it mean we have some intermittent crashes due > > to this issue? > > Yes, this FIXME stands true. It is possible to get a race condition if > you run a profiling JVMTI agent which uses GenrateEvents function while > multithreaded application is executed. > > But in the normal mode when JVMTI is not used this list is only written, > and never used. I think that compile_add_dynamic_generated_code_chunk > should have a check that ti->isEnabled(), or it is just wasting the memory. > > [1] > http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html#GenerateEvents > > -- > Gregory > > -- With best regards, Alexei, ESSD, Intel