JDK-6907418 : Jvm hangs due to a deadlock involving new thread creation with JNI when done from dllMain
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 6u18
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows
  • CPU: x86
  • Submitted: 2009-12-04
  • Updated: 2010-08-30
  • Resolved: 2010-08-27
Related Reports
Relates :  
Description
1) Run Space.bat.
2) Run Feeder.bat. The feeder console prints a message every 1000 updates, so you can tell it's running.
3) Run Processor.bat, and wait for the deadlock, indicated by repetitive messages like: "Failed to stop Worker #X on attempt #Y, retrying..."

Background
----------
GigaSpaces is an Application Server which implements JavaSpaces. The case is composed of 3 processes working with a space:
1) Space.bat starts a process which hosts a space. This space is used by the other processes to share data. There is no problem with that process.
2) Feeder.bat connects to the space and continously updates entries in it. There is no problem with that process.
3) Processor.bat connects to the space, opens 100 threads and waits for them to
finish. Each thread subscribes to update notifications from the space (which are triggered by the feeder process), sleeps for 1 second then removes the notification subscription. If all 100 threads finish normally, the processor exits normally, but quite often it hangs, producing the deadlock described in the case. To
make reproduction easier, Processor.bat runs the processor 100 times consecutively.