Re: core files (was Re: 2.1.131: some quality thoughts)

Tigran Aivazian (tigran@aivazian.demon.co.uk)
Tue, 29 Dec 1998 11:51:45 +0000 (GMT)


Currently the kernel (kmod) execs /sbin/modprobe (or whatever is in
/proc/sys/kernel/modprobe). It uses kernel_thread() to create
a kernel thread that executes exec_modprobe() function which then uses
execve() in the following manner (see kernel/kmod.c):

/* Go, go, go... */
if (execve(modprobe_path, argv, envp) < 0) {
printk(KERN_ERR
"kmod: failed to exec %s -s -k %s, errno = %d\n",
modprobe_path, (char*) module_name, errno);
return -errno;
}

Of course, in order for this to be valid it has to do some tricky things
like set_fs(KERNEL_DS) to allow environment to be in kernel segment.

Regards,
Tigran A. Aivazian, http://www.aivazian.demon.co.uk/

On Tue, 29 Dec 1998, Simon Ekstrand wrote:

> On Mon, 28 Dec 1998, Gregory Maxwell wrote:
>
> > On Mon, 28 Dec 1998, Albert D. Cahalan wrote:
> >
> > > >> Long term, I think the whole core file idea needs to be tossed in
> > > >> favor of just starting a debugger.
> > > >
> > > > There is nothing more irritating than trying to run a compiler
> > > > regression testsuite on a system that pops up a debugger dialog
> > > > when a program crashes.
> > >
> > > So use a debugger that just logs the error.
> > > Other people could certainly use a bit more
> > > ease-of-use than a dumb core file.
> >
> > It would be nice if a program could ask the kernel to run another task to
> > handle it's crash. X apps could have a nice little applet that pops up a
> > windows like info box that logs all the pertinate info, and gives the
> > users the option to save a core, email a bug report, open up ddd on the
> > process, etc..
>
> Well if someone could please give me some pointers as to how you
> actually ask the kernel to "run another task" ie. exec a file.
> I would be more than happy to try to incorperate this into my
> corename patch.
> Remember that I'm fairly new to kernel programming..
>
>
> -Simon Ekstrand (simius@algonet.se)
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/