Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!usc!snorkelwacker!ira.uka.de!smurf!ipkama!freesid!mamnix!tjack!fiction!Daniel_Roedding From: Daniel_Roedding@fiction.ms.sub.org Newsgroups: comp.unix.wizards Subject: panic() / firsttime Message-ID: <299574@fiction> Date: 27 Aug 90 22:15:14 GMT Lines: 51 X-Attributes: type 2, from 100, acclv 0, expires jbm@eos.UUCP (Jeffrey Mulligan) writes: dave@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 Geiststrasse 32 "This golden age of communication D-4400 Muenster Means everyone talks at the same time" (NMA) ++49 251 525306 daniel@fiction.ms.sub.org; ..!uunet!mcsun!unido!mcshh!veeble!fiction!daniel