View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0020484||FPC||Packages||public||2011-10-14 15:36||2016-03-07 18:53|
|Reporter||Anton S.||Assigned To||Michael Van Canneyt|
|Target Version||2.7.1||Fixed in Version||2.6.4|
|Summary||0020484: NetDB unable to resolve DNS when application was launched without network|
|Description||If network is down when the application is launched then ResolveName and/or ResolveHostByName fails (one returns a negative value and other returns False), and even after the network is went online every subsequent call to ResolveName and/or ResolveHostByName will still fail.|
I have a clue that this happens because when you start the app and there is no network connection /etc/resolv.conf file is pointing to no file (because /etc/resolv.conf is a link and /var/run/resolv.conf in not present) and because inside netdb's InitResolver, CheckResolveFileAge is set to False the file with resolve dns server is never reread (never updated by CheckResolveFile) on subsequent calls, so even if network goes up ResolveHostByName always return False leaving 0.0.0.0 as ip...
But even if you set CheckResolveFileAge to True then it still fails because ResolveFileAge will contain the FileAge of the link /etc/resolv.conf and not the FileAge of new/updated /var/run/resolv.conf, so ResolveFileAge<FileAge(ResolveFileName) will be always False and GetDnsServers never called again.
|Steps To Reproduce||Shutdown your network|
Launch attached test application and click on Button
Restore your network and wait until it acquire IP and DNS addresses
Click again on Button
|Additional Information||The discussion related to how i'v found this bug:|
And as i can see from related bug it also happens on Debian.
Can this be short term solution?
SResolveFile = '/var/run/resolv.conf';
SResolveFile = '/etc/resolv.conf';
|Tags||gethostbyname, netdb, ResolveHostByName, ResolveName|
|Fixed in Revision||23891|
DNSTest.zip (5,530 bytes)
||I can't set a related bug, it's 19493.|
The bug was that the resolv.conf filename is empty if it is not found.
When checking, an empty file is checked. I fixed that.
PS. Determining file age always follows the link unless you instruct it otherwise.
|2011-10-14 15:36||Anton S.||New Issue|
|2011-10-14 15:36||Anton S.||File Added: DNSTest.zip|
|2011-10-14 15:39||Anton S.||Tag Attached: gethostbyname|
|2011-10-14 15:39||Anton S.||Tag Attached: netdb|
|2011-10-14 15:39||Anton S.||Tag Attached: ResolveHostByName|
|2011-10-14 15:39||Anton S.||Tag Attached: ResolveName|
|2011-10-14 15:40||Anton S.||Note Added: 0052976|
|2011-10-14 15:51||Jonas Maebe||Relationship added||related to 0019493|
|2011-10-14 17:33||Michael Van Canneyt||Status||new => assigned|
|2011-10-14 17:33||Michael Van Canneyt||Assigned To||=> Michael Van Canneyt|
|2012-05-25 13:41||Marco van de Voort||Relationship added||related to 0022130|
|2013-01-07 12:25||Michael Van Canneyt||Fixed in Revision||=> 23336|
|2013-01-07 12:25||Michael Van Canneyt||Status||assigned => resolved|
|2013-01-07 12:25||Michael Van Canneyt||Fixed in Version||=> 2.7.1|
|2013-01-07 12:25||Michael Van Canneyt||Resolution||open => fixed|
|2013-01-07 12:25||Michael Van Canneyt||Note Added: 0064710|
|2013-01-07 12:25||Michael Van Canneyt||Target Version||=> 2.7.1|
|2014-03-04 17:46||Jonas Maebe||Fixed in Revision||23336 => 23891|
|2014-03-04 17:46||Jonas Maebe||Fixed in Version||2.7.1 => 2.6.4|
|2016-03-07 18:53||Anton S.||Note Added: 0090740|
|2016-03-07 18:53||Anton S.||Status||resolved => closed|