This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Anyone knowlegable about valgrind ? Was: Re: g77 and valgrinderror?


>>
>> ==12420== Invalid write of size 8
>> ==12420==    at 0x8048671: fsub_ (memty.f:10)
>> ==12420==    by 0x80486C5: main (../../../../gcc-3.1/libf2c/libF77/main.c:61)
>> ==12420==  Address 0x52BFE8A0 is on thread 1's stack
>> ==12420==
>> ==12420== Invalid write of size 8
>> ==12420==    at 0x8048679: fsub_ (memty.f:10)
>> ==12420==    by 0x80486C5: main (../../../../gcc-3.1/libf2c/libF77/main.c:61)
>> ==12420==  Address 0x52BFE8A8 is on thread 1's stack
>
>If you run with -v you will see this warning:
>
>==9495== Warning: thread 1 switching stacks?  %esp: 0x52BFEA10 --> 0x52A04610
>
>What's happening is that the very large array is using about 1Mb of
>stack space and that is confusing valgrind into thinking that the
>thread has switched to a different stack so it doesn't mark all that
>space as writable and then you get invalid write warnings.
>
>Tom
>
>--
>Tom Hughes (thh@cyberscience.com)
>Software Engineer, Cyberscience Corporation
>http://www.cyberscience.com/
>
Here is the reply from one of the valgrind people, which 
clears things up a bit.  It is interesting that this *only*
happens for type complex.

Thanks,

Brett van de Sande



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]