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

Exception ignored in while debugging class loaded by custom loader

    Details

    • Subcomponent:
    • Resolved In Build:
      b02
    • CPU:
      sparc
    • OS:
      solaris_2.6
    • Verification:
      Not verified

      Backports

        Description

        While debugging an application that uses a custom class loader (JLoader) to load classes (Catcher and Thrower) it is discovered that exceptions thrown by Thrower are not caught in Catcher. If the application is run without the debugger the exceptions are processed correctly.

        This is a priority 1 issue for the vendor - limits their ability to provide debugging with their product.

        A test case to recreate the problem is attached.

         ** The test case has four classes:
         **
         ** (1) BugMain (this class), which is the test driver.
         **
         ** (2) JLoader, a cut-down form of the custom class loader.
         **
         ** (3) Catcher, a class which is custom-loaded and whose constructor
         ** attempts to catch an exception thrown by the throwSomething()
         ** method on class Thrower. Note: it does not seem to matter
         ** whether the constructor or an ordinary method in the Catcher
         ** class is used. This reproduction uses the constructor for brevity.
         **
         ** (4) Thrower, a class which is custom-loaded and whose throwSomething()
         ** method throws an exception. Note: it does not seem to matter what
         ** class of exception is thrown.

         ** Expected output, appears with java or java_g when -debug is not used.
         **
         ** > java_g BugMain
         ** Warning: JIT compiler "symcjit" not found. Will use interpreter.
         ** Loading: Catcher.class
         ** Catcher()
         ** Loading: Thrower.class
         ** Thrower()
         ** --- try
         ** throwSomething()
         ** --- catch
         ** java.lang.Exception: the exception message
         ** at Thrower.throwSomething(Thrower.java:11)
         ** at Catcher.<init>(Catcher.java:10)
         ** at BugMain.main(BugMain.java:5)
         ** end Catcher()
         **
         ** Erroneous output, appears with java_g when -debug is used.
         **
         ** > java_g -debug BugMain
         ** Warning: JIT compiler "symcjit" not found. Will use interpreter.
         ** Agent password=52c49x
         ** Warning: JIT compiler "symcjit" not found. Will use interpreter.
         ** Loading: Catcher.class
         ** Catcher()
         ** Loading: Thrower.class
         ** Thrower()
         ** --- try
         ** throwSomething()
         ** *** after try !!! BUG BUG BUG !!!
         ** end Catcher()


          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: