[rrd-developers] Re: rrdtool libraries segfault with getopt

Peter Stamfest peter at stamfest.at
Fri Apr 4 06:42:47 MEST 2003


On Thu, 3 Apr 2003, Markus Baertschi wrote:

> Date: Thu, 03 Apr 2003 22:31:49 +0200
> From: Markus Baertschi <markus at markus.org>
> To: "rrd-developers at list.ee.ethz.ch" <rrd-developers at list.ee.ethz.ch>
> Subject: [rrd-developers] rrdtool libraries segfault with getopt
> 
> 
> I'm developping an app in C which is calling rrd_update and rrd_create
> directly (linking with librrd). So far things are working, but there
> is a problem if I mix calls to rrd_create and rrd_update. The rrd_update
> call generates a segfault and my app is dead :-(.
> 

[ snip ] 

> 
> Any ideas ?

This is one of the things the thread-safety stuff tries to solve as well. 
Thus you might want to use the 1.1 development tree. There the trick is 
to use rrd_create_r and rrd_update_r. These functions bypass getopt. You 
only have to call rrd_clear_error before you call any of the *_r 
functions. I _think_ you do not even need the entire thread-safety stuff 
(ie. linking with librrd_th and libpthread) and it should work with librrd 
as well.


peter

--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-developers mailing list