|
From: rak_25 <ra...@ho...> - 2005-07-26 19:13:44
|
==22338== Memcheck, a memory error detector for x86-linux.
==22338== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==22338== Using valgrind-2.4.0, a program supervision framework for x86-linux.
==22338== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==22338== Warning: client switching stacks? %esp: 0x52BFA96C --> 0x528FA820
.
.
.
==22338== Invalid write of size 4
==22338== at 0x9D0E222: WriteM(CallerInfo const&) (main.cpp:349)
==22338== by 0x8190F37: main (main.cpp:45)
==22338== Address 0x52BFA958 is on thread 1's stack
this is for the following line of code
void WriteM( const CallerInfo& info )
{
const int *v;
int maxId = -1; <---line 349
.
.
.
thanks,
Rak
|
|
From: Dirk M. <dm...@gm...> - 2005-07-26 19:39:28
|
On Tuesday 26 July 2005 21:11, rak_25 wrote: > ==22338== Warning: client switching stacks? %esp: 0x52BFA96C --> > 0x528FA820 . Do you have something in your application that does a huge allocation on the stack or that implements threads / stack switches in userspace? > ==22338== Invalid write of size 4 its a false warning triggered by valgrind being confused about a huge jump in stack usage. it seems to me that your app didn't actually switch the stack but just allocated a huge amount of memory on the stack, so all following stack-based accesses are incorrectly interpreted. Dirk |
|
From: rak <ra...@ho...> - 2005-07-26 21:30:00
|
Dirk Mueller <dmuell <at> gmx.net> writes: > > On Tuesday 26 July 2005 21:11, rak_25 wrote: > > > ==22338== Warning: client switching stacks? %esp: 0x52BFA96C --> > > 0x528FA820 . > > Do you have something in your application that does a huge allocation on the > stack or that implements threads / stack switches in userspace? > > > ==22338== Invalid write of size 4 > > its a false warning triggered by valgrind being confused about a huge jump in > stack usage. it seems to me that your app didn't actually switch the stack > but just allocated a huge amount of memory on the stack, so all following > stack-based accesses are incorrectly interpreted. > > Dirk > I do have a big chunk of array. Is there any way of getting around this warning and false memory errors without using malloc? Thanks dirk. Rak |
|
From: Nicholas N. <nj...@cs...> - 2005-07-26 21:44:44
|
On Tue, 26 Jul 2005, rak wrote: > I do have a big chunk of array. Is there any way of getting around this warning > and false memory errors without using malloc? Check out Valgrind from the 3.0 repository (see www.valgrind.org/devel/cvs_svn.html) and use the new --max-stackframe option. N |
|
From: Julian S. <js...@ac...> - 2005-07-26 21:47:48
|
> I do have a big chunk of array. Is there any way of getting around this > warning and false memory errors without using malloc? Best is to get the array out of the stack and turn into a malloc/freed array. If you can't do that, use valgrind 3.X with it instead, and use --max-stackframe= flag (it'll tell you what you need to set it to). J |
|
From: rak <ra...@ho...> - 2005-07-26 21:59:34
|
Julian Seward <jseward <at> acm.org> writes: > > > > I do have a big chunk of array. Is there any way of getting around this > > warning and false memory errors without using malloc? > > Best is to get the array out of the stack and turn into a malloc/freed > array. If you can't do that, use valgrind 3.X with it instead, and > use --max-stackframe= flag (it'll tell you what you need to set it > to). > > J > Thanks a lot guys. Appreciate your time and help. Rak |