lkml.org 
[lkml]   [2002]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: execve() fails to report errors
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/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.045 / U:7.380 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site