|
From: <War...@ci...> - 2005-09-22 22:14:19
|
HI all, I've been trying to use valgrind on a largish project that involves a lot of C and C++ code invoked through jni from a java server. I've seen a couple of other posts here from people who say they are using valgrind with java successfully, but I find that even with a 'Hello World' java program, I hit the 30000 error limit before I even get to my main routine. And a lot of the error messages I get look like this: ==24225== 127 errors in context 53 of 53: ==24225== Invalid write of size 4 ==24225== at 0x1F22A20E: ??? ==24225== by 0x1F224A7A: ??? ==24225== by 0x1F2249A3: ??? ==24225== by 0x1F2249A3: ??? ==24225== by 0x1F2249A3: ??? ==24225== by 0x1F2249A3: ??? ==24225== by 0x1F224922: ??? ==24225== by 0x1F224C28: ??? ==24225== by 0x1F2249A3: ??? ==24225== by 0x1F2249A3: ??? ==24225== by 0x1F2249A3: ??? ==24225== by 0x1F222156: ??? so I have to add some very general suppressions to get through them. Am I missing something - is there an easier way to make this work? I'm actually not at all interested in valgrind info for any of the java code - just for our C and C++ code. Is there anyway to tell valgrind to only pay attention to certain shared libs? I'm doing this on a somewhat out-of-date debian unstable machine (probably 3-4 months since the last dist-upgrade) - it's an AMD 2800+ running a 2.6.8 kernel, I'm using the 1.5.0_03 build of java (although I see the same thing with a 1.4.2 build), and I'm using valgrind 3.0.1 built from source. Any advice would be greatly appreciated... Warren -- Warren Baird, Senior Technical Group Leader war...@ci... Cimmetry System Corp. 514 735 3219 x148 |
|
From: Nicholas N. <nj...@cs...> - 2005-09-26 02:46:14
|
On Thu, 22 Sep 2005, War...@ci... wrote: > I've been trying to use valgrind on a largish project that involves a lot > of C and C++ code invoked through jni from a java server. I've seen a > couple of other posts here from people who say they are using valgrind with > java successfully, but I find that even with a 'Hello World' java program, > I hit the 30000 error limit before I even get to my main routine. And a > lot of the error messages I get look like this: > > ==24225== 127 errors in context 53 of 53: > ==24225== Invalid write of size 4 > ==24225== at 0x1F22A20E: ??? > ==24225== by 0x1F224A7A: ??? > [snip] > > so I have to add some very general suppressions to get through them. Am I > missing something - is there an easier way to make this work? > > I'm actually not at all interested in valgrind info for any of the java > code - just for our C and C++ code. Is there anyway to tell valgrind to > only pay attention to certain shared libs? > > I'm doing this on a somewhat out-of-date debian unstable machine (probably > 3-4 months since the last dist-upgrade) - it's an AMD 2800+ running a 2.6.8 > kernel, I'm using the 1.5.0_03 build of java (although I see the same thing > with a 1.4.2 build), and I'm using valgrind 3.0.1 built from source. In theory Java works fine under Valgrind, in practice some JVMs do nasty things that can cause problems. Looks like you might have hit one here. It's hard to say more without knowing the internals of the JVM. Nick |
|
From: Federico F. <fli...@ya...> - 2005-09-26 15:51:18
|
Hi everyone. I have run my program with valgrind and there are a couple of messages from the log that i cant solve. I would really appreciate your help :) 1)This is part of the Leak Summary. ==19719== 544 bytes in 8 blocks are possibly lost in loss record 1 of 3 ==19719== at 0x1B8FFD11: calloc (vg_replace_malloc.c:279) ==19719== by 0x1B8F2E1B: _dl_allocate_tls (in /lib/ld-2.3.2.so) ==19719== by 0x1B91625D: allocate_stack (in /lib/tls/libpthread-0.60.so) ==19719== by 0x1B915ED7: pthread_create@@GLIBC_2.1 (in /lib/tls/libpthread-0.60.so) The sentnece that causess this error is the following: int res = pthread_create(&thread, NULL, &pthreadcallback, this); As far as I know, I dont have to free anys resources that might be created by a pthread_create() call. Am I right? I know its says "possibly lost", I just want to be sure 2) This is part of the Error Summary. ==19719== Conditional jump or move depends on uninitialised value(s) ==19719== at 0x1B900BF6: rawmemchr (mac_replace_strmem.c:517) ==19719== by 0x1BB2C7EF: _IO_str_init_static_internal (in /lib/tls/libc-2.3.2.so) ==19719== by 0x1BB20376: vsscanf (in /lib/tls/libc-2.3.2.so) ==19719== by 0x1BB1B48C: sscanf (in /lib/tls/libc-2.3.2.so) The code that causes this error is the following: char yearc[5] = " "; char monthc[3] = " "; char dayc[3] = " "; char hourc[3] = " "; char minutec[3] = " "; char secondc[3] = " "; sscanf(_14bytesString, "%4c%2c%2c%2c%2c%2c", yearc, monthc, dayc, hourc, minutec, secondc); Is this a serious problem? Is there a better way of doing this? Thank in advance Federico __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
From: Brian C. <cr...@fi...> - 2005-09-26 16:06:03
|
I've noticed that I have some interesting reports from valgrind when in pthread code (on an older
gcc/glibc platform, not sure if newer is better or not), but you might be able to solve this first
one with a pthread_join() ("reap" the thread when it ends) or a pthread_detech() (make the thread
responsible for itself). Just speculation though, I don't know for sure if this is the case.
In your second report, are you initializing "_14bytesString" to something somewhere? Showing us
that code would help.
Usually, if valgrind is reporting an __error__ you should spend a good while investigating it.
These are usually serious issues that WILL be revealed in production. :)
-- Brian Crowder
Federico Feller wrote:
> Hi everyone. I have run my program with valgrind and
> there are a couple of messages from the log that i
> cant solve. I would really appreciate your help :)
>
> 1)This is part of the Leak Summary.
>
>
> ==19719== 544 bytes in 8 blocks are possibly lost in
> loss record 1 of 3
> ==19719== at 0x1B8FFD11: calloc
> (vg_replace_malloc.c:279)
> ==19719== by 0x1B8F2E1B: _dl_allocate_tls (in
> /lib/ld-2.3.2.so)
> ==19719== by 0x1B91625D: allocate_stack (in
> /lib/tls/libpthread-0.60.so)
> ==19719== by 0x1B915ED7: pthread_create@@GLIBC_2.1
> (in /lib/tls/libpthread-0.60.so)
>
>
> The sentnece that causess this error is the following:
> int res = pthread_create(&thread, NULL,
> &pthreadcallback, this);
>
>
> As far as I know, I dont have to free anys resources
> that might be created by a pthread_create() call. Am I
> right? I know its says "possibly lost", I just want to
> be sure
>
> 2) This is part of the Error Summary.
>
> ==19719== Conditional jump or move depends on
> uninitialised value(s)
> ==19719== at 0x1B900BF6: rawmemchr
> (mac_replace_strmem.c:517)
> ==19719== by 0x1BB2C7EF:
> _IO_str_init_static_internal (in
> /lib/tls/libc-2.3.2.so)
> ==19719== by 0x1BB20376: vsscanf (in
> /lib/tls/libc-2.3.2.so)
> ==19719== by 0x1BB1B48C: sscanf (in
> /lib/tls/libc-2.3.2.so)
>
> The code that causes this error is the following:
>
> char yearc[5] = " ";
> char monthc[3] = " ";
> char dayc[3] = " ";
> char hourc[3] = " ";
> char minutec[3] = " ";
> char secondc[3] = " ";
>
> sscanf(_14bytesString, "%4c%2c%2c%2c%2c%2c", yearc,
> monthc, dayc, hourc, minutec, secondc);
>
> Is this a serious problem? Is there a better way of
> doing this?
>
> Thank in advance
>
> Federico
>
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server.
> Download it for free - -and be entered to win a 42" plasma tv or your very
> own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
>
>
|