Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 6197 invoked from network); 28 Dec 2007 13:14:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Dec 2007 13:14:05 -0000 Received: (qmail 36886 invoked by uid 500); 28 Dec 2007 13:13:53 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 36862 invoked by uid 500); 28 Dec 2007 13:13:53 -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 36853 invoked by uid 99); 28 Dec 2007 13:13:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Dec 2007 05:13:53 -0800 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; Fri, 28 Dec 2007 13:13:39 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 04B2A71423B for ; Fri, 28 Dec 2007 05:13:44 -0800 (PST) Message-ID: <18788784.1198847624017.JavaMail.jira@brutus> Date: Fri, 28 Dec 2007 05:13:44 -0800 (PST) From: "Ilya Leviev (JIRA)" To: commits@harmony.apache.org Subject: [jira] Resolved: (HARMONY-4094) [drlvm][thread][tc]Race condition at "thread_java_basic.c":519 and "thread_native_suspend.c":301 at hythread_resume and jthread_sleep functions In-Reply-To: <3847528.1181220446351.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-4094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ilya Leviev resolved HARMONY-4094. ---------------------------------- Resolution: Fixed > [drlvm][thread][tc]Race condition at "thread_java_basic.c":519 and "thread_native_suspend.c":301 at hythread_resume and jthread_sleep functions > ----------------------------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-4094 > URL: https://issues.apache.org/jira/browse/HARMONY-4094 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Reporter: Ilya Leviev > Attachments: SourceViewScreenshot-1.jpg > > > Race condition at "thread_java_basic.c":519 and "thread_native_suspend.c":301 at hythread_resume and jthread_sleep functions > TC report on thread unsafe access to "state" field that result in race condition that occur during concurrent execution of hythread_resume and jthread_sleep functions. > Write -> Write data-race > Memory write at "thread_java_basic.c":519 conflicts with a prior memory write at "thread_native_suspend.c":301 > Stack Trace: > Context > Function __int64 Jitrino::Jet::rt_h_i64_a(__int64,__int64,enum JavaByteCodes) "arith_rt.cpp":218 > Function class VM_thread * get_thread_ptr_stub(void) "thread_manager.cpp":138 > Function m2n_free_local_handles "m2n_ia32.cpp":268 > Function class VM_thread * get_thread_ptr_stub(void) "thread_manager.cpp":138 > Function m2n_free_local_handles "m2n_ia32.cpp":268 > Function int Jitrino::Jet::rt_h_lcmp(__int64,__int64) "arith_rt.cpp":69 > Function class VM_thread * get_thread_ptr_stub(void) "thread_manager.cpp":138 > Function hythread_suspend_enable "hythread_ext.h":373 > Function Java_java_lang_VMThreadManager_sleep "java_lang_vmthreadmanager.cpp":140 > Function jthread_sleep "thread_java_basic.c":514 > 1st Access > Function double Jitrino::Jet::rt_h_flt_2_dbl(float) "arith_rt.cpp":294 > Function double Jitrino::Jet::rt_h_neg_dbl64(double) "arith_rt.cpp":49 > Function int Jitrino::Jet::rt_h_dcmp_l(double,double) "arith_rt.cpp":110 > Function int Jitrino::Jet::rt_h_lcmp(__int64,__int64) "arith_rt.cpp":70 > Function class VM_thread * get_thread_ptr_stub(void) "thread_manager.cpp":138 > Function vm_get_gc_thread_local "c_interface.cpp":2414 > Function gc_alloc_fast "mutator_alloc.cpp":120 > Function hythread_thin_monitor_try_enter "thread_native_thin_monitor.c":343 > Function unreserve_lock "thread_native_thin_monitor.c":210 > Function hythread_resume "thread_native_suspend.c":301 > "299" "" " // change thread state" > "300" "" " hymutex_lock(&thread->mutex);" > "301" "*" " thread->state &= ~TM_THREAD_STATE_SUSPENDED;" > "302" "" " hymutex_unlock(&thread->mutex);" > 2nd Access > Function __int64 Jitrino::Jet::rt_h_i64_a(__int64,__int64,enum JavaByteCodes) "arith_rt.cpp":218 > Function class VM_thread * get_thread_ptr_stub(void) "thread_manager.cpp":138 > Function m2n_free_local_handles "m2n_ia32.cpp":268 > Function class VM_thread * get_thread_ptr_stub(void) "thread_manager.cpp":138 > Function m2n_free_local_handles "m2n_ia32.cpp":268 > Function int Jitrino::Jet::rt_h_lcmp(__int64,__int64) "arith_rt.cpp":69 > Function class VM_thread * get_thread_ptr_stub(void) "thread_manager.cpp":138 > Function hythread_suspend_enable "hythread_ext.h":373 > Function Java_java_lang_VMThreadManager_sleep "java_lang_vmthreadmanager.cpp":140 > Function jthread_sleep "thread_java_basic.c":519 > "514" "" " IDATA jthread_sleep(jlong millis, jint nanos) {" > "515" "" " " > "516" "" " hythread_t tm_native_thread = hythread_self();" > "517" "" " IDATA status;" > "518" "" " " > "519" "*" " tm_native_thread->state &= ~TM_THREAD_STATE_RUNNABLE;" > "520" "" " tm_native_thread->state |= TM_THREAD_STATE_WAITING | TM_THREAD_STATE_SLEEPING |" > "521" "" " TM_THREAD_STATE_WAITING_WITH_TIMEOUT;" > See also Source View screenshot > If it not affect correctness of execution I will mark it by special API for prevention of further alarms on this race. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.