----- Original Message -----
> ...
> That 0x...7ffff address indicates that the "Unknown Host" string is
> not coming from the heap, but from the executable's text/data section.
> That makes no sense, looking at even 3.8.0..HEAD code, as
> src/libpcp/src/auxconnect.c says:
>
> char *
> __pmHostEntGetName(__pmHostEnt *he)
> {
> if ... {
> if (he->name == NULL)
> he->name = "Unknown Host";
> }
> return strdup(he->name);
> }
>
> That is, it should only ever return heap pointers. Could you by any
I think there's the bug though - he->name still contains the pointer
to the non-heap string. If we later free that (via "he"), badness
will surely result.
> Actually that "Unknown Host" is not an appropriate response anyway,
> when that function can already return NULL due to -ENOMEM, so it
The pmlogger code appears to deal with a null return here, falling
back to some other pmcd_host value its got stashed away, so that is
probably the best fix all round. A quick audit of the other callers
also suggests they all have suitable fallback code.
It remains a mystery as to why getnameinfo(3) is failing on these
host(s) but that part seems unlikely to be a PCP problem.
cheers.
--
Nathan
|