FIX: Exception When Calling strftime() Function (193509)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Professional Edition 6.0
This article was previously published under Q193509 SYMPTOMS
Multithreaded applications may experience exceptions or incorrect results
when calling the C run-time library (CRT) strftime() function. This
behavior is particularly prevalent on multiprocessor machines.
CAUSE
The strftime() function is dependent on an internal pointer for locale-
related information that is necessary for formatting time and date strings.
This pointer is used, and can be modified, by other components of the CRT,
but is not protected for exclusive use within the strftime() function. This
allows other threads to modify the pointer while strftime() is using it.
RESOLUTION
The internal pointer is modified when calling the setlocale() CRT function.
To prevent the pointer from being inadvertently modified while being used,
use one of the following two workarounds:
- Call setlocale once before other threads are created.
- Synchronize access to functions that use locale information.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
This bug has been fixed in the Visual
Studio 6.0 Service Pack 1. To obtain this service pack, please see:
For more information on the Visual Studio 6.0 Service Pack 1, please see
the following articles in the Microsoft Knowledge Base:
| Modification Type: | Major | Last Reviewed: | 4/30/2006 |
|---|
| Keywords: | kbBug kbCRT kbfix kbVS600SP1fix kbVS600sp2fix KB193509 |
|---|
|