{"action":"created","issue":{"url":"https://api.github.com/repos/minoca/os/issues/86","repository_url":"https://api.github.com/repos/minoca/os","labels_url":"https://api.github.com/repos/minoca/os/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/minoca/os/issues/86/comments","events_url":"https://api.github.com/repos/minoca/os/issues/86/events","html_url":"https://github.com/minoca/os/issues/86","id":195116823,"number":86,"title":"DNS recursion loop in wget","user":{"login":"vascocosta","id":5316157,"avatar_url":"https://avatars.githubusercontent.com/u/5316157?v=3","gravatar_id":"","url":"https://api.github.com/users/vascocosta","html_url":"https://github.com/vascocosta","followers_url":"https://api.github.com/users/vascocosta/followers","following_url":"https://api.github.com/users/vascocosta/following{/other_user}","gists_url":"https://api.github.com/users/vascocosta/gists{/gist_id}","starred_url":"https://api.github.com/users/vascocosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vascocosta/subscriptions","organizations_url":"https://api.github.com/users/vascocosta/orgs","repos_url":"https://api.github.com/users/vascocosta/repos","events_url":"https://api.github.com/users/vascocosta/events{/privacy}","received_events_url":"https://api.github.com/users/vascocosta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-12-12T23:28:42Z","updated_at":"2016-12-16T00:20:59Z","closed_at":null,"body":"This could be a coincidence or some issue with my DNS servers, but after the latest commits I've started noticing a high frequency of \"DNS recursion loop\" errors in wget.\r\n\r\nIn [QEMU](http://i.imgur.com/yIM1y5d.png) it doesn't seem too serious and it eventually resolves, on the other hand it sends wget into an infinite loop in [VirtualBox](http://i.imgur.com/6FIpwtO.png). This is seemingly triggered by websites using https redirects.\r\n\r\nI wonder if this could in away be related to the recent TCP fix by @ccstevens, but maybe I'm totally off here.\r\n\r\nOn a related note, I wonder if there's any way to manually override the DNS servers provided by the DHCP server as this would be handy to debug this issue. From what I've seen the logic is hardcoded in the kernel and I'm not sure there's a way to expose it to the user land."},"comment":{"url":"https://api.github.com/repos/minoca/os/issues/comments/267483958","html_url":"https://github.com/minoca/os/issues/86#issuecomment-267483958","issue_url":"https://api.github.com/repos/minoca/os/issues/86","id":267483958,"user":{"login":"vascocosta","id":5316157,"avatar_url":"https://avatars.githubusercontent.com/u/5316157?v=3","gravatar_id":"","url":"https://api.github.com/users/vascocosta","html_url":"https://github.com/vascocosta","followers_url":"https://api.github.com/users/vascocosta/followers","following_url":"https://api.github.com/users/vascocosta/following{/other_user}","gists_url":"https://api.github.com/users/vascocosta/gists{/gist_id}","starred_url":"https://api.github.com/users/vascocosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vascocosta/subscriptions","organizations_url":"https://api.github.com/users/vascocosta/orgs","repos_url":"https://api.github.com/users/vascocosta/repos","events_url":"https://api.github.com/users/vascocosta/events{/privacy}","received_events_url":"https://api.github.com/users/vascocosta/received_events","type":"User","site_admin":false},"created_at":"2016-12-16T00:20:59Z","updated_at":"2016-12-16T00:20:59Z","body":"To eliminate one further variable I was able to force VirtualBox to use a Google name server on the DHCP lease:\r\n\r\n```\r\nMinoca debugger version 1.1. Protocol version 1.3.\r\nWaiting to connect...\r\nConnected to Minoca OS on x86\r\nSystem Version 0.3.1.2029 development debug vasco-issue-86-c8ec3a2 Dec 15 2016 00:46:52\r\nBuilt on Thu Dec 15, 2016 12:46 AM.\r\nNew Device: RawDisk, 0x801b7958\r\nNew Device: Partition1, 0x801ba460\r\nNew Device: Partition2, 0x801b85e8\r\nNew Device: Volume0, 0x801ba578\r\nNew Device: Volume1, 0x801b9fb0\r\nNET: 08:00:27:B9:20:F8 up, Speed 100 mbps\r\nDHCP Assignment:\r\n           Server IP: 10.0.2.2\r\n          Offered IP: 10.0.2.15\r\n           Router IP: 10.0.2.2\r\n       DNS Server IP: 8.8.8.8\r\n          Lease Time: 1 day.\r\n```\r\n\r\nThen, as you mentioned, this segmentation fault was causing a break into the kernel debugger:\r\n\r\n```\r\nDebugger: 0xd687b2516, Target: 0xd867d4529\r\nlibminocaos.so!RtlStringLength+0x6:\r\n777e491d cmp\t[edx], 0x0\t; 803a00\r\nkd>kn\r\nNo Frame    RetAddr  Call Site\r\n 0 7fffe640 776b9fa9 libminocaos.so!RtlStringLength+0x6\r\n 1 7fffe660 7769e158 libc.so!strlen+0x1a\r\n 2 7fffe690 7769e528 libc.so!ClpIsNameSubdomain+0x1f\r\n 3 7fffe730 7769f273 libc.so!ClpPerformDnsTranslation+0x396\r\n 4 7fffe780 7769e5b7 libc.so!ClpGetNameServerAddress+0xbf\r\n 5 7fffe830 7769eb25 libc.so!ClpPerformDnsTranslation+0x425\r\n 6 7fffe970 0004c49a libc.so!getaddrinfo+0x4ae\r\n 7 7fffeb68 0003d1ad sh+0x4b49a\r\n 8 7fffeb98 00027eb5 sh+0x3c1ad\r\n 9 7fffebf8 000292a9 sh+0x26eb5\r\n10 7fffec68 000288a6 sh+0x282a9\r\n11 7fffecb8 00028a23 sh+0x278a6\r\n12 7fffed08 00036571 sh+0x27a23\r\n13 7fffed68 0003d1ad sh+0x35571\r\n14 7fffed98 0003d4e2 sh+0x3c1ad\r\n15 7fffedf8 0005ae82 sh+0x3c4e2\r\n16 7fffee34 777d6f6d sh+0x59e82\r\n17 7fffee84 00000000 libminocaos.so!OsDynamicLoaderMain+0x298\r\nkd>dv\r\n[0x7fffe640] String              : 0x00000000\r\n\r\n<const>      Length              : 0x0\r\nkd>\r\n```\r\n\r\nFrom which was clear that either Name or `Query` or `Domain` in `ClpIsNameSubdomain` were a NULL reference. Thus, once `RtlStringLength` did the actual pointer dereferencing to 0x00000000 the segmentation fault was triggered.\r\n\r\nBy adding the following workaround to the beginning of `ClpIsNameSubdomain` everything works nicely and it resolves. However, the real question is why `ClpPerformDnsTranslation` calls `ClpIsNameSubdomain` with a NULL `NameServer->Value` or `Name`. That's what I'll be trying to answer tomorrow.\r\n\r\n```c\r\nif (Query == NULL || Domain == NULL) {\r\n    return FALSE;\r\n}\r\n```"}}
{"actor":{"display_login":"vascocosta"}}