After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 528409 - Add IPv6 and IDN support to open files dialog
Add IPv6 and IDN support to open files dialog
Status: RESOLVED FIXED
Product: system-monitor
Classification: Core
Component: process list
2.20.x
Other Linux
: Normal normal
: ---
Assigned To: System-monitor maintainers
Depends on: 528175
Blocks:
 
 
Reported: 2008-04-16 13:53 UTC by Mark McClelland
Modified: 2011-11-11 10:03 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
IPv6 / IDN patch (2.35 KB, patch)
2008-04-16 13:54 UTC, Mark McClelland
reviewed Details | Review
IPv6 / IDN patch (v5) (2.30 KB, patch)
2008-04-17 13:20 UTC, Mark McClelland
committed Details | Review

Description Mark McClelland 2008-04-16 13:53:40 UTC
This patch adds IPv6 and IDN support to the open files dialog. It replaces the call to the deprecated gethostbyname() with new functions that have proper IPv6 and IDN support.

I must admit that there are three potential concerns with this patch:

1. It doesn't #ifdef out the code that depends on GLIBTOP_FILE_TYPE_INET6SOCKET. Therefore, it will not compile without a libgtop that defines that. If that requirement is acceptable, the minimum libgtop version listed in Configure.in and any package spec files will have to be updated.

2. IDN support isn't tested since I haven't yet found an IP that reverse-resolves to one. I'll try to add one to my own nameserver later today.

3. The open files dialog hangs on a socket with an IPv6 address that has no PTR record, and where the call to getnameinfo() takes a while. I have determined that the appropriate failsafe in friendlier_hostname() is being taken, and that it doesn't hang when the getnameinfo() call fails quickly on other addresses, so I think there must be a preexisting race condition or timeout with no fallback somewhere in the GUI.

Please let me know if you have any problems or concerns with this patch.
Comment 1 Mark McClelland 2008-04-16 13:54:35 UTC
Created attachment 109367 [details] [review]
IPv6 / IDN patch
Comment 2 Benoît Dejean 2008-04-16 15:11:27 UTC
1) since everything is for 2.23, that's no problem to bump the dependency
2) ok
3) the hangup is another problem. anyway, why not use NI_NUMERICHOST instead of the fallback ? wouldn't it be nicer to also resolve the port numbers ? then shouldn't the hints type be set to SOCK_STREAM ?
4) res is leaked when the lookup succeeds

I'm sorry, i can't really test/help anything for the moment, i've just moved in, i' still don't have internet @home and can only webbrowse @work.

Very nice patch.


(This is actually about the "Open files" dialog. I'm not sure it may be desirable to list sockets in the real "lsof" dialog.)
Comment 3 Mark McClelland 2008-04-17 13:20:58 UTC
Created attachment 109418 [details] [review]
IPv6 / IDN patch (v5)

Here's a new patch that adds service name resolution, fixes all known issues, and removes some unnecessary code. The hang was apparently not due to my patch; pulling the network cable out before opening the dialog causes the same thing without the patch (there mustn't be a caching-nameserver running on the local system of course). I also tested IDN support and it works great!
Comment 4 Benoît Dejean 2008-04-17 13:42:39 UTC
Do you know any POSIX or GNOME API to do the DNS lookup asynchronously ?
Comment 5 Mark McClelland 2008-04-17 23:40:24 UTC
I don't, but you could run the lookup in a separate thread, and set the "busy" mouse pointer while the thread is running. That would at least make it obvious that the app isn't dead. The same thing would improve the user experience in the main "lsof" dialog too (searches can take almost 10s for me, during which time the main System Monitor window doesn't refresh). 

What's strange is that even after getnameinfo times out and returns the numeric IP, the dialog still doesn't appear. Maybe this happens because the timer retriggers before the lookup can complete? The fix might be to use a one-shot timer that gets rearmed at the bottom of openfiles_timer().

I'd be glad work on fixing this if you don't have the time to right now.
Comment 6 Benoît Dejean 2008-04-18 07:10:00 UTC
I'm looking for guidelines / design pattern to asynchronously update a gtk treeview so we don't create our own stuff. Or maybe use libsoup if it is IPv6 ready.
Comment 7 Benoît Dejean 2008-05-03 10:25:40 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

Done.

libsoup doesn't do reverse lookup ... i'll see later for the async lookup.