Re: [PATCH] Core dumps for threads

Alan Cox (alan@lxorguk.ukuu.org.uk)
Tue, 27 Feb 2001 17:55:45 +0000 (GMT)


> the 2.4.1 kernel, that copies the mm and dumps the corefile from
> that copy. Also, whenever there are multiple users of the original
> mm it creates the core dump in the file `core.n' where `n' is the
> PID of the offending process.

> + if ((mm = kmem_cache_alloc(mm_cachep, SLAB_KERNEL)) == NULL)
> + goto close_fail;
> + memcpy(mm, current->mm, sizeof(*mm));
> + if (!mm_init(mm)) {
> + kmem_cache_free(mm_cachep, mm);
> + goto close_fail;
> + }
> + down(&current->mm->mmap_sem);

Umm not quite what I meant. Take a look at copy_mm in fork.c

The code starting

m = allocate_mm()

down to just before

/*
* child gets a

Does the real thing you need to do to be sure the mm is properly set up.
You can also drop the original mm and make that current->mm to avoid the
passing of mm around. In fact you probably should do that.


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