Issue Details (XML | Word | Printable)

Key: LOGCXX-17
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Curt Arnold
Reporter: Giora Kosoi
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Log4cxx

Use of non reentrant time functions

Created: 03/Oct/04 04:27 PM   Updated: 13/Nov/04 02:53 AM
Return to search
Component/s: None
Affects Version/s: 0.9.7
Fix Version/s: 0.10.0

Time Tracking:
Not Specified

Environment: SunOS BMachine 5.8 Generic_108528-27 sun4u sparc SUNW,Sun-Fire-V210

Resolution Date: 13/Nov/04 02:53 AM


 Description  « Hide
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


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Curt Arnold added a comment - 13/Nov/04 02:53 AM
The time formatting code has been reworked to use Apache Portable Runtime and should no longer contain non-reentrant calls.

Curt Arnold made changes - 13/Nov/04 02:53 AM
Field Original Value New Value
Assignee Michaël CATANZARITI [ mcatan ] Curt Arnold [ carnold@apache.org ]
Fix Version/s 0.9.8 [ 10782 ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]