Bug 286571 - doesn't see symbols from (some?) dsos
doesn't see symbols from (some?) dsos
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: valgrind (Show other bugs)
8
All Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
bzcl34nup
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-11 14:19 EDT by Matthias Clasen
Modified: 2009-01-08 23:53 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-08 23:53:23 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
valgrind log (10.32 KB, application/octet-stream)
2007-09-11 14:43 EDT, Matthias Clasen
no flags Details

  None (edit)
Description Matthias Clasen 2007-09-11 14:19:35 EDT
I am seeing a problem here, using valgrind with current rawhide. 

It gives me stacktraces like the following for leaks in the gconf daemon:

==10600== 16 bytes in 2 blocks are definitely lost in loss record 161 of 586
==10600==    at 0x4022525: malloc (vg_replace_malloc.c:149)
==10600==    by 0x4158A15: g_malloc (gmem.c:131)
==10600==    by 0x416D6FA: g_slice_alloc (gslice.c:824)
==10600==    by 0x416E921: g_slist_prepend (gslist.c:91)
==10600==    by 0x402BB0E: ???
==10600==    by 0x402EB6D: ???
==10600==    by 0x402ECAD: ???
==10600==    by 0x402EE5A: ???
==10600==    by 0x4029526: ???
==10600==    by 0x40298E6: ???
==10600==    by 0x4053534: gconf_source_query_value (gconf-sources.c:125)
==10600==    by 0x40545D9: gconf_sources_query_value (gconf-sources.c:553)
==10600==    by 0x4054B6F: hash_lookup_defaults_func (gconf-sources.c:1190)
==10600==    by 0x4143FC5: g_hash_table_foreach (ghash.c:680)
==10600==    by 0x4053E87: gconf_sources_all_entries (gconf-sources.c:1393)
==10600==    by 0x804BD35: gconf_database_all_entries (gconf-database.c:1617)
==10600==    by 0x804D91F: impl_ConfigDatabase2_all_entries_with_schema_name
(gconf-database.c:618)


As you can see, it doesn't find the debuginfo for the backend, which is a
dlopened module.

I checked the debuginfo package, and it does include the necessary files. 

gdb does not have this problem.


I wonder if this could possibly be related to the build id changes in rawhide.
(this is with current rawhide)
Comment 1 Roland McGrath 2007-09-11 14:29:57 EDT
Please try valgrind with -vvv.

This report does not say how to reproduce the bug.
Comment 2 Matthias Clasen 2007-09-11 14:42:38 EDT
I'm attaching the output of a manual run of

valgrind -v --leak-check=yes /usr/libexec/gconfd-2 

I did a gconftool-2 -R /desktop/gnome to excercise some backend code, before I
killed gconfd.

The interesting bit seems to be

--30986-- Reading syms from /usr/lib/GConf/2/libgconfbackend-xml.so (0x4026000)
--30986-- Reading debug info from
/usr/lib/debug/usr/lib/GConf/2/libgconfbackend-xml.so.debug...
--30986-- REDIR: 0x4015CA0 (stpcpy) redirected to 0x40244D0 (stpcpy)
--30986-- Discarding syms at 0x4026000-0x4034000 in
/usr/lib/GConf/2/libgconfbackend-xml.so due to munmap()


But I don't really know what it means. Who did the munmap ?
Comment 3 Matthias Clasen 2007-09-11 14:43:11 EDT
Created attachment 192851 [details]
valgrind log
Comment 4 Roland McGrath 2007-09-11 15:38:46 EDT
munmap of the DSO address range should be done only by dlclose.
Try the LD_DEBUG=files environment variable to see if the DSO is really being
closed.  If not, valgrind may be confused.  If your application dlclose's as a
matter of course, then by the time you are at the end of the run it is true and
proper that those PC addresses are no longer mapped to the DSO.  So I suspect
all that's happening is that you have memory leaks in the DSOs that get unloaded
during the run.

One can imagine a couple of things valgrind could do to help you track these
down.  One way would be to keep around the debuginfo/symbols for a DSO after
it's unmapped, until that address is mmap'd for something new.  Then it could
still translate those stale addresses, and print ("in unloaded DSO foobar.so")
when describing them.

Another idea is one that might help find some bugs quicker.  That is, an option
to keep track of PC addresses used in allocation record backtraces for live
allocations as "in use".  Then, when munmap'ing code pages, it could check the
address range against all such PCs in use.  Then at the time of the dlclose it
would report "caller of live allocated block being unloaded".  Such cases are
not always errors, though.

As to a workaround to find your bug, you could try tweaking your application so
it does not dlclose anything.  Then you would have symbolic information for
those leak reports.  A simple hack to do this for debugging is to collect the
list of dlopen'd DSOs in your run, and insert an extra dlopen call for each;
that will keep a ref alive so the normal dlclose is actually a no-op.
Comment 5 Bug Zapper 2008-04-04 09:49:13 EDT
Based on the date this bug was created, it appears to have been reported
during the development of Fedora 8. In order to refocus our efforts as
a project we are changing the version of this bug to '8'.

If this bug still exists in rawhide, please change the version back to
rawhide.
(If you're unable to change the bug's version, add a comment to the bug
and someone will change it for you.)

Thanks for your help and we apologize for the interruption.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.
Comment 6 Bug Zapper 2008-11-26 02:47:03 EST
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 7 Bug Zapper 2009-01-08 23:53:23 EST
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.