On Sun, 15 Jan 2012, Michael Friedrich wrote:

> gcc4 is preferred. gcc3 and sooner cause funny problems with realloc.
> how about sunfreeware tools?

    Thanks for the quick response.

    I will give a newer version of GCC a go, and possibly the native
Solaris compilers as well.

> i would expect some libdbi function (get_uint or equal) to cause faulty
> memory alignments.
>
> which libdbi* versions are and installed and how? were there any
> warnings on configure?

    I've got libdbi version 0.8.4 and drivers 0.8.3.  The 
configuration went smoothly, but produced a Makefile that
contained an (errant, to the compiler I was using) option
of "-std=gnu99" and a questionable optimisation one of "-O20".
I had to manually hack the "-std=gnu99" out of the makefiles
to even get a compile.

> read on how to run ido2db in foreground and analyse the error.
> https://wiki.icinga.org/display/Dev/Debug#Debug-IDOUtils

    Great pointer -- thanks!

t1:icinga >. gdb /usr/local/icinga/build/icinga-1.6.1/module/idoutils/src/ido2db
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.9"...
(gdb) run -f -c /usr/local/icinga/etc/ido2db.cfg
Starting program: 
/usr/local/icinga/build/icinga-1.6.1/module/idoutils/src/ido2db -f -c 
/usr/local/icinga/etc/ido2db.cfg
warning: Lowest section in /lib/libpthread.so.1 is .dynamic at 00000074
[New LWP 1]
[New LWP 2]
BYTESREAD: 424
RAWBUF:

HELLO
PROTOCOL: 2
AGENT: IDOMOD
AGENTVERSION: 1.6.1
STARTTIME: 1326639193
DISPOSITION: REALTIME
CONNECTION: UNIXSOCKET
CONNECTTYPE: INITIAL
INSTANCENAME: t1_icinga
STARTDATADUMP



202:
1=300
2=0
3=0
4=1326639193.936877
73=1326639193
74=262144
72=Event broker module '/usr/local/icinga/bin/idomod.o' initialized 
successfully.
999


200:
1=104
2=0
3=0
4=1326639193.937265
105=Icinga
107=1.6.1
104=12-02-2011
102=16904
999


   USED1: 424, BYTES: 0, LINES: 0
BUF[0]='\n'
HANDLING: ''
   USED2: 423, BYTES: 1, LINES: 1
BUF[0]='\n'
HANDLING: ''
   USED2: 422, BYTES: 2, LINES: 2
BUF[5]='\n'
HANDLING: 'HELLO'
   USED2: 416, BYTES: 8, LINES: 3
BUF[11]='\n'
HANDLING: 'PROTOCOL: 2'
   USED2: 404, BYTES: 20, LINES: 4
BUF[13]='\n'
HANDLING: 'AGENT: IDOMOD'
   USED2: 390, BYTES: 34, LINES: 5
BUF[19]='\n'
HANDLING: 'AGENTVERSION: 1.6.1'
   USED2: 370, BYTES: 54, LINES: 6
BUF[21]='\n'
HANDLING: 'STARTTIME: 1326639193'
   USED2: 348, BYTES: 76, LINES: 7
BUF[21]='\n'
HANDLING: 'DISPOSITION: REALTIME'
   USED2: 326, BYTES: 98, LINES: 8
BUF[22]='\n'
HANDLING: 'CONNECTION: UNIXSOCKET'
   USED2: 303, BYTES: 121, LINES: 9
BUF[20]='\n'
HANDLING: 'CONNECTTYPE: INITIAL'
   USED2: 282, BYTES: 142, LINES: 10
BUF[23]='\n'
HANDLING: 'INSTANCENAME: t1_icinga'
   USED2: 258, BYTES: 166, LINES: 11
BUF[13]='\n'
HANDLING: 'STARTDATADUMP'

Program received signal SIGSEGV, Segmentation fault.
0xff032114 in strlen () from /lib/libc.so.1
(gdb) bt
#0  0xff032114 in strlen () from /lib/libc.so.1
#1  0xff0693dc in strdup () from /lib/libc.so.1
#2  0xff34a738 in _dbd_result_add_field () from /usr/local/lib/libdbi.so.1
#3  0xfefc28c4 in _get_field_info () from /usr/local/lib/dbd/libdbdmysql.so
#4  0xfefc302c in dbd_query () from /usr/local/lib/dbd/libdbdmysql.so
#5  0xff345028 in dbi_conn_query () from /usr/local/lib/libdbi.so.1
#6  0x3122c in ido2db_db_query (idi=0xffbff6d0,
     buf=0x61c58 "SELECT object_id, objecttype_id, name1, name2 FROM 
icinga_objects WHERE instance_id=2") at db.c:2612
#7  0x1963c in ido2db_get_cached_object_ids (idi=0xffbff6d0) at dbhandlers.c:514
#8  0x307f0 in ido2db_db_hello (idi=0xffbff6d0) at db.c:1819
#9  0x172a0 in ido2db_handle_client_input (idi=0xffbff6d0, buf=0x57a48 
"STARTDATADUMP") at ido2db.c:1569
#10 0x1705c in ido2db_check_for_client_input (idi=0xffbff6d0) at ido2db.c:1477
#11 0x16dd8 in ido2db_handle_client_connection (sd=10) at ido2db.c:1354
#12 0x16c1c in ido2db_wait_for_connections () at ido2db.c:1156
#13 0x15194 in main (argc=0, argv=0xffbffab4) at ido2db.c:303
(gdb)

> ndo2db uses plain mysql-client api, ido2db abstracts that layer to
> libdbi. i would expect an error in between. maybe due to an old compiler
> used.

    I'm going to first, go back and double-check the libdbi and
drivers for sanity and if that fails, try another compiler.
I'll report the results once they're in.  Film, as they say,
at eleven.

> solaris is and was always special and a pita to debug for errors. i've
> debugged the core myself while getting explained by a colleague how to
> work with solaris, leaving 2 weeks of my life for some gcc3 issue.

    Recall my commentary about masochists.

                                        Sincerely,

+------------------------------------------------+---------------------+
| Carl Richard Friend (UNIX Sysadmin)            | West Boylston       |
| Minicomputer Collector / Enthusiast            | Massachusetts, USA  |
| mailto:crfri...@rcn.com                        +---------------------+
| http://users.rcn.com/crfriend/museum           | ICBM: 42:22N 71:47W |
+------------------------------------------------+---------------------+

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
icinga-users mailing list
icinga-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/icinga-users

Reply via email to