Subject: Re: ares_init_options failure

Re: ares_init_options failure

From: Søren Dalby Larsen <sdlarsen_at_gmail.com>
Date: Thu, 3 Apr 2008 10:24:55 +0200

I'll investigate further. For now I've just compiled bzflag with debug
info to get started. Gdb was friendly enough to show me where it went
wrong and this was as far as i got (in source code) without debugging
versions of libraries.
I'll have to try with a debug version of c-ares too.

Thanks :)

/Søren
On 4/3/08, Eino Tuominen <eino_at_utu.fi> wrote:
> 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