You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Gregory Shimansky (JIRA)" <ji...@apache.org> on 2007/10/25 14:20:50 UTC

[jira] Updated: (HARMONY-5019) [jdktools][jpda] Agent has to ensure that all of its threads are terminated when Agent_OnUnload exits

     [ https://issues.apache.org/jira/browse/HARMONY-5019?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky updated HARMONY-5019:
---------------------------------------

    Summary: [jdktools][jpda] Agent has to ensure that all of its threads are terminated when Agent_OnUnload exits  (was: [jdktools][jpda] Agent has to unsure that all of its threads are terminated when Agent_OnUnload exits)

> [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
>            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.