[comp.lang.c++] Possible bug in TC++

bower@hfsi.UUCP (Michael Bower Comm. ) (07/18/90)

I am having a curious "bug" occurr with my TC++ and I was wondering 
anybody has experienced this.  Or if others would like to try this
and let me know how your machine acts, I would also like that.

The "bug" is this.

1) Enter the environment.

2) Build a simple program that counts from 1 to 200

main()
{
int i;
for (i=1;i<201;i++) printf("\n%3d",i);
}

(I didn't say it was good code....:-))

3) start the program

4) after it has counted up a while, hit the ctrl-break key to
   stop the program.

On my machine at home, I get the following "gotcha".

At first the numbers are going by fairly fast.  After I hit the ctrl-break
keys, they continue but they slow down considerably.  If I hit the ctrl-break
keys AGAIN, I will drop OUT OF TC++ and BACK AT MY DOS PROMPT.  If I now
type "tc" again to enter the TC environment, my system LOCKS up to the point
that ctrl-alt-del won't even recover it.  I have to hit the reset button.

I tried this on a different machine and it would sometimes do the above and
sometimes stop like it should.  On a third machine, it won't crash it.

I thought maybe it might be my ENVIRONMENT on the first machine but evening
running it with no TSR's still crashes.

Comments?  Suggestions?  Is this a real bug?

-----------------------------------------------------------------
Michael Bower - N4NMR              Honeywell Federal Systems Inc.
e-mail: uunet!hfsi!bower                     7900 Westpark Drive.
phone:(h) 703-435-5081  (o) 703-827-3559         McLean, VA 22102
-----------------------------------------------------------------

joefritz@pawl.rpi.edu (Jochen M. Fritz) (07/18/90)

In article <387@hfsi.UUCP> bower@hfsi.UUCP (Michael Bower Comm. ) writes:
>I am having a curious "bug" occurr with my TC++ and I was wondering 
>anybody has experienced this.  Or if others would like to try this
>and let me know how your machine acts, I would also like that.
>
>The "bug" is this.
>
>1) Enter the environment.
>
>2) Build a simple program that counts from 1 to 200
>
>
>3) start the program
>
>4) after it has counted up a while, hit the ctrl-break key to
>   stop the program.
>
>On my machine at home, I get the following "gotcha".
>
>At first the numbers are going by fairly fast.  After I hit the ctrl-break
>keys, they continue but they slow down considerably.  If I hit the ctrl-break
>keys AGAIN, I will drop OUT OF TC++ and BACK AT MY DOS PROMPT.  If I now
>type "tc" again to enter the TC environment, my system LOCKS up to the point
>that ctrl-alt-del won't even recover it.  I have to hit the reset button.
>
>I tried this on a different machine and it would sometimes do the above and
>sometimes stop like it should.  On a third machine, it won't crash it.
>

It seems that you compiled without debug info.  TC's debugger works like so:
intercepts keystrokes while it runs the code
if a break or keyboard interrupt occurs, it starts single stepping the program
    (this is the slowdown)
it keeps stepping until it comes to a point in your code that it recognizes,
    then stopps (with the red bar)

The several machines you ran it on may have had TC configured differentlly
  (ie one with debug, and one without)  Check the options menu.  I've had
no idea of why your system crashed, althouh I have had somp problems with the 
Turbo Debugger (I had to turn off the NMI)   Best of luck.

ps: followup has been sent to comp.os.msdos.programmer


------------------------------------------------------------------------
| Jochen Fritz            | For though we live in the world, we do not |
| joefritz@pawl.rpi.edu   | wage war as the world does.-- 2 Cor. 10:3  |      
| usergk2s@rpitsmts.bitnet| You have heard it said, Love your neighbor |
| Noah [the peace monger] | and hate your enemy.  But I tell you: Love |
|                         | your enemies.  Matt. 5:43-44               |
------------------------------------------------------------------------