|
From: Gao, J. <JG...@se...> - 2003-10-08 14:33:06
|
It works for me. I changed the big number to 10, valgrind gives "definitely
lost of 160 bytes". It is precisely correct.
I am using an old valgrind 1.0.4, linux 2.4.20.
Did you try change the big number to a smaller one? Maybe it is a
integer/float overflow problem.
Jiafu
-----Original Message-----
From: Wim Glassee [mailto:wim...@ua...]
Sent: Wednesday, October 08, 2003 10:18 AM
To: val...@li...
Subject: [Valgrind-users] strdup unnoticed
Hi all,
I seem to be having a problem.
Running the code:
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
void test()
{
char * test = "ABCDEFGHIJKLMNO";
char * piep;
piep = strdup(test);
piep = strdup(test);
printf( "%s\n", piep );
free(piep);
}
int main( int argc, char ** argv )
{
int i;
for( i = 0; i < 10000000; i++ )
{
test();
}
return 0;
}
should print out the abc... string a zillion times to the screen, while
creating memory leaks on the way.
Running this in valgrind doesn't give ANY program output, and says no leaks
are possible seeing as no malloc has been done. Apparently it doesn't check
inside strdup. This doesn't explain for the no-output problem though.
I used:
valgrind --leak-check=yes --leak-resolution=high
Anybody have any ideas?
Thanks in advance,
Wim
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf _______________________________________________
Valgrind-users mailing list Val...@li...
https://lists.sourceforge.net/lists/listinfo/valgrind-users
This message (including any attachments) contains confidential information
intended for a specific individual and purpose, and is protected by law. If
you are not the intended recipient, you should delete this message. Any
disclosure, copying, or distribution of this message, or the taking of any
action based on it, is strictly prohibited.
|
|
From: Wim G. <wim...@ua...> - 2003-10-08 15:23:09
|
Tried changing the number to 10 with the same result
I tried with valgrind 1.9.6, and with the latest, i.e. 20030725
On redhat linux 2.4.20-19.9
I'll try to test with an older version.
We might be on to something here
On Wed, 2003-10-08 at 16:32, Gao, Jiafu wrote:
> It works for me. I changed the big number to 10, valgrind gives "definitely
> lost of 160 bytes". It is precisely correct.
>
> I am using an old valgrind 1.0.4, linux 2.4.20.
>
> Did you try change the big number to a smaller one? Maybe it is a
> integer/float overflow problem.
>
> Jiafu
>
> -----Original Message-----
> From: Wim Glassee [mailto:wim...@ua...]
> Sent: Wednesday, October 08, 2003 10:18 AM
> To: val...@li...
> Subject: [Valgrind-users] strdup unnoticed
>
>
> Hi all,
>
> I seem to be having a problem.
>
> Running the code:
>
> #include <string.h>
> #include <stdio.h>
> #include <stdlib.h>
>
> void test()
> {
> char * test = "ABCDEFGHIJKLMNO";
> char * piep;
>
> piep = strdup(test);
> piep = strdup(test);
> printf( "%s\n", piep );
> free(piep);
> }
>
> int main( int argc, char ** argv )
> {
> int i;
> for( i = 0; i < 10000000; i++ )
> {
> test();
> }
> return 0;
> }
>
> should print out the abc... string a zillion times to the screen, while
> creating memory leaks on the way.
>
> Running this in valgrind doesn't give ANY program output, and says no leaks
> are possible seeing as no malloc has been done. Apparently it doesn't check
> inside strdup. This doesn't explain for the no-output problem though.
>
> I used:
>
> valgrind --leak-check=yes --leak-resolution=high
>
> Anybody have any ideas?
>
> Thanks in advance,
>
> Wim
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf _______________________________________________
> Valgrind-users mailing list Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
>
> This message (including any attachments) contains confidential information
> intended for a specific individual and purpose, and is protected by law. If
> you are not the intended recipient, you should delete this message. Any
> disclosure, copying, or distribution of this message, or the taking of any
> action based on it, is strictly prohibited.
>
|
|
From: Dirk M. <dm...@gm...> - 2003-10-08 20:36:51
|
On Wednesday 08 October 2003 17:22, Wim Glassee wrote: > We might be on to something here well, your report shows that valgrind was not able to hook into your memory allocator. All people I've heard of with this problem were using the (broken) RH 9. does it work when you export LD_ASSUME_KERNEL=2.4.1 ? |
|
From: Wim G. <wim...@ua...> - 2003-10-08 15:23:34
|
Thanks for testing Olly. I'm using gcc 3.2.2 (the latest redhat kind) glibc 2.3.2-27.9 compiled without optimisation: gcc -o test test.c Just tried with valgrind 1.0.4, but it won't run, it complains that it couldn't find couldn't find 'client's argc/argc/envp' Wim On Wed, 2003-10-08 at 16:41, Olly Betts wrote: > On Wed, Oct 08, 2003 at 04:17:32PM +0200, Wim Glassee wrote: > > valgrind --leak-check=yes --leak-resolution=high > > What version of valgrind? What version of gcc? What gcc command line > options did you use? What version of glibc? > > I can't reproduce your problem with valgrind-20030725 and gcc 2.95.4 or > 3.3, with -O, -O2, -O3 or without optimisation. That's using glibc 2.2.5. > > I get output from the program and memory leaks reported. > > Cheers, > Olly |
|
From: Wim G. <wim...@ua...> - 2003-10-09 07:41:28
|
Got the same result (i.e. nothing) on the following system redhat 7.2 kernel 2.4.17 glibc 2.2.4-19.3 gcc-2.96 with valgrind 1.0.4 valgrind 1.9.6 needs at least glibc 2.3 so won't install On Wed, 2003-10-08 at 17:47, Ivan Pulleyn wrote: > Are you running valgrind with -v --leak-check=yes --show-reachable=yes > flags? > > Ivan... > > On Wed, 2003-10-08 at 08:22, Wim Glassee wrote: > > Thanks for testing Olly. > > > > I'm using gcc 3.2.2 (the latest redhat kind) > > glibc 2.3.2-27.9 > > > > > > compiled without optimisation: gcc -o test test.c > > > > Just tried with valgrind 1.0.4, but it won't run, it complains that it > > couldn't find couldn't find 'client's argc/argc/envp' > > > > Wim > > > > On Wed, 2003-10-08 at 16:41, Olly Betts wrote: > > > On Wed, Oct 08, 2003 at 04:17:32PM +0200, Wim Glassee wrote: > > > > valgrind --leak-check=yes --leak-resolution=high > > > > > > What version of valgrind? What version of gcc? What gcc command line > > > options did you use? What version of glibc? > > > > > > I can't reproduce your problem with valgrind-20030725 and gcc 2.95.4 or > > > 3.3, with -O, -O2, -O3 or without optimisation. That's using glibc 2.2.5. > > > > > > I get output from the program and memory leaks reported. > > > > > > Cheers, > > > Olly > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: SF.net Giveback Program. > > SourceForge.net hosts over 70,000 Open Source Projects. > > See the people who have HELPED US provide better services: > > Click here: http://sourceforge.net/supporters.php > > _______________________________________________ > > Valgrind-users mailing list > > Val...@li... > > https://lists.sourceforge.net/lists/listinfo/valgrind-users |