|
From: Tim M. <ti...@se...> - 2005-04-11 16:36:27
|
Hi all,
I've just come across a curious segfault when using valgrind, which
doesn't happen without it. It appears to be caused by declaring an array
on the stack.
I have the following small test file:
---test.c---
#include <stdio.h>
int main(void)
{
char szVar[4000] = {0};
printf("Hello world!\n");
return 0;
}
---End test.c---
Compiling it with gcc:
[timm@timm uas]$ gcc test.c -o test
[timm@timm uas]$ valgrind --tool=none ./test
==13765== Nulgrind, a binary JIT-compiler for x86-linux.
==13765== Copyright (C) 2002-2004, and GNU GPL'd, by Nicholas Nethercote.
==13765== Using valgrind-2.4.0, a program supervision framework for
x86-linux.
==13765== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==13765== For more details, rerun with: -v
==13765==
==13765== Signal 11 (SIGSEGV) appears to have lost its siginfo; I can't go
on.
==13765== This may be because one of your programs has consumed your
==13765== ration of siginfo structures.
==13765==
Segmentation fault
[timm@timm uas]$
It happens with memcheck, addrcheck and tool=none. It happened with
valgrind 2.2.0, which is why I tried upgrading to 2.4.
If I reduce the size of the stack array to 3000 it seems to work.
I'm slightly suspicious that this is a gcc problem, since the same process
works on another box with a different gcc. My gcc is
[timm@timm .autotest.uas]$ gcc --version
gcc (GCC) 3.3.4 (pre 3.3.5 20040809)
(standard gcc with SuSE 9.2)
Tim
|