This hang is discovered through bug 4528190 (JCK1.4: api/java_rmi/server/RemoteStub/serial/index.html#Input hangs, linux).
VM hangs on Linux under this scenario:
1) A new baby thread is created, its state is INITIALIZED. On Linux, it
is blocked in osthread->interrupt_event()->down().
2) The thread is suspended by profiler, its state remains INITIALIZED
3) Someone starts the thread by calling os::start_thread(). We move it to
"true" suspended state by changing its state to SUSPENDED
4) Profiler resumes the thread. resume_thread_impl() treats it as a normally
suspended thread. But it's not. os::pd_resume_thread() cannot start a
thread that is blocked in osthread->interrupt_event()->down().
VM hangs on Linux under this scenario:
1) A new baby thread is created, its state is INITIALIZED. On Linux, it
is blocked in osthread->interrupt_event()->down().
2) The thread is suspended by profiler, its state remains INITIALIZED
3) Someone starts the thread by calling os::start_thread(). We move it to
"true" suspended state by changing its state to SUSPENDED
4) Profiler resumes the thread. resume_thread_impl() treats it as a normally
suspended thread. But it's not. os::pd_resume_thread() cannot start a
thread that is blocked in osthread->interrupt_event()->down().