tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: 9.1: forcible coredump -> panic
>>> Might this be a good use case for workqueue(9)?
>> Yes.
> I've now converted the code to us a workqueue. I think.
It's no longer panicking. But it doesn't actually drop core.
My workqueue runner function is
static void deadman_docore(struct work *w, void *arg __attribute__((__unused__)))
{
int i;
struct proc *p;
SOFTC *sc;
mutex_enter(&deadman_coremtx);
printf("workqueue running for %p\n",(void *)w);
for (i=NDEADMAN-1;i>=0;i--)
{ sc = &softcs[i];
if (w == &sc->w)
{ printf("found as [%d]\n",i);
mutex_enter(proc_lock);
p = proc_find(sc->pid);
mutex_exit(proc_lock);
if (! p)
{ printf("process not found\n");
}
else
{ printf("dumping core\n");
MODULE_HOOK_CALL_VOID(coredump_hook,(LIST_FIRST(&p->p_lwps),0),);
}
break;
}
}
mutex_exit(&deadman_coremtx);
printf("returning\n");
}
and the printfs show (the first two lines come from the callout
function, the one which calls workqueue_enqueue)
[ 67.537935] deadman timer fired
[ 67.537935] enqueueing 0xffffffff81694c20 for 0
[ 67.537935] workqueue running for 0xffffffff81694c20
[ 67.537935] found as [0]
[ 67.537935] dumping core
[ 67.540935] returning
but no core actually gets dumped. But it's not any of the usual
reasons for not dropping core, such as permissions or rlimits; ^\ (my
quitc) dumps a real core very nicely. (I'm not just sending a SIGQUIT
because I want to generate a coredump even if, for example, SIGQUIT is
blocked or caught.)
I've put the whole of dev/deadman.c up for fetch, in case something I
haven't quoted is relevant;
{ftp,http}://ftp.rodents-montreal.org/mouse/misc/deadman.c is the thing
to look at.
In the meantime, I'll be adding debugging code to the coredump path to
try to figure this out. But if anyone sees anything obvious that would
be a problem, a clout upside the head with the a-by-four would be
appreciated.
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse%rodents-montreal.org@localhost
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
Home |
Main Index |
Thread Index |
Old Index