Bug 175819

Summary: Support for ipv6 socket reporting with --track-fds
Product: [Developer tools] valgrind Reporter: Roger Light <roger>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: wishlist CC: mark, tom
Priority: NOR    
Version: 3.3.1   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Work-in-progress patch based on dietlibc code

Description Roger Light 2008-11-22 02:18:42 UTC
Version:           3.3.1 (using KDE 3.5.9)
Compiler:          gcc 3.4.6 
OS:                Linux
Installed from:    Gentoo Packages

I'm trying to track down where some sockets are being leaked and reported as:

==31143== Open pf-10 socket 192:
==31143==    <inherited from parent>

Which isn't that useful, unfortunately. Protocol family 10 is AF_INET6 - is there any chance support for providing information on AF_INET6 sockets could be added to coregrind/m_syswrap/syswrap-generic.c:getsockdetails() ?
Comment 1 Julian Seward 2008-12-23 16:22:40 UTC
Possibly hack up a patch yourself and send it?  Personally I have
no understanding of anything but the most basic networking stuff.
Comment 2 Roger Light 2008-12-30 23:41:06 UTC
I had a look at it before and it looks reasonably straightforward. I'll give it a go.
Comment 3 Roger Light 2008-12-31 18:17:41 UTC
Created attachment 29786 [details]
Work-in-progress patch based on dietlibc code

This patch "works for me", but I'm sure it needs tidying up. Let me know what needs to be done.

The bulk of the additional code is taken from dietlibc/libcruft/inet_ntop.c

The ipv6 address compression works, but isn't the best implementation. It'll compress the following (ipv6.google.com):

2001:4860:0000:1001:0000:0000:0000:0068

To this:

2001:4860::1001:0:0:0:68

Whereas ping6 compresses it to:

2001:4860:0:1001::68

I could work up a patch with the glibc equivalent if you'd like.
Comment 4 Mark Wielaard 2014-02-24 11:16:28 UTC
Note that Debian seems to have included this patch. The Debian bug report also contains a test case. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733119
Comment 5 Tom Hughes 2014-02-24 15:06:49 UTC
Tided up and committed as r13836.