[comp.sys.mac.programmer] DDPWrite Problem found

mikeoro@hubcap.clemson.edu (Michael K O'Rourke) (07/05/89)

Thanks to those who responded to my earlier problem with a DDPWrite call
causing an error code of -95. It turned out I was trying to access data in 
a nil pointer earlier in the program and this ended up writing to some 
nasty area of memory, which caused the DDPWrite error.  

-Michael O'Rourke

tim@hoptoad.uucp (Tim Maroney) (07/06/89)

In article <5920@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael
K O'Rourke) writes:
>Thanks to those who responded to my earlier problem with a DDPWrite call
>causing an error code of -95. It turned out I was trying to access data in 
>a nil pointer earlier in the program and this ended up writing to some 
>nasty area of memory, which caused the DDPWrite error.  

Gosh, I wonder why we nasty ol' developers keep begging Apple for a
memory protected OS.  It must be that we're just jerks -- after all, we
disagree with stated Apple policy and plans, and only a real asshole
would do that.  There couldn't possibly be a good reason we consider
memory protection important, could there?
-- 
Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com
Postal: 424 Tehama, SF CA 94103; Phone: (415) 495-2934

"Please help support the moratorium on meaningless quotes in .signatures."
  -- Doug Asherman on rec.music.cd

earleh@eleazar.dartmouth.edu (Earle R. Horton) (07/07/89)

In article <7869@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes:
>In article <5920@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael
>K O'Rourke) writes:
>>Thanks to those who responded to my earlier problem with a DDPWrite call
>>causing an error code of -95. It turned out I was trying to access data in 
>>a nil pointer earlier in the program and this ended up writing to some 
>>nasty area of memory, which caused the DDPWrite error.  
>
>Gosh, I wonder why we nasty ol' developers keep begging Apple for a
>memory protected OS.  It must be that we're just jerks -- after all, we
>disagree with stated Apple policy and plans, and only a real asshole
>would do that.  There couldn't possibly be a good reason we consider
>memory protection important, could there?

     After having spent the better part of a day chasing down a bug in
my program which caused it to repeatedly fill up the Finder's code
space with garbage, I couldn't agree with Tim more.

     There is, however, a fairly simple test for Handle nihilism.  Run
your code on a 68000 machine, stuff something odd in the longword at
location zero, and wait for System Error 2.  If your code runs on more
advanced processors only, put something there which will generate a
Bus Error.  Technote 7 suggests the value 'NIL!' will work for both.

Earle R. Horton

"People forget how fast you did a job, but they remember how well you
did it."  Salada Tag Lines

blob@apple.com (Brian Bechtel) (07/07/89)

In article <14249@dartvax.Dartmouth.EDU> earleh@eleazar.dartmouth.edu 
(Earle R. Horton) writes:
>      There is, however, a fairly simple test for Handle nihilism.  Run
> your code on a 68000 machine, stuff something odd in the longword at
> location zero, and wait for System Error 2.  If your code runs on more
> advanced processors only, put something there which will generate a
> Bus Error.  Technote 7 suggests the value 'NIL!' will work for both.

Mr. Bus Error, available on the Phil & Dave's Excellent CD, sets up a VBL 
task that repeatedly sets the long at location 0 to an odd value.  That 
way, even if you're trashing 0, when you jump to zero you'll catch it.

--Brian Bechtel     blob@apple.com     "My opinion, not Apple's"

earleh@eleazar.dartmouth.edu (Earle R. Horton) (07/08/89)

In article <2673@internal.Apple.COM> blob@apple.com (Brian Bechtel) writes:

>Mr. Bus Error, available on the Phil & Dave's Excellent CD, sets up a VBL 
>task that repeatedly sets the long at location 0 to an odd value.  That 
>way, even if you're trashing 0, when you jump to zero you'll catch it.

     Thanks!  I got that thing, popped it in my System Folder, and the
bugs just crawled out of the woodwork!  You should have seen those
bugs running for cover!

Earle R. Horton
"People forget how fast you did a job, but they remember how well you
did it."  Salada Tag Lines