bind(): Can't assign requested address

Brad Fitzpatrick brad at danga.com
Mon Nov 22 22:57:54 PST 2004


I'd debug the server independently of the client.

Telnet to the server and try doing:

bradfitz at bini:~$ telnet localhost 11211
Trying 127.0.0.1...
Connected to bini.
Escape character is '^]'.
set foo 0 0 3
bar
STORED
get foo
VALUE foo 0 3
bar
END
^]
telnet> q
Connection closed.

And see what's slow.

Maybe run memcached in the foreground with debugging on in one window, and
your telnet in anohter, and see where the delays are.

If the server works, only then start using the client and debugging.

Avva, can you commit that memset patch?

- Brad


On Mon, 22 Nov 2004, Dave Roe wrote:

> thanks to all who replied.
>
> > Please try this patch and tell me if it helps. I don't have an OS X
> > machine to test it with.
> >
> > +    memset(&addr, 0, sizeof(addr));
>
> that seemed to solve the problem I was experiencing with bind.
> Christopher's suggestion of running it without the -l option also
> worked.
>
> I am now forging ahead and using Cache::Memcached (1.14) with Perl
> (5.8.0) on OS X (10.3.1) but my results so far are not good. Is there a
> more suitable place to discuss the Perl API?
>
> Basically, I am trying something like this:
>
> use strict;
> use Cache::Memcached;
>
> my $memd = new Cache::Memcached( { servers => [ "127.0.0.1:11211" ] } );
> my $key = "test_key";
> my $data = $memd->get($key);
> if ($data) {
>      print STDERR "existing data\n";
> }
> else {
>      $data = { hello => 'world' };
>      my $memd_set = $memd->set($key,$data);
>      print STDERR "memd set failed\n" unless ($memd_set);
> }
>
> What I am seeing is "Use of uninitialized value in string eq at
> /opt/perl/lib/site_perl/5.8.0/Cache/Memcached.pm line 439". This is the
> line:
>
> return $res eq "STORED\r\n";
>
> Essentially, the return value from the call to
> _oneline($self,$sock,$line) on line 427 is undefined, so I still have
> problems in there somewhere. It also takes about 2 seconds to complete
> that subroutine call (or is this what Sean refers to as terrible kqueue
> performance under non-server OS X?) or maybe what I am seeing is
> actually one second for select_timeout.
>
> What is the best way to go about debugging this? Should I be trying to
> run memcached without the -d switch in some sort of verbose mode? Or
> should I hack Cache/Memcached.pm and see what I can print out?
>
> Thanks again,
> /dave
>
>


More information about the memcached mailing list