panic() / firsttime

Daniel_Roedding at fiction.ms.sub.org Daniel_Roedding at fiction.ms.sub.org
Tue Aug 28 08:15:14 AEST 1990


jbm at eos.UUCP (Jeffrey Mulligan) writes:

dave at tis.com (David I. Dalva) writes:

> >The code goes something like this:

> >	panic(s)
> >		char *s;
> >	{
> >		printf("%s\n", s);
> >		if (firsttime) {
> >			firsttime = FALSE;
> >			sync();
> >		}
> >		halt();
> >	}

> It would seem that the use of the flag "firsttime" is to prevent
> multiple or recursive calls to sunc(); if this is happening, then
> perhaps whatever is causing the panic is also scribbling over
> firsttime.  Maybe you could try moving it to another part of the
> address space and see what happens.

Probably it's sufficient to assign a "magic" value to "firsttime".
A manipulation could be detected much easier:

panic(s)
char *s;
{
   printf("%s\n",s);
   switch (firsttime) {
      case FT_FIRST:
         firsttime=FT_SECOND;
         sync();
      case FT_SECOND:
         halt();
      default:
         printf("Argh -- who manipulated my vars????\n");
         halt();
   }
}


Daniel

---
Daniel Roedding                                       #include <disclaimer.h>
Geiststrasse 32  "This golden age of communication
D-4400 Muenster   Means everyone talks at the same time" (NMA)
++49 251 525306
daniel at fiction.ms.sub.org; ..!uunet!mcsun!unido!mcshh!veeble!fiction!daniel



More information about the Comp.unix.wizards mailing list