[icinga-devel] fix for servicestatusdata_add - causing "error writing to datasink"
michael.friedrich at univie.ac.at
Fri Sep 11 21:39:42 CEST 2009
since the bug has been reported I was was debugging the code and
finally, I've found my miss.
Current concept of the code breakup was to work with pointers to
addresses of the variables holding the values and build a type neutral
array handing over to the rdbm-decide function wherein the values get
casted back. there the query is prepared as a string.
Since the servicestatusdata_add query has 47 values I coded 2 wrong
typecasts (integer instead of string) and then causing a segfault to the
code. And for what it's worth I pasted the Code for MySQL to Postgres
too. If you do a cat dbqueries.c | wc -l you will see how much code has
been added comparing to old version 0.8.3 and how easy losing
concentration will be ;-)
If the ido2db child dies from a segfault(sigsev 11), idomod won't be
able to write to datasink causing the error message. Next try ido2db
parent forks a new child and then kept back data gets flushed (that's
why two ido2db processes show up in ps aux).
Tested the fix ok and everything runs fine now!
It's fixed in GIT master:
or get this new version or this file:
put it into module/idoutils/src/ and move to dbqueries.c overriding the
old one. I would recommend cloning the actual GIT master like this
getting all the latest fixes:
git clone git://git.icinga.org/icinga-core.git
More information about the icinga-devel