Re: [PATCH] Core dumps for threads

From: Alan Cox (
Date: Tue Feb 27 2001 - 12:55:45 EST

> 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
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Feb 28 2001 - 21:00:14 EST