Re: [Nagios-db-devel] Segfaults with the postgres ned
Status: Beta
Brought to you by:
bench23
From: Ben <be...@si...> - 2005-01-19 16:38:31
|
On Jan 19, 2005, at 6:11 AM, Tim Verhoeven wrote: > On Sun, 16 Jan 2005, Matthew Kent wrote: > >> Verified that the postgres module compiles and works as expected on >> debian unstable. >> >> As mentioned, must be the libraries. > > Hi guys, > > I've been testing some more and I'm not really making any progress. So > a bit more about my platform and what I'm seeing. > > Currently I'm testing on a FC1 system. This has postgres version > 7.3.4. I've installed the regular rpms. So everything is/should be > installed correctly. I've ofcourse needed to change the compile rule. > This is what I'm using : > > gcc -g -O2 -o inserter.o inserter.c -shared -I /usr/include/nagios > -I/usr/include/pgsql -lpq That should be fine. Just to be sure what's actually getting used, would you run an ldd on inserter.o and see what the linker will add at runtime? > I've then started from a empty database. When I then start nagios I > get this error : > > WARNING: Error occurred while executing PL/pgSQL function > append_to_hostgroup line 9 at SQL statement If I'm reading it right, that means that this line is failing: select into thisHostID id FROM host WHERE name = thisHostName; That really shouldn't fail. Try turning on debug logging on your postgres server and see what it says about things. > Finaly I get a segfault at the PQclear function for the processStatus > call for the host data. > > I someone knows a good way to debug that would really help. > > I'll will try again on a RHEL3 system in de coming days since the > actual production server will be a RHEL3. Does it always crash at the same spot? I always hate it when people give this answer, but perhaps you are looking at the handiwork of a bad stick of ram? Anyway, you can try this for debugging: 1. load nagios in a debugger 2. put a breakpoint in nagios after it loads the neb modules (sorry, don't know where that is, but it shouldn't be hard to find) 3. run nagios 4. when you hit the breakpoint, put another breakpoint at the place in inserter.o where it consistently crashes. 5. continue again, and investigate what's going on at the crash point. It's possible that maybe the result which PQclear is trying to clear is null. I cannot recall at the moment if PQclear(0) will result in badness. |