From: Tom H. <th...@cy...> - 2004-01-17 22:49:00
|
In message <200...@ra...> Balazs Rauznitz <ba...@ra...> wrote: > There's only one thing I cannot figure out: I get this error in my > program: > > ==7819== Warning: client switching stacks? %esp: 0xBFFFF4FC --> 0xBFC2EBB4 > ==7819== 1 errors in context 1 of 24: > ==7819== Invalid write of size 4 > ==7819== at 0x8049F69: create_cache_file (test.c:480) > ==7819== Address 0xBFC2EBD0 is on thread 1's stack > > I'm not using any threads; my program crunches numbers. I get these > errors after malloc-ing a huge chunk of memory; that's what triggers > the 'client switching stacks' message. Is it a glitch in valgrind or am > I compiling my program with incorrect switches ? Thread 1 is the main thread, so you always have that, so it isn't odd that valgrind is talking about an address being on thread 1's stack. Are you sure you mallocing this very large chunk of memory and not allocating it on the stack? perhaps with alloca? That might cause valgrind to think the client had switched stacks, which might in turn cause it to think the large chunk of memory was not addressable. Tom -- Tom Hughes (th...@cy...) Software Engineer, Cyberscience Corporation http://www.cyberscience.com/ |