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

poll() on Solaris runtime (iomgr.c) incorrectly handles timeout = 0 case

XMLWordPrintable

    • 1.1
    • sparc
    • solaris_2.5.1
    • Not verified


      The symptom that Sybase sees is that when a native method call to poll(), with timeout set to zero occurs, instead of simply returning immediately (which is the documented API for poll()), their engine hangs forever.

      The Solaris green-threads version of Java runtime (VM) interposes on various system calls, including poll() in iomgr.c. Any native method calls to poll() then get bound to Java's definition of poll().

      It appears that if the timeout argument to poll() is set to zero, Java's poll() wrapper does not handle this case correctly. It waits infinitely.

      iomgr.c / poll() code does not have an exit condition for when timeout = 0 AND retval = 0. It simply waits in:

      sysMonitorWait(asyncMon(SYS_ASYNC_MON_IO),
      timeout > 0 ? timeout : SYS_TIMEOUT_INFINITY, FALSE);
      ^^^^^^^^^^^^^^^^^^^
      to infinite time!

            tlindholsunw Timothy Lindholm (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: