[comp.sys.amiga] Hard disk crash, or was it?

jack@odi.com (Jack Orenstein) (12/04/89)

I have an Amiga 2000 with 3 meg and a GVP 40Q hard disk. I wrote a
program that makes heavy use of malloc/free and disk access (fopen,
fclose, lseek, etc.) The software is compiled with Aztec 3.6a. I'm
compiling with 32 bit everything. For several days now, I've been
chasing down a bug that causes a guru 81000009, the code for an
attempt to free memory twice. Normally, I get the guru, reboot, and
all is well.

Yesterday, I included a call to setbuf upon opening files. Before, I
had been relying on buffer allocation by the first read or write for
each file. I got the guru as usual, but this time the thing wouldn't
boot. It hung. I was VERY scared. I tried booting several times and it
always hung, just after beginning the hard-disk part of the boot (I'm
using 1.2 still - no auto-boot).

Finally, I was able to reboot with a different workbench disk - that
doesn't rely on the hard disk, and recovered one partition. Later the
other partition came back.

I'm extremely grateful to whatever recovery code, piece of luck, or
Norse gods that saved me.

The questions:

1) What happened while the system hung during re-boot? Was there some
main-memory thinking about disk structure going on? (The hard disk
light was off).

2) Why did everything come back OK?

3) If I HAD lost my disk, are there any program that will salvage the
contents? 

4) Any advice about the cause of an 81000009 guru?

5) What is the recommended procedure for opening and closing files? Is
setbuf a no-no? (I'm following the procedure in the Manx
documentation.)


Jack Orenstein



This is not a disclaimer.