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

strerror() isn't thread-safe in linux system and should not be called, but strerror_r() in 1.4.2/5.0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 5.0
    • hotspot
    • x86
    • linux_redhat_3.0

      A customer send a report related to the possibility of dead lock or hang.

      INVESTIOGATION :
      - When some error occurs in some portion described in c language under j2se directory.
      - The current error handling flow in 1.4.2 and 5.0 is as follows.
          (upper line is caller, lower line is callee)
           JVM_GetLastError
            --> sysGetLastErrorString() (hpi)
                  ---> strerror()
          At sterror(). the error message is extracted.

      PROBLEM :
        The strerror is thread-safe in Solaris system, but not seem in linux.
        According to the "man" in linux system(RHEL3), strerror_r() is thread-safe

        "The strerror_r() function is similar to strerror(), but is thread safe.
         It returns the string in the user-supplied buffer buf of length n."
        
      REQUEST :
        to change the JDK source code to use strerror_r() for linux edition


      ###@###.### 2005-2-01 07:32:37 GMT

            hhuangsunw Hui Huang (Inactive)
            tbaba Tadayuki Baba (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: