KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q23856: Code that Will Hang IBM XTs or Compatibles

Article: Q23856
Product(s): See article
Version(s): 1.00
Operating System(s): MS-DOS
Keyword(s): ENDUSER | TAR57675 buglist1.00 | mspl13_basic
Last Modified: 8-NOV-1988

Problem:

The following code will hang IBM XTs or compatibles if specific
commands are issued when inside of CodeView:

   #include <stdio.h>
   main()
   {
        int n;
        double f;

        while(1)   {
                   scanf("%d",&n);
               f=1.0;
               while (n>1) f=f*n--;
                  printf("%.101g%c",f,'\n');
                   }
   }

For the program to fail in CodeView, first set a breakpoint at
instruction f=1.0. Issue the Go command, then the P command.

Response:

This is corrected in CodeView version 2.20.

A workaround is to place a breakpoint at the instruction before or
after the assignment to f.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.