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

JVM_SocketAvailable uses long*. Should be 32bit pointer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 1.4.0, 5.0
    • hotspot
    • b43
    • generic, sparc
    • generic, solaris_8

      Name: wm7046 Date: 02/19/2004


      The J2SE jvm.h header file declares JVM_SocketAvailable as:

           JVM_SocketAvailable(jint fd, jint *result);

      whereas the HotSpot copy uses:

           JVM_SocketAvailable(jint fd, long *result);

      These are inconsistent (and plain wrong) on a 64-bit LP64 platform.

      This bug is essentially a clone of 4507280, which correctly states that the result pointer must actually be a pointer to a 32-bit quantity, but that bug was closed based on the presumption the HPI interface would be removed. That has not been done for 1.5, so this inconsistency should be fixed. The JRE socket code on Solaris doesn't use this call by the looks (it calls ioctl directly), so it's just a matter of cleaning the code up for those of us who have to build and/or port it where the HPI interface is used.

      Both the JVM_SocketAvailable() and the HPI Socket Interface Available() signature need to be changed to take jint * - as the call has always passed the pointer all the way through to the ioctl() call, actually passing a long would give bogus results (as described in 4507280).

      Ken Russell (at Sun) also came across this problem.
      (Incident Review ID: 238698)
      ======================================================================
      ###@###.### 2005-1-13 23:54:49 GMT

            psoper Pete Soper (Inactive)
            mmma Marvin Ma (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: