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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux_redhat_3.0

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: