|
From: Daniel B. <Ble...@ma...> - 2009-06-03 15:03:33
|
Perhaps someone can give me some help...
I¹d like to suppress a ³still reachable² warning, but perhaps I don¹t
understand Valgrind¹s behavior.
This is the leak I have:
==18070== 48 bytes in 1 blocks are still reachable in loss record 1 of 1
==18070== at 0x4A06019: operator new(unsigned long)
(vg_replace_malloc.c:167)
==18070== by 0x981FC3:
log4cpp::Appender::_addAppender(log4cpp::Appender*) (in
/home/blezek/Source/Testing/MI3CLibNightly-linux86-gcc/bin/NoOp)
<snip>
Valgrind reports 0 errors, but 48 bytes still reachable. I generated a
suppression and used it, but the output is exactly the same! Using the V
flag, I don¹t see that my suppression is being used. It looks like this:
{
log4cpp-2
Memcheck:Leak
fun:_vgrZU_libstdcZpZpZa__Znwm
fun:_ZN7log4cpp8Appender12_addAppenderEPS0_
fun:_ZN7log4cpp8AppenderC2ERKSs
fun:_ZN7log4cpp16AppenderSkeletonC2ERKSs
fun:_ZN7log4cpp14LayoutAppenderC2ERKSs
fun:_ZN7log4cpp15OstreamAppenderC1ERKSsPSo
fun:_ZN4mi3c6Logger17setDefaultLoggingESs
fun:main
}
And was generated by Valgrind directly.
I¹m running the latest release of Valgrind (3.4.1), and would be happy to
provide any further logs if it would help.
Best regards,
-dan
--
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center
P 127 or (77) 8 8886
T 507 538 8886
E ble...@ma...
Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org
|
|
From: Tom H. <to...@co...> - 2009-06-03 15:27:36
|
Daniel Blezek wrote: > Perhaps someone can give me some help... > > I’d like to suppress a “still reachable” warning, but perhaps I don’t > understand Valgrind’s behavior. I don't think you can - it's not really a warning, it's more of an informational message that you only get if you ask for it. > This is the leak I have: If it's still reachable then it's not a leak ;-) Tom -- Tom Hughes (to...@co...) http://www.compton.nu/ |
|
From: Nicholas N. <n.n...@gm...> - 2009-06-04 00:52:49
|
On Thu, Jun 4, 2009 at 1:27 AM, Tom Hughes <to...@co...> wrote: > Daniel Blezek wrote: > >> Perhaps someone can give me some help... >> >> I’d like to suppress a “still reachable” warning, but perhaps I don’t >> understand Valgrind’s behavior. > > I don't think you can - it's not really a warning, it's more of an > informational message that you only get if you ask for it. No, still reachable warnings can be suppressed. I just tried it with a trivial C example and it worked, so it looks like Daniel's suppression isn't matching for some reason. Daniel, try removing lines one at a time from the bottom of the suppression (starting at "fun:main" and see if you can get it to match that way. It's possible there's a problem with the suppression matching. Nick |
|
From: Daniel B. <Ble...@ma...> - 2009-06-04 13:15:18
|
Hi Nick,
These comments were helpful. Our CentOS shippes with 3.2.1 which produces
this suppression:
{
<insert a suppression name here>
Memcheck:Leak
fun:_vgrZU_libstdcZpZpZa__Znwm
fun:_ZN7log4cpp8Appender12_addAppenderEPS0_
fun:_ZN7log4cpp8AppenderC2ERKSs
fun:_ZN7log4cpp16AppenderSkeletonC2ERKSs
fun:_ZN7log4cpp14LayoutAppenderC2ERKSs
fun:_ZN7log4cpp15OstreamAppenderC1ERKSsPSo
fun:_ZN4mi3c6Logger17setDefaultLoggingESs
fun:main
}
[blezek@mi3bld04 MI3CLibNightly-linux86-gcc]$ /usr/bin/valgrind --version
valgrind-3.2.1
But I installed 3.4.1 in /usr/local
{
<insert a suppression name here>
Memcheck:Leak
fun:_Znwm
fun:_ZN7log4cpp8Appender12_addAppenderEPS0_
fun:_ZN7log4cpp8AppenderC2ERKSs
fun:_ZN7log4cpp16AppenderSkeletonC2ERKSs
fun:_ZN7log4cpp14LayoutAppenderC2ERKSs
fun:_ZN7log4cpp15OstreamAppenderC1ERKSsPSo
fun:_ZN4mi3c6Logger17setDefaultLoggingESs
fun:main
}
[blezek@mi3bld04 MI3CLibNightly-linux86-gcc]$ /usr/local/bin/valgrind
--version
valgrind-3.4.1
Notice the difference:
3.2.1: fun:_vgrZU_libstdcZpZpZa__Znwm
3.4.1: fun:_Znwm
Using the 3.4.1 suppression in 3.2.1 worked just fine. I don't know if this
is a bug, but it's not something I would have figured out on my own... In
any case, I have a fix and am happy.
Thanks much,
-dan
On 6/3/09 7:20 PM, "Nicholas Nethercote" <n.n...@gm...> wrote:
> On Thu, Jun 4, 2009 at 1:27 AM, Tom Hughes <to...@co...> wrote:
>> Daniel Blezek wrote:
>>
>>> Perhaps someone can give me some help...
>>>
>>> I¹d like to suppress a ³still reachable² warning, but perhaps I don¹t
>>> understand Valgrind¹s behavior.
>>
>> I don't think you can - it's not really a warning, it's more of an
>> informational message that you only get if you ask for it.
>
> No, still reachable warnings can be suppressed. I just tried it with
> a trivial C example and it worked, so it looks like Daniel's
> suppression isn't matching for some reason.
>
> Daniel, try removing lines one at a time from the bottom of the
> suppression (starting at "fun:main" and see if you can get it to match
> that way. It's possible there's a problem with the suppression
> matching.
>
> Nick
--
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center
P 127 or (77) 8 8886
T 507 538 8886
E ble...@ma...
Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org
|