Re: Possible race in fork()

Marcin Dalecki (dalecki@cs.net.pl)
Tue, 26 Jan 1999 02:53:18 +0100


"Richard B. Johnson" wrote:
>
> Hi!
> On a system at home I had a consitant problem trying to set the
> terminal speed after a fork(). It was traced to the fact that
> a termios structure, set by the parent, was being corrupted during
> the fork().
>
> I have written a test program that shows this problem without using
> any termios stuff, just malloc()ed memory. The problem does not
> occur with a machine here at work (same CPUs, same CPU board), but
> 128Mb of memory. Both are dual pentium 400MHz SMP machines.
>
> Both machines are running 2.1.131.
> My machine at home, showing the problem, only has 32 Mb of memory
> so the problem may be anywhere in the VM handling.
>
> When the problem occurs, both the child and parent's memory contain
> random data, not related to either the zeros or the incrementing
> values the test program writes.

You may try to take the following out of linux/mm/slab.c.
If it helps then this would be a significant evidence that the
bug is sitting there....

/*
* Fragmentation resistance on low memory - only use bigger
* page orders on machines with more than 32MB of memory.
*/
if (num_physpages > (32 << 20) >> PAGE_SHIFT)
slab_break_gfp_order = SLAB_BREAK_GFP_ORDER_HI;
return start;

However this is the only place I'm aware whre the size of mem
matters....

--Marcin

-
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/