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

java -native fails trying to use an user defined class loader

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description



      Name: kaC94536 Date: 12/02/99



      The following test, being run with native threads, causes SIGSEGV on Linux
      and passes well on Solaris. I tryed various class loaders, but it seems
      that Linux JVM just can not invoke findClass(String) method.

      ------------------------------ test.java ------------------------------

      public class test {

        public static void main(String argv[]) {

          try {
              new KlassLoader().loadClass("oops");
          } catch (Throwable e) {
              System.out.println(e);
          }
          System.out.println("Ok");
        }
      }

      class KlassLoader extends ClassLoader {

        protected Class findClass(String name) {
          return null;
        }
      }

      -------------------------------- output -------------------------------

      $ java -native -version
      java version "1.2.2"
      Classic VM (build 1.2.2-G, native threads, javacomp)
      $ java -native test
      method unknown
      SIGSEGV 11* segmentation violation
      $ java test
      Ok
      $

      ======================================================================

      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hongzh Hong Zhang
              Reporter:
              kanisimosunw Konstantin Anisimov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: