From: Brad N. <BNI...@no...> - 2009-11-25 17:39:16
|
>>> On 11/25/2009 at 10:19 AM, in message <008b01ca6df3$823a2690$86ae73b0$@com>, "Sylvester Steele" <syl...@gm...> wrote: >> >My guess is because you have static string pointers being passed from a > DSO module to gmond. I would suggest using apr_pstrdup(p, <string literal >>>here>) to allocate the memory from an APR memory pool before handing the > pointers back to gmond. > > Thanks Brad- that helped, but I am still getting a seg fault from the second > line: > > gmi = (Ganglia_25metric*)apr_array_push(metric_info); > memset (gmi, 0, sizeof(*gmi)); > > I am doing this to set the last metric to null. Why should this be > happening? BTW- my metric_info has size=10 and I am putting in only two > metrics before this (The null metric is the third) > > I don't know why you would be getting a segfault on this line. Gmond expects the array to be NULL terminated so all you are doing is adding one extra entry and filling it will NULLs. With the array being NULL terminated, gmond doesn't have to keep track of the metric count, it only has to look for a NULL entry. Brad |