Re: execve() fails to report errors

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Wed Mar 06 2002 - 09:08:39 EST


On Wed, 6 Mar 2002, Pavel Machek wrote:

> Hi!
>
> Take this trivial .c program. Obviously correct.
>
>
> struct foo {
> char fill[1*1024*1024*1024];
> };
>
> struct foo a;
>
> void
> main(void)
> {
> }
>
> Compile. Run. Segfault.
>
> Whose fault? Kernels; it fails to corectly report not enough address
> space.

I think the bug has to be found earlier on up the food chain.
If you do:

char a[1*1024*1024*1024] = {0,};

int main(void);
int main()
{
    return 0;
}

The linker will run forever, un-killable...

      gcc -o xxx xxx.c
     0 0 31478 31466 9 0 752 280 wait4 S 1 0:00
      /usr/local/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.66/collect2
      -m elf_i386 -dynamic-linke
     0 0 31479 31478 14 0 1050176 255184 lock_page D 1 0:23
      /usr/local/i686-pc-linux-gnu/bin/ld -m elf_i386 -dynamic-linker
      /lib/ld-linux.so.2 -o xxx

I can kill the top-level, but the task in lock_page runs forever, paging
to swap-file like crazy.

The output file grew to 1 gb, then stopped.

Cheers,
Dick Johnson

Penguin : Linux version 2.4.18 on an i686 machine (799.53 BogoMips).

        Bill Gates? Who?

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



This archive was generated by hypermail 2b29 : Thu Mar 07 2002 - 21:00:54 EST