Hi!

I have this problem that if I call rrd_update(), rrd_create(), etc.
consecutively in a C program with parameters which need to be parsed using
getopt, then these functions break horribly. Here is a stack trace from such
a crash:

------------< snip <------< snip <------< snip <------------
.
.
.
   DEBUG: html.c:159:    www/lindsey.frogfoot.net/1/status.png
   NOISY: db.c:413: rrd_graph
   NOISY: db.c:414:    argv[ 0]: graph
   NOISY: db.c:414:    argv[ 1]: www/lindsey.frogfoot.net/1/status.png
   NOISY: db.c:414:    argv[ 2]: --imgformat
   NOISY: db.c:414:    argv[ 3]: PNG
   NOISY: db.c:414:    argv[ 4]: --end
   NOISY: db.c:414:    argv[ 5]: 1017782242
   NOISY: db.c:414:    argv[ 6]: --vertical-label
   NOISY: db.c:414:    argv[ 7]:
   NOISY: db.c:414:    argv[ 8]: --width
   NOISY: db.c:414:    argv[ 9]: 540
   NOISY: db.c:414:    argv[10]: --height
   NOISY: db.c:414:    argv[11]: 200
   NOISY: db.c:414:    argv[12]: --title
   NOISY: db.c:414:    argv[13]: Tue Apr  2 23:17:22 SAST 2002
   NOISY: db.c:414:    argv[14]: 
DEF:AdminStatus=db/lindsey.frogfoot.net/1.rrd:ifAdminStatus:LAST
   NOISY: db.c:414:    argv[15]: 
DEF:OperStatus=db/lindsey.frogfoot.net/1.rrd:ifOperStatus:LAST
   NOISY: db.c:414:    argv[16]: CDEF:AllStatus=AdminStatus,OperStatus,+
   NOISY: db.c:414:    argv[17]: CDEF:Unknown=AllStatus,UN,INF,UNKN,IF
   NOISY: db.c:414:    argv[18]: AREA:Unknown#ff0000:Unknown\n
   NOISY: db.c:414:    argv[19]: AREA:OperStatus#005b54:Operational status\n
   NOISY: db.c:414:    argv[20]: LINE3:AdminStatus#b100ff:Administrative 
status\n
   DEBUG: db.c:153: updating database db/anura.frogfoot.net/8.rrd: 
N:U:U:U:U:U:U:2:2
Segmentation fault (core dumped)
[EMAIL PROTECTED]:~/Development/c++/projects/snmp/src/managers/orca/src# gdb -c
core ./orca
GNU gdb 19990928
Copyright 1998 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 "i686-pc-linux-gnu"...(no debugging symbols
found)...
Core was generated by ./orca orca.conf'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/libber.so.0...done.
Reading symbols from /usr/local/lib/libdebug.so.0...done.
Reading symbols from /usr/local/lib/libconfig.so.0...done.
Reading symbols from /usr/lib/librrd.so.0...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /usr/lib/libpng.so.2...done.
Reading symbols from /usr/lib/libgd-gif.so.1...done.
Reading symbols from /lib/libm.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
Reading symbols from /usr/lib/libz.so.1...done.
Reading symbols from /lib/libnss_files.so.2...done.
Reading symbols from /lib/libnss_dns.so.2...done.
Reading symbols from /lib/libresolv.so.2...done.
#0  0x40101609 in confstr () from /lib/libc.so.6
(gdb) bt
#0  0x40101609 in confstr () from /lib/libc.so.6
#1  0x4010237c in getopt_long () from /lib/libc.so.6
#2  0x4002d2c4 in rrd_update () from /usr/lib/librrd.so.0
#3  0x804b9c7 in strcpy ()
#4  0x804ce09 in strcpy ()
#5  0x400606cf in __libc_start_main () from /lib/libc.so.6
(gdb)
------------< snip <------< snip <------< snip <------------

rrd_graph() in this case also manages to create a GIF with the filename "Tue
Apr  2 23:17:22 SAST 2002" (the title string).

I've reliably reproduced this with all the rrd_*() functions iff I use
parameters that needs getopt parsing (e.g. -b, --imgformat, etc.)

Details of rrdtool on my system:

------------< snip <------< snip <------< snip <------------
[EMAIL PROTECTED]:~/Development/c++/projects/snmp/src/managers/orca/src# dpkg -s
rrdtool
Package: rrdtool
Status: install ok installed
Priority: extra
Section: utils
Installed-Size: 1772
Maintainer: Matt Zimmerman <[EMAIL PROTECTED]>
Version: 1.0.33-9
Depends: libc6 (>= 2.2.4-4), libgd-gif1, libpng2 (>= 1.0.12), librrd0 (>=
1.0.10-1)
Suggests: librrds-perl
Description: Time-series data storage and display system (programs)
 RRD is the Acronym for Round Robin Database. RRD is a system to store and
 display time-series data (i.e. network bandwidth, machine-room temperature,
 server load average). It stores the data in a very compact way that will
 not expand over time, and it presents useful graphs by processing the data
 to enforce a certain data density. It can be used either via simple wrapper
 scripts (from shell or Perl) or via frontends that poll network devices and
 put friendly user interface on it.
 .
 This package contains command line programs used to access and manipulate
 RRDs.
------------< snip <------< snip <------< snip <------------
 
-- 

Regards
 Abraham

"And remember: Evil will always prevail, because Good is dumb."
-- Spaceballs

___________________________________________________
 Abraham vd Merwe [ZR1BBQ] - Frogfoot Networks
 P.O. Box 3472, Matieland, Stellenbosch, 7602
 Cell: +27 82 565 4451 Http: http://www.frogfoot.net
 Email: [EMAIL PROTECTED]


-- Binary/unsupported file stripped by Listar --
-- Err : No filename to use for decode, file stripped.
-- Type: application/pgp-signature


--
Unsubscribe mailto:[EMAIL PROTECTED]
Help        mailto:[EMAIL PROTECTED]
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

Reply via email to