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

NEWHPROF: hprof_listener.c in newhprof terminates with incorrect exit message.

XMLWordPrintable

    • b46
    • generic
    • generic

      Please look at the following test scenario.

      In terminal 1 , user started a listening server on a given port which can I/O.

      In terminal 2, user started any standard application in tiger JDK with hprof enabled

      Example: /import/java/jdk1.5.0/solaris-sparc/bin/java -agentlib:hprof=net=localhost:4900 -jar /import/java/jdk1.5.0/solaris-sparc/demo/jfc/Java2D/Java2Demo.jar -runs=1 -delay=5

      Then hprof starts pumping the hprof data over the network socket established on the localhost:4900. The hprof dump is displayed in the listening server terminal which started in terminal one. The same socket can be used to send any of the HPROF commands like HPROF_CMD_GC, HPROF_CMD_DUMP_HEAP, HPROF_CMD_ALLOC_SITES etc in their appropriate byte formats back to the application terminal two to make HPROF execute the commands.

      Now, instead of sending a valid command, user sends in a meaningless command and in that case, the HPROF agent should exit with proper error message instead of a wrong exit

       HPROF ERROR: failed to recognize cmd 5, exiting.. [../../../src/share/tools/newhprof/hprof_listener.c:335]

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

      Steps to reproduce:

      Compile and start the listening server which opens a socket on port 4900 in terminal ONE.

      in terminal TWO, execute the following command

      /import/java/jdk1.5.0/solaris-sparc/bin/java -agentlib:hprof=net=localhost:4900 -jar /import/java/jdk1.5.0/solaris-sparc/demo/jfc/Java2D/Java2Demo.jar -runs=1 -delay=5

      You will get an error message with hprof exit in terminal two as follows

      HPROF ERROR: failed to recognize cmd 5, exiting.. [../../../src/share/tools/newhprof/hprof_listener.c:335]


      which is an invalid exit code.


       
      LISTENING SERVER CODE IS ATTACHED.

            ohair Kelly Ohair (Inactive)
            mnandigasunw Murali Nandigama (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: