Bug #1253

SEGV in ido2db on Solaris with Oracle

Added by Tommi about 3 years ago. Updated almost 2 years ago.

Status:ClosedStart date:02/28/2011
Priority:NormalDue date:
Assignee:Tommi% Done:

0%

Category:-
Target version:-
Icinga Version: DB Type:
IDO Version: DB Version:

Description

see http://www.nagios-portal.org/wbb/index.php?page=Thread&threadID=21804
There are 2 problemes
1. cast from time_t (long) to unsigned long long in OCI_Bind
2. Null Strings in printf ("%s",..)

Solution:
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

idoutils.diff.zip - zipp (9.68 KB) Tommi, 02/28/2011 09:40 pm


Related issues

Related to IDOUtils - Bug #2271: unsafe null ptr passed to debug log, segfault on solaris Resolved 01/16/2012

Associated revisions

Revision 06a7deee
Added by Tommi about 2 years ago

fix build issues on modules and broken snprintf function causing segv on solaris #1772
refs #1772, #1253

Revision 543952f2
Added by Tommi about 2 years ago

idoutils logging: Fix non gcc compiler problems with gnu extension printf #1253
refs #1253

Revision a7a9dd54
Added by Tommi about 2 years ago

idoutils,core: add snprintf.h static header with definitions for configure time missed functions now available in snprintf.c .this fixes a lot of compiler warnings about undefined symbols
refs #1253

History

#1 Updated by dnsmichi about 3 years ago

  • Target version set to 1.4

#2 Updated by dnsmichi about 3 years ago

  • Status changed from New to Assigned
  • Assignee set to Tommi

now it's yours ;-)

#3 Updated by dnsmichi almost 3 years ago

  • Status changed from Assigned to Feedback

this might need some rework - or is it already done?

#4 Updated by Tommi almost 3 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.

#5 Updated by dnsmichi almost 3 years ago

  • Target version deleted (1.5)

removing release target for proper resolution.

#6 Updated by Tommi almost 3 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

#7 Updated by dnsmichi almost 2 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF