Problem running ./all-bash on mac os x leopard

94 views
Skip to first unread message

kc

unread,
Nov 11, 2009, 4:03:52 AM11/11/09
to golang-nuts
While running ./all.bash, I got this error:

--- FAIL: http.TestClient
Get http://www.google.com/robots.txt: dial tcp www.google.com:http:
lookup www.google.com. on 10.0.1.1:53: no answer from server
--- FAIL: http.TestRedirect
Get http://codesearch.google.com/: dial tcp
codesearch.google.com:http: lookup codesearch.google.com. on
10.0.1.1:53: no answer from server
FAIL
make[1]: *** [test] Error 1
make: *** [http.test] Error 2


What could be causing the http.TestClient to fail? I verified that I
am connected and able to browser to www.google.com and
codesearch.google.com.

Russ Cox

unread,
Nov 11, 2009, 4:09:19 AM11/11/09
to kc, golang-nuts
On Wed, Nov 11, 2009 at 01:03, kc <kec...@gmail.com> wrote:
>
> While running ./all.bash, I got this error:
>
> --- FAIL: http.TestClient
>        Get http://www.google.com/robots.txt: dial tcp www.google.com:http:
> lookup www.google.com. on 10.0.1.1:53: no answer from server
> --- FAIL: http.TestRedirect
>        Get http://codesearch.google.com/: dial tcp
> codesearch.google.com:http: lookup codesearch.google.com. on
> 10.0.1.1:53: no answer from server
> FAIL
> make[1]: *** [test] Error 1
> make: *** [http.test] Error 2

Typically this happens because you are offline or because
your firewall is blocking the DNS packets from coming back.
At this point in the build process you've built everything,
so if you don't care about the network tests you can just
move on to actually using the system.

In particular, on a Mac if you have the firewall enabled
it won't let programs listen on UDP sockets, which the
Go DNS resolver needs to do. But it could just as easily
be some other piece of your network.

Russ

Sverre Rabbelier

unread,
Nov 11, 2009, 4:12:13 AM11/11/09
to kc, golang-nuts
heya,

On Wed, Nov 11, 2009 at 10:03, kc <kec...@gmail.com> wrote:
> What could be causing the http.TestClient to fail? I verified that I
> am connected and able to browser to www.google.com and
> codesearch.google.com.

From other posts to the mailing list there's probably a firewall in
the way, have a look through the list archives for a more detailed
explanation.

--
Cheers,

Sverre Rabbelier

kc

unread,
Nov 11, 2009, 4:19:19 AM11/11/09
to golang-nuts
I found out what's wrong. I think ./all.bash's TestClient triggers an
incoming
connection from these hosts. I think there may be
a bug in mac os firewall?? it prompts me to say Allow or Deny
in a popup. I always clicked Allow. Security > firewall also says
Allow.
But I had to check "Allow all incoming connections", then it's all
happy.

I hope it doesnt want all my ports open all the time while Go'ing.
=).
I am going to set my firewall back

Any insight?


On Nov 11, 1:03 am, kc <kec...@gmail.com> wrote:
> While running ./all.bash, I got this error:
>
> --- FAIL: http.TestClient
>         Gethttp://www.google.com/robots.txt:dial tcpwww.google.com:http:
> lookupwww.google.com. on 10.0.1.1:53: no answer from server
> --- FAIL: http.TestRedirect
>         Gethttp://codesearch.google.com/:dial tcp

Jens Alfke

unread,
Nov 11, 2009, 12:15:31 PM11/11/09
to r...@golang.org, kc, golang-nuts

On Nov 11, 2009, at 1:09 AM, Russ Cox wrote:

> In particular, on a Mac if you have the firewall enabled
> it won't let programs listen on UDP sockets, which the
> Go DNS resolver needs to do.

Does Go really need to run its own DNS resolver? Every OS already provides one built-in. Even if Go's is better in some way, it's going to be handicapped by needing to open a UDP listener port (which I think will be problematic on the future in Windows too, as well as Mac OS), as well as not sharing a DNS cache with other processes.

Perhaps the custom DNS could be included as an opt-in option for programs that really want its extra features(?), but the library defaults to using the OS's DNS.

—Jens

John Cowan

unread,
Nov 11, 2009, 12:42:08 PM11/11/09
to Jens Alfke, r...@golang.org, kc, golang-nuts
On Wed, Nov 11, 2009 at 12:15 PM, Jens Alfke <je...@mooseyard.com> wrote:
>
>
> On Nov 11, 2009, at 1:09 AM, Russ Cox wrote:
>
>> In particular, on a Mac if you have the firewall enabled
>> it won't let programs listen on UDP sockets, which the
>> Go DNS resolver needs to do.
>
> Does Go really need to run its own DNS resolver? Every OS already provides one built-in.

Unfortunately, they are neither re-entrant nor thread-safe. Since
goroutines are green threads, the whole app would be frozen if any one
goroutine did a DNS lookup.

> Even if Go's is better in some way, it's going to be handicapped by needing to open a UDP listener port (which I think will be problematic on the future in Windows too, as well as Mac OS), as well as not sharing a DNS cache with other processes.

Caching is done by DNS servers, not by DNS client libraries.

>
> Perhaps the custom DNS could be included as an opt-in option for programs that really want its extra features(?), but the library defaults to using the OS's DNS.
>
> —Jens

--
GMail doesn't have rotating .sigs, but you can see mine at
http://www.ccil.org/~cowan/signatures

Jens Alfke

unread,
Nov 11, 2009, 12:59:04 PM11/11/09
to John Cowan, r...@golang.org, kc, golang-nuts

On Nov 11, 2009, at 9:42 AM, John Cowan wrote:

>> Does Go really need to run its own DNS resolver? Every OS already
>> provides one built-in.
>
> Unfortunately, they are neither re-entrant nor thread-safe. Since
> goroutines are green threads, the whole app would be frozen if any one
> goroutine did a DNS lookup.

Other languages with green threads have dealt with this without having
to roll their own DNS. Both Mac and Linux have getaddrinfo_a, which
does async lookups.

> Caching is done by DNS servers, not by DNS client libraries.


My understanding is that, at least on Mac OS, the DirectoryServices
daemon does local caching for performance reasons.

Another issue I just realized: Go on Mac probably doesn't support
multicast-DNS (Bonjour) hostnames, i.e. the ".local" TLD.

—Jens

Russ Cox

unread,
Nov 11, 2009, 1:07:17 PM11/11/09
to Jens Alfke, kc, golang-nuts
On Wed, Nov 11, 2009 at 09:15, Jens Alfke <je...@mooseyard.com> wrote:
> On Nov 11, 2009, at 1:09 AM, Russ Cox wrote:
>> In particular, on a Mac if you have the firewall enabled
>> it won't let programs listen on UDP sockets, which the
>> Go DNS resolver needs to do.
>
> Does Go really need to run its own DNS resolver?

No, but it was a great way to get off the ground.

> Every OS already provides one built-in. Even if Go's is
> better in some way, it's going to be handicapped by
> needing to open a UDP listener port (which I think will be
> problematic on the future in Windows too, as well as
> Mac OS), as well as not sharing a DNS cache with other processes.

The 6g/8g/etc tool chain doesn't link against standard libraries,
because the calling conventions are different, because the segmented
stack model is very different, and because we want to be able to
start fresh instead of starting by pulling in the entire software stack
that already exists.

I'd like to interact with the system DNS resolver on the Mac, but
just like with the Windows port, we have finite resources and
more things are pressing. I assume that on the Mac the DNS
resolver is some Mach service and can be RPCed to. That's
possible to make work if we could find some documentation
on the Mac side to find out exactly what it involves.

> Perhaps the custom DNS could be included as an opt-in option
> for programs that really want its extra features(?), but the library
> defaults to using the OS's DNS.

If DNS resolution were a system call, this would be trivial and done.
The problem is that it is different on each system. Again, if someone
can explain what needs to happen (without saying "just link against
this library"), then that would speed the process. And if someone
wants to write the code, that would speed it even more.

We understand that using the same DNS resolver that all the other
programs do is a good thing; we just don't know how to do it yet.

Russ

Daniel Spangler

unread,
Nov 16, 2009, 10:51:49 AM11/16/09
to golang-nuts
Does anyone know of a way of adjusting the osx firewall such that we
don't have to completely turn it off when performing http requests?

On Nov 11, 1:07 pm, Russ Cox <r...@golang.org> wrote:

Russ Cox

unread,
Nov 17, 2009, 12:15:19 AM11/17/09
to Daniel Spangler, golang-nuts
On Mon, Nov 16, 2009 at 07:51, Daniel Spangler
<daniel....@gmail.com> wrote:
> Does anyone know of a way of adjusting the osx firewall such that we
> don't have to completely turn it off when performing http requests?

I think the firewall is doing its job. The thing to do is figure
out how to talk to the system DNS resolver (probably over
Mach RPC), and implement that. If anyone knows details,
I'd be happy to hear them.

Russ
Reply all
Reply to author
Forward
0 new messages