Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6381526

Unexpected async exception in jvmti_GetLoadedClasses()

    Details

    • Subcomponent:
    • Introduced In Version:
      5.0
    • Resolved In Build:
      b02
    • CPU:
      generic, sparc
    • OS:
      generic, solaris_10

      Backports

        Description

        Hi,

        the Hotspot crashes when a JVMTI agent tries to get all loaded classes
        triggered by a thread stop event and that dying thread has an async
        exception pending. You can reproduce the problem with the following
        small program:

        public class AsynchronousExceptionTest {
            public static void main(String[] args) {
                while (true) {
                    final Thread t1 = new Thread(new Runnable() {
                        public void run() {
                            try {
                                Thread.sleep((int) (Math.random() * 100));
                            } catch (InterruptedException e) {
                                // Ignore.
                            }

                            System.gc();
                        }
                    });

                    Thread t2 = new Thread(new Runnable() {
                        public void run() {
                            try {
                                Thread.sleep((int) (Math.random() * 100));
                                t1.stop();
                            } catch (InterruptedException e) {
                                // Ignore.
                            }
                        }
                    });

                    t1.start();
                    t2.start();

                    try {
                        t1.join();
                        t2.join();
                    } catch (InterruptedException e) {
                        // Ignore.
                    }
                }
            }
        }

        and starting the VM with the following commandline:
        java -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n AsynchronousExceptionTest

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  minqi Yumin Qi
                  Reporter:
                  duke J. Duke (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: