Subject: Re: ares_init_options failure

Re: ares_init_options failure

From: Eino Tuominen <eino_at_utu.fi>
Date: Thu, 03 Apr 2008 07:42:29 +0300

Søren Dalby Larsen wrote:
> Hi.
>
> The following code (from bzflag-2.10) fails with a segfault in
> strlen() on my amd64 box:
>
> /* ask for local "hosts" lookups too */
> static const char* lookups = "fb";
> struct ares_options opts;
> opts.lookups = (char*)lookups; // we cheat, libares uses strdup
>
> /* start up our resolver */
> int code = ares_init_options (&aresChannel, &opts, ARES_OPT_LOOKUPS);
>
> Any clue why? As far as I can read the c-ares docs the call is ok, but
> clealy my box disagrees.

Most probably you have some memory related (buffer overflow, stack
overflow) bug in your code that writes over some addresses it shouldn't.
  Running with a debug malloc might help. Or stepping with a debugger
like Daniel suggested.

-- 
   Eino Tuominen
Received on 2008-04-03