From: Julian S. <js...@ac...> - 2004-01-18 02:56:27
|
> Valgrind spotted such a large change in the stack pointer, %esp, that > it guesses the client is switching to a different stack. At this point > it makes a kludgey guess where the base of the new stack is, and sets > memory permissions accordingly. You may get many bogus error messages > following this, if Valgrind guesses wrong. At the moment "large change" > is defined as a change of more that 2000000 in the value of the %esp > (stack pointer) register. > > > I guess that explains. Do you have suggestions how to avoid such errors > ? Is there are gcc flag to work around this problem ? Is it bad > programming practice to have so huge stack ? Maybe it's harmless... Yes, it's your int i[1000000] causing this. Either allocate it with malloc (the best option) or make it global (works, but V will not be able to check it so carefully). Having huge stuff on the stack is not really a good thing; some systems don't offer you huge stacks and so you might have portability problems. J |