[comp.sys.amiga] task exceptions

A_HINDS%HVRFORD.BITNET@cornellc.cit.cornell.edu (09/22/89)

I have a proposal, albeit a late one, for 1.4.  I think one of the biggest
possible criticism of the Amiga is its lack of error handling facilities
for task exceptions.

Now, wouldn't it be possible, say, for each task when running, to store
the address of an exception handler to be used for ALL gurus, not just
CPU exceptions, so that cleanup and recovery could be possible?
Couldn't this just be something all developpers do when running their
programs, just like opening ExecBase, etc. is something we all do
automatically?

Does 1.4 address this problem?  Just what happened to the guru, anyway?
Will the machine still go down when somebody frees memory twice?

Alexander Hinds
A_HINDS@HVRFORD

andrewt@watsnew.waterloo.edu (Andrew Thomas) (09/27/89)

In article <24642@louie.udel.EDU> A_HINDS%HVRFORD.BITNET@cornellc.cit.cornell.edu writes:
   Does 1.4 address this problem?  Just what happened to the guru, anyway?
   Will the machine still go down when somebody frees memory twice?

My question here is, why the hell doesn't the malloc/free pair have
some kind of bit or magic number which it sets in the header block
which says whether that segment of memory is allocated or freed, so
the check can be done by free and the problem goes away forever.  The
only overhead is (perhaps as much as) 1 byte per memory segment, a
compare and write in free, and a write in malloc.  I'm willing to pay
the three instructions for the safety it offers.
--

Andrew Thomas
andrewt@watsnew.waterloo.edu	Systems Design Eng.	University of Waterloo
"If a million people do a stupid thing, it's still a stupid thing." - Opus

jyegiguere@watcgl.waterloo.edu (Eric Giguere) (09/28/89)

In article <ANDREWT.89Sep27121050@watsnew.waterloo.edu> andrewt@watsnew.waterloo.edu (Andrew Thomas) writes:
>My question here is, why the hell doesn't the malloc/free pair have
>some kind of bit or magic number which it sets in the header block
>which says whether that segment of memory is allocated or freed, so
>the check can be done by free and the problem goes away forever.  The
>only overhead is (perhaps as much as) 1 byte per memory segment, a
>compare and write in free, and a write in malloc.  I'm willing to pay
>the three instructions for the safety it offers.
                        ^^^^^^^^^^^^^^^^^^^^^^^^

Unfortunately it doesn't offer much safety.  Remember that on the Amiga
all tasks share the same memory space... if a pointer from task 1 decides
to point off to never-never land it might stomp all over task 2's memory
space... and then tinker bell comes to pay a visit.

The point is, there is no way to prevent someone from altering memory
that you alloc.... if someone accidentally changes the control byte
(it probably would take more than one byte, remember memory is aligned
along 4-byte boundaries) then it's bye-bye time.

Eric