Log4cxx
  1. Log4cxx
  2. LOGCXX-17

Use of non reentrant time functions

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.7
    • Fix Version/s: 0.10.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      SunOS BMachine 5.8 Generic_108528-27 sun4u sparc SUNW,Sun-Fire-V210

      Description

      When using %d for ConversionPattern the application crushes. this is caused by use of non reentrant time functions
      gmtime and localtime

      the solution is to replace these functions with gmtime_r and localtime_r for posix builds.

      struct tm tmResult;
      const tm * tm = ::gmtime_r(&time, &tmResult);

      i did it and it works fine.

      i am going to run some more tests on other sun machines and i hope i can help more in the future.

      Thanks for the great logging system
      Giora

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        40d 10h 25m 1 Curt Arnold 13/Nov/04 02:53
        Curt Arnold made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 0.9.8 [ 10782 ]
        Assignee Michaël CATANZARITI [ mcatan ] Curt Arnold [ carnold@apache.org ]
        Hide
        Curt Arnold added a comment -

        The time formatting code has been reworked to use Apache Portable Runtime and should no longer contain non-reentrant calls.

        Show
        Curt Arnold added a comment - The time formatting code has been reworked to use Apache Portable Runtime and should no longer contain non-reentrant calls.
        Giora Kosoi created issue -

          People

          • Assignee:
            Curt Arnold
            Reporter:
            Giora Kosoi
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development