Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 5375 invoked from network); 26 Oct 2007 17:11:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2007 17:11:14 -0000 Received: (qmail 82897 invoked by uid 500); 26 Oct 2007 17:11:01 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 82883 invoked by uid 500); 26 Oct 2007 17:11:01 -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 82869 invoked by uid 99); 26 Oct 2007 17:11:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Oct 2007 10:11:01 -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; Fri, 26 Oct 2007 17:11:14 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B8577714233 for ; Fri, 26 Oct 2007 10:10:50 -0700 (PDT) Message-ID: <27178155.1193418650738.JavaMail.jira@brutus> Date: Fri, 26 Oct 2007 10:10:50 -0700 (PDT) From: "Gregory Shimansky (JIRA)" To: commits@harmony.apache.org Subject: [jira] Closed: (HARMONY-5019) [jdktools][jpda] Agent has to ensure that all of its threads are terminated when Agent_OnUnload exits In-Reply-To: <4160994.1193312750977.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-5019?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gregory Shimansky closed HARMONY-5019. -------------------------------------- Resolution: Fixed With fix for HARMONY-3269 and VM side patch to call Agent_OnUnload before killing threads all tests don't crash any more on Linux x86_64! Committed and verified at 588713. > [jdktools][jpda] Agent has to ensure that all of its threads are terminated when Agent_OnUnload exits > ----------------------------------------------------------------------------------------------------- > > Key: HARMONY-5019 > URL: https://issues.apache.org/jira/browse/HARMONY-5019 > Project: Harmony > Issue Type: Bug > Components: JDK > Environment: Linux x86_64 > Reporter: Gregory Shimansky > Assignee: Gregory Shimansky > Priority: Critical > > In the current version of harmony agent doesn't join its EventDispatcher and PacketDispatcher threads when Agent_OnUnload completes. It in fact just deletes monitors that are held by these threads, but threads may still be running when Agent_OnUnload exits. The bad thing is immediately after that agent's library is unloaded from address space of the process. The good thing (for agent) is that in most cases it is executing VM's code of exiting monitors, so it doesn't execute unmapped memory and the crash doesn't happen right away. Also unmapped memory doesn't always mean unexecutable. On x86 architectures unmapped memory may still be executable because NX (no execution) bit is usually disabled by OSes on this architecture. > The bad things happen on Linux x86_64 because it enables NX bit for user applications by default. Crashes happen on shutdown almost in 100% of runs. There are several different scenarios but all of them relate to accessing agent's address space where its library once was loaded. This happens because agent's threads are still running when agent's library is unloaded. > I found some code that is commented in agent that could join in EventDispatcher and PacketDispatcher threads on VM_DEATH phase change. The code is commented since revision 544123 that was a workaround for VM's inability to join threads correctly on shutdown. I uncommented Join calls but still I get a dead lock on shutdown. Investigation continues. Without fix for this bug enabling debugging on Linux x86_64 isn't possible. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.