Paul, thanks for that. However, I'd be more inclined to get the APR version working as it should.

Vladimir, were there specific bug reports for gmond crashing? Or any more information to help us narrow down what the root cause may have been?


On Wed, Sep 26, 2012 at 9:20 AM, Paul Hewlett <> wrote:

Hi Nicholas


The +1 should be +2 in the malloc() call – one for the terminating null and one for the ‘:’ character.






Paul Hewlett  X25250


110 Fulbourn Road, Cambridge, CB1 9NJ

Tel: +44 (0)1223 405923

skype: paul-at-arm



From: Nicholas Satterly []
Sent: 26 September 2012 00:49
Subject: [Ganglia-developers] override_ip causing gmond to crash




I've discovered that on some of our systems (perhaps only half a dozen out of 500 or so) gmond crashes if the "override_ip" configuration option is set. I've worked out that the problem is something to do with this block of code...


#if 1

                char* tmpstr = malloc( strlen(( override_ip != NULL ? override_ip : override_hostname )) + strlen( override_hostname ) + 1 );

                strcpy (tmpstr, (char *)( override_ip != NULL ? override_ip : override_hostname ) );

                strcat (tmpstr, ":");

                strcat (tmpstr, (char *) override_hostname);


                cb-> = tmpstr;


#if 0

                cb-> = apr_pstrcat(gm_pool, (char *)( override_ip != NULL ? override_ip : override_hostname ), ":", (char *) override_hostname, NULL);



What I'm trying to understand at the moment is why the "apr_pstrcat" version is "#if 0" commented out when it seems to work OK during my testing.




-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.