3B1 problem: mysterious core files in /etc/lddrv
Brant Cheikes
brant at manta.pha.pa.us
Sun Dec 25 02:25:21 AEST 1988
[Although Chris wrote
> Thanks in advance; reply by mail if possible and I'll summarize.
he also wrote
>[The next hop on pathalias's preferred mail path to here just went
>away; please route mail manually until the January maps come out.]
I doubted the likelihood of mail to get thru with all the evil
rerouters out there.]
Chris Siebenmann writes:
>Every so often (once a day right now, it seems) *something* here is
>dumping core in /etc/lddrv. [...]
>Any ideas on what program might dump core in /etc/lddrv? Any ideas on
>how to identify what program produced a specific core dump? Is this
>information stored anywhere in the core file?
No, yes, and yes.
If you know where to look, you can find the user structure, described in
<sys/user.h>, in the core file. The user structure tells you all sorts
of neat things about the core-dumping process, including its name.
In C, first
cfp = fopen(core_name, "r");
where core_name is the name of the core file you want to inspect.
Then you must jump past the stuff (kernel stack data?) at the start of
the core file:
fseek(cfp, (long)U_OFFSET, 0);
where U_OFFSET is defined in <sys/param.h>. Now you can just
{ struct user u; /* from <sys/user.h> */
fread(&u, sizeof(u), 1, cfp);
/* print out useful data in u */
}
>Chris Siebenmann uunet!utgpu!{ontmoh!moore,ncrcan}!ziebmef!cks
>cks at ziebmef.UUCP or .....!utgpu!{,ontmoh!,ncrcan!brambo!}cks
--
Brant Cheikes
University of Pennsylvania
Department of Computer and Information Science
brant at manta.pha.pa.us, brant at linc.cis.upenn.edu, bpa!manta!brant
More information about the Unix-pc.general
mailing list