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

JDWP: Loading twice is not properly handled. Misleading error message.

    XMLWordPrintable

Details

    • b65
    • generic
    • generic

    Description

      FULL JDK VERSION(S)
      java version "1.5.0_04"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
      Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode)
      DESCRIPTION:
      launching java with -Xrunjdwp (or agentlib:jdwp) specified twice (as can happen
      easily through script errors in an invocation script) results in the unhelpful
      error message:
         ERROR: JDWP unable to get necessary JVMTI capabilities. ["debugInit.c",L279]
      ...and the JVM terminates. This does not give the user any useful information on
      the cause of the failure.
      JDWP was clearly never coded to be loaded multiple times, its onload routine sets
      various static variables and memsets to zeroes a global static area "gdata".
      That is not the issue here.
        
      The issue is that it does not protect itself against such user error. It does not
      check that it has not already been loaded and will blithely overwrite any previous
      settings and continue executing. However it then hits an error it cannot handle
      and terminates with a misleading error message.
      example command to produce the problem:
      java -Xrunjdwp:transport=dt_socket,address=8000
           -Xrunjdwp:transport=dt_socket,address=8000 HelloWorld
      ERROR: JDWP unable to get necessary JVMTI capabilities. ["debugInit.c",L279]
      [This bug is being submitted as a courtesy, in order to maintain uniformity between Sun & IBM JDKs. It has been fixed in IBM JDKs.
      Please contact ###@###.### if you have questions.]

      Attachments

        Issue Links

          Activity

            People

              ohair Kelly Ohair (Inactive)
              elarsen Erik Larsen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: