[comp.lang.pascal] Question on UAE's when running TPW

F0O@psuvm.psu.edu (06/06/91)

   Since when doing program development in TPW, one is likely to get
many UAE's(especially when you're first starting out) :-)
I was wondering if your other programs are protected from
these errors or not.  I wouldn't like to have to exit windows and restart
every time I would encounter a UAE, but maybe this is the best way to
work?
   I've heard other people say when you're running other windows programs
and get a UAE, you should exit ASAP to avoid any possible further damage.

                                                           [Tim]

bobsc@microsoft.UUCP (Bob SCHMIDT) (06/10/91)

In article <91157.094647F0O@psuvm.psu.edu> F0O@psuvm.psu.edu writes:
%% 
%%    Since when doing program development in TPW, one is likely to get
%% many UAE's(especially when you're first starting out) :-)
%% I was wondering if your other programs are protected from
%% these errors or not.  I wouldn't like to have to exit windows and restart
%% every time I would encounter a UAE, but maybe this is the best way to
%% work?
%%    I've heard other people say when you're running other windows programs
%% and get a UAE, you should exit ASAP to avoid any possible further damage.
%% 
%%                                                            [Tim]

All Windows apps run in the same address space (using the same LDT).
I see apps trounce one another all the time.  The safest thing, of course,
is to *reboot* between UAEs.  That's a little draconian; even just
re-running Windows is a pain.

I suggest that the remedy depends on where the UAE occurred.
If you die in your own code, then you are often safe just exiting
your app and restarting.  However, if you UAE deep in the bowels of
Windows (e.g., while calling a Windows API), then you may have confused
Windows enough that you should exit and rerun.

As much of a hassle as it is, until you get some experience ferretting
out UAEs, the conservative course is probably best.  If/when
Windows goes to multiple LDTs (a la OS/2), life will become much
more predictable.

--
--  Bob Schmidt        bobsc@microsoft.UUCP
--
--  Bellevue WA USA    Windows SDK Support
--  Sydney NSW AUS     Developer Support (after 1 Oct)

root@chshost.in-berlin.de (Thomas Liening) (06/12/91)

F0O@psuvm.psu.edu writes:

>I was wondering if your other programs are protected from
>these errors or not.  I wouldn't like to have to exit windows and restart
>every time I would encounter a UAE, but maybe this is the best way to
>work?

I don't think that other programs are protected from UAEs in one
application, since an UAE can easily crash the *entire* Windows system
if it's serious enough.

>   I've heard other people say when you're running other windows programs
>and get a UAE, you should exit ASAP to avoid any possible further damage.

The most easy way (provided that your machine is equipped with two monitors)
is to run the app being developed under a debugger. This way,
*none* of my programming mistakes were able to affect other apps, and
Windows continued to run as well, certainly.

Thomas Liening
 
-- 
-----------------------------------------------------------------------
Thomas Liening * Roennebergstrasse 14 * 1000 Berlin 41, Germany, Europe 
Voice: +49 30 852 59 28 * Fax: +49 30 852 59 28 (call voice prior!)
UUCP: tl@chshost.{UUCP, in-berlin.de}

milne@ics.uci.edu (Alastair Milne) (06/14/91)

In <1991Jun12.031916.1760@chshost.in-berlin.de> root@chshost.in-berlin.de (Thomas Liening) writes:

>F0O@psuvm.psu.edu writes:
>>I was wondering if your other programs are protected from
>>these errors or not.  I wouldn't like to have to exit windows and restart
>>every time I would encounter a UAE, but maybe this is the best way to
>>work?
>I don't think that other programs are protected from UAEs in one
>application, since an UAE can easily crash the *entire* Windows system
>if it's serious enough.

    Somebody from Microsoft posted a note the other day saying that
    Windows only uses 1 LDT (Local Descriptor Table) for all tasks.
    For those who may be unfamiliar with the 286 and 386 arrangements,
    the Descriptor Tables are, among other things, how the chip translates
    each task's memory references into actual physical memory, segregated
    from each other -- that's what the word "protected" means in "protected
    mode".  Each task is supposed to have its own LDT -- in fact, that's 
    essentially the {2,3}86's definition of a task.  If Windows is not
    creating a new LDT for each task, then they have no protection
    against each other that I am aware of.

>>   I've heard other people say when you're running other windows programs
>>and get a UAE, you should exit ASAP to avoid any possible further damage.

    That's what the Cobb Group people say in Inside MS Windows.  Sounds
    terrible to me, but I've certainly had DOS corrupted from some 
    of these.

    By the way, I should point out that Irrecoverable Errors (I'll swear
    there's no such word as "unrecoverable") are not the only way for 
    Windows to die.  I've had operations proceeding when suddenly Windows
    is gone and I'm staring at a blank DOS screen.  (To be fair, I *think*
    these happen when I'm trying to use DOS shell sessions within 
    windows, and they may be trying to install interrupt handlers within 
    their virtual machines.)  However it happens, though, the system
    is usually fit for nothing at this point, and should be rebooted.


    Alastair Milne

ed@odi.com (Ed Schwalenberg) (06/15/91)

In article <1991Jun12.031916.1760@chshost.in-berlin.de> root@chshost.in-berlin.de (Thomas Liening) writes:
  >   I've heard other people say when you're running other windows programs
  >and get a UAE, you should exit ASAP to avoid any possible further damage.

  The most easy way (provided that your machine is equipped with two monitors)
  is to run the app being developed under a debugger. This way,
  *none* of my programming mistakes were able to affect other apps, and
  Windows continued to run as well, certainly.

False security.  The debugger cannot catch a "wild write" that clobbers
a data segment belonging to another Windows app, or to Windows itself.