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

socket/revc lock problem on green_threads

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.1.1, 1.1.4, 1.1.5
    • hotspot
    • generic, x86, sparc
    • solaris_2.5.1, windows_nt

      Green_thread locks on socket recv call on native program.
      It seems to me that green_thread's iomgr implementation intercepts the socket recv/send calls in order to incorporate into the thread locking mechanism. However, when the recv/send call is called via native method of child process, the interception of socket call fails.

      When I ran this on java_g on dbx, and followed the child process, libjava object
      was not loaded for child process space.


      Sybase test case:

      Please see the attached zip file.

      To run test:

      GREEN THREADS:

      Program never TERMINATES

      /usr/local/java/jdk1.1.4/solaris/bin/java HelloWorld
      Child: calling execl()
      Child: pipe handle is 7
      Child: socket set to listen
      Child: notifying parent
      Child: calling accept()
      Parent: waiting for child to initialize
      Child: accept() completed
      Child: waiting for 48 bytes
      Parent: sending 48 bytes
      Child: got 48 bytes
      Child: sleeping to let client do recv() before we send()
      Parent: sent 48 bytes
      Parent: waiting for 48 bytes
      ...

      NATIVE THREADS

      Run correctly:

      THREADS_FLAG=native /usr/local/java/jdk1.1.4/solaris/bin/java HelloWorld
      Child: calling execl()
      Child: pipe handle is 9
      Child: socket set to listen
      Child: notifying parent
      Child: calling accept()
      Parent: waiting for child to initialize
      Child: accept() completed
      Child: waiting for 48 bytes
      Parent: sending 48 bytes
      Child: got 48 bytes
      Child: sleeping to let client do recv() before we send()
      Parent: sent 48 bytes
      Parent: waiting for 48 bytes
      Child: sending 48 bytes
      Child: sent 48 bytes
      Parent: got 48 bytes
      Calling native_foo with value 99 returned 1
      Calling native_bar with value 99 returned 98

      NOTE: I just tried this with Solaris 2.6 + JDK 1.1.4 and it appears to
            work! Of course, the customer needs it to work on SOlaris 2.5.1
            + JDK 1.1.4...lets talk!

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

      Calling recv() from within a native method
      can sometimes hang an application.



            never Tom Rodriguez
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: