Bad access to IP address in memory

Russ Allbery rra at stanford.edu
Sat Jul 5 00:37:54 UTC 2008


Julien ÉLIE <julien at trigofacile.com> writes:

>>    case CTnntp:
>>        snprintf(cp->Name, sizeof(cp->Name), "%s:%d",
>>                 cp->Address.ss_family == 0 ? "localhost" : RChostname(cp),
>>                 cp->fd);
>>        break;
>>
>> I wonder if something similar is needed in status, although the results
>> you see still don't look like printing out zeroed memory.
>
> Sure.  It would indeed solve the visible problem, but not what happens
> below the iceberg.
>
> By the way, if I change
>    memset( &new->Address, 0, sizeof( new->Address ) );
> to
>    memset( &new->Address, 1, sizeof( new->Address ) );
> or another value, "localhost" is not written;  I thought ss_family
> could be AF_INET or AF_INET6 (or 0).

Well, the code uses a family value of 0 to determine that it's a local
socket, so if you set it to something else, the code gets confused.

> Sorry for this lame question but... how to run innd under valgrind?
>
> I tried
>
>    valgrind --trace-children=yes --track-fds=yes --log-file=inn-valgrind /home/news/bin/innd
>
> (and also rc.news)
> but it does not work.  After a few seconds, valgrind stops...  (And innd
> goes on alone.)

I'm not sure.  When I've done this before, I don't recall having any
special trouble.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list