Microsoft KB Archive/160670

= FPSCR is Not Being Saved Across Thread Context Switches =

PSS ID Number: 160670

Article Last Modified on 8/9/2001

-

The information in this article applies to:


 * Microsoft Windows NT Workstation 4.0
 * Microsoft Windows NT Server 4.0

-



This article was previously published under Q160670



SYMPTOMS
The FPSCR (Floating Point Status and Control Register) is not being saved during the thread context save/restore procedure. It may cause an invalid floating-point exception mask.

NOTE: This problem happens on PowerPC-based computers only.



CAUSE
When a process has multiple threads, the FPSCR register is not being saved during the thread context save restore procedure. It is being treated as a per process resource rather than a per thread resource.

For example:

The first thread in a process unmasks a floating point exception, for example divide by zero, and then spawns another thread and waits for it to exit. The other thread unmasks a different exception, for example underflow, and then exits. When the first thread gets scheduled, the FPSCR register is set to underflow being unmasked, but divide by zero being masked. Thus, when the first thread executes, the FPSCR register is set to the state left by the second thread.



STATUS
Microsoft has confirmed this to be a problem in Windows NT version 4.0. This problem was corrected in the latest Microsoft Windows NT 4.0 U.S. Service Pack. For information on obtaining the service pack, query on the following word in the Microsoft Knowledge Base (without the spaces):

S E R V P A C K

Additional query words: prodnt ppc powerpc Dr Watson

Keywords: kbHardware KB160670

Technology: kbWinNT400search kbWinNTS400 kbWinNTS400search kbWinNTsearch kbWinNTSsearch kbWinNTW400 kbWinNTW400search kbWinNTWsearch

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.