harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Popov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-5019) [jdktools][jpda] Agent has to ensure that all of its threads are terminated when Agent_OnUnload exits
Date Thu, 25 Oct 2007 15:51:50 GMT

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

Ivan Popov commented on HARMONY-5019:
-------------------------------------

This issue relates to the pending JDWP agent issue HARMONY-3269 for improving agent's cleanup
procedure, which in turn depends on the DRLVM problem with safely destroying daemon threads
HARMONY-4029.

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


Mime
View raw message