SEGV in ido2db on Solaris with Oracle
|Icinga Version:||1.10.0||OS Version:||any|
There are 2 problemes
1. cast from time_t (long) to unsigned long long in OCI_Bind
2. Null Strings in printf ("%s",..)
1.looks like there is no real usage of unsigned long long in the code, but please check back for measurement values
then replace all OCIBindUnsignetBigInt ((big_uint)...) with OCIBindUnsignetBigInt ((uint)..)
2. Make sure NULL values will be translated into real empty string e.g strdup("") and use functions from supplied snprintf.c in solaris. For this a modification of config.h (better in configure.in) is needed (switch off HAVE_VA_COPY and HAVE_C99_VSNPRINTF), dont use os provided functions like vfprintf which are not covered by snprintf.c. Take care, a syslog call includes such function internally
Attached are diffs for V1.3.0, which are working for me
#4 Updated by Tommi almost 4 years ago
- Target version changed from 1.4 to 1.5
My patch changes all number types at all, which is wrong approach we learned. Each data type needs to be checked if is large enough in database, sqlstring and coded c data type.
My "solution" regarding handling null strings you already rejected. I dont have a new one for now.
I just trying to build icinga with native Sun compiler (SunStudio), but there are a lot other problems with building dependencies.
#6 Updated by Tommi almost 4 years ago
i agree. It will take much more time to sort it out.
ocilib big_int handling is a mess, because it can be 4bytes or 8bytes depending of detecting longlong by ocilib in ocilib.h and recalculated when including it into icinga. Means you can build ocilib with 4byte big_int and build icinga using 8byte. longlong detection failed in linux up to 3.9.1, maybe this is the reason we dont run into problems until now, when casting pointers to bigint, because it was in every case only 4byte. See http://sourceforge.net/projects/orclib/forums/forum/470801/topic/4603198