Re: Testing valgrind in rawhide (separate valgrind-debuginfo package)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2013-03-06 at 14:38 +0000, Richard W.M. Jones wrote:
> BTW can you clear up a peculiarity I've noticed in valgrind in
> Rawhide?
> 
> The symbols reported in the stack traces seem to be mangled in a
> strange way, eg:
> 
> ==11843== 56 bytes in 1 blocks are definitely lost in loss record 6 of 6
> ==11843==    at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==11843==    by 0x38EAC861F9: strdup (strdup.c:42)
> ==11843==    by 0x38EC8097C9: setprocattrcon_raw.constprop.3 (procattr.c:241)
> ==11843==    by 0x38EC8099B7: setprocattrcon.constprop.2 (procattr.c:274)
> ==11843==    by 0x400955: main (in /tmp/test)
> 
> The symbol we're actually calling is 'setsockcreatecon'.  It's not a
> macro.  There is no public function called 'setprocattrcon' (although
> there is an internal function of that name and setsockcreatecon only
> calls this internal functions so there could be some inlining going
> on).  And what's with the '.constprop.2' suffix?

Right, there is something like inlining going on. Though not actual
inlining, more like calling specialied variants of the function. Some
GCC hacker might correct me if I get the details wrong. But I think this
is just caused by (better) optimization of GCC 4.8 in rawhide. As far as
I understand it GCC sees that setsockcreatecon (NULL) is really
setprocattrcon with some constant arguments call. The src/procattr.c
definition of all_selfattr_def(sockcreatecon, sockcreate) make it a
little hard to see exactly, but obviously GCC knows. For example the pid
argument will always be zero. Because of this GCC creates a specialized
"constant propagation function" based on setprocattrcon called
setprocattrcon.constprop.somenumber. And as far as I can see that is the
actual function that the setsockcreatecon function PLT entry points to.
(And this setprocattrcon.constprop.2 then calls a specialized constant
propagation function version of setprocattrcon_raw.)

> In any case, this is a problem because in my valgrind suppressions
> file I have to list the mangled name, not the real name.

It looks like you will have to use the setprocattrcon[.constprop]
function name in your suppression file. I am not exactly sure how the
linker ends up pointing directly to that one for setsockcreatecon (),
but it apparently is. And so valgrind will only know it by that name.
Sorry.

Note that you can let valgrind create the suppression for you with
--gen-suppressions=yes. And you can also use wildcards in suppressions
like fun:setprocattrcon.constprop.*.

Cheers,

Mark

-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux