Re: [Nagios-devel] [PATCH] move thread safe macro function

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] [PATCH] move thread safe macro function

Post by Guest »

On 02/09/2011 04:35 PM, Michael Friedrich wrote:
> Hi there,
>
> I had a little chat with Sven Nierlein yesterday about the compatibility of mod_gearman to current Nagios and Icinga versions. Both HEADs contain the recent changes by Andreas regarding the thread safety for macros, while the released versions don't have that.
> mod_gearman makes use of the NEB_CALLBACK_OVERRIDE/CANCEL and in order to run a check on their own, some logic on doing a check is copied from base/checks.c including the clear_volatile_macros() function.
>
> Since this is now changed into the thread-safe implementation requiring nagios_macros* mac as argument, mod_gearman will produce a segfault. Naturally, a workaround on the module would resolve that when Nagios gets released, but possibly other NEB modules (or just older versions of mod_gearman or mklivestatus e.g. in packages) are using that functionality too, and won't work anymore.
> As far as I have checked against the source code, Merlin does not make use of those, neither do *DOUtils. On MK Livestatus I do remember some flaws but on the latest innovation release (not stable), those seem to be resolved. But as on previous changes, this might be a hidden source which breaks everything.
>
>
> In order to keep that clean, straight forward and compatible with older releases, I'd like to suggest the attached patch against the current Nagios git HEAD (from git.op5.org) which does basically the following:
>
> * rename *_macro() into *_macro_r()
> * add the non thread safe void argument function *_macro() again, calling *_macro_r() with &global_macros argument
> * put both versions into the macro.h
> * replace all internal core functionality to use the thread safe version
>

This is already done for the functions I found that are used by
modules, so it's obviously a sensible approach.

Thanks. I'll apply and push this before the weekend.

--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked