OBS User unknown 2007-01-05 15:51:12 +00:00 committed by Git OBS Bridge
parent 0c27a2a4a3
commit 511f90fa57
4 changed files with 148 additions and 25 deletions

121
rrdtool-1.2.15-DoS.diff Normal file
View File

@ -0,0 +1,121 @@
--- src/rrd_graph.c (revision 874)
+++ src/rrd_graph.c (revision 881)
@@ -1713,4 +1713,33 @@
}
+static int AlmostEqual2sComplement (float A, float B, int maxUlps)
+{
+
+ int aInt = *(int*)&A;
+ int bInt = *(int*)&B;
+ int intDiff;
+ /* Make sure maxUlps is non-negative and small enough that the
+ default NAN won't compare as equal to anything. */
+
+ /* assert(maxUlps > 0 && maxUlps < 4 * 1024 * 1024); */
+
+ /* Make aInt lexicographically ordered as a twos-complement int */
+
+ if (aInt < 0)
+ aInt = 0x80000000l - aInt;
+
+ /* Make bInt lexicographically ordered as a twos-complement int */
+
+ if (bInt < 0)
+ bInt = 0x80000000l - bInt;
+
+ intDiff = abs(aInt - bInt);
+
+ if (intDiff <= maxUlps)
+ return 1;
+
+ return 0;
+}
+
/* logaritmic horizontal grid */
int
@@ -1722,5 +1751,6 @@
{1.0, 2.0, 5.0, 7.0, 10., 0.0, 0.0, 0.0, 0.0, 0.0},
{1.0, 2.0, 4.0, 6.0, 8.0, 10., 0.0, 0.0, 0.0, 0.0},
- {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.}};
+ {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.},
+ {0,0,0,0,0, 0,0,0,0,0} /* last line */ };
int i, j, val_exp, min_exp;
@@ -1731,5 +1761,5 @@
double mspac; /* smallest major grid spacing (pixels) */
int flab; /* first value in yloglab to use */
- double value, tmp;
+ double value, tmp, pre_value;
double X0,X1,Y0;
char graph_label[100];
@@ -1750,9 +1780,9 @@
for(i = 0; yloglab[mid][i + 1] < 10.0; i++);
mspac = logscale * log10(10.0 / yloglab[mid][i]);
- } while(mspac > 2 * im->text_prop[TEXT_PROP_LEGEND].size && mid < 5);
+ } while(mspac > 2 * im->text_prop[TEXT_PROP_LEGEND].size && yloglab[mid][0] > 0);
if(mid) mid--;
/* find first value in yloglab */
- for(flab = 0; frexp10(im->minval, &tmp) > yloglab[mid][flab]; flab++);
+ for(flab = 0; yloglab[mid][flab] < 10 && frexp10(im->minval, &tmp) > yloglab[mid][flab] ; flab++);
if(yloglab[mid][flab] == 10.0) {
tmp += 1.0;
@@ -1766,6 +1796,11 @@
/* draw grid */
- while(1) {
+ pre_value = DNAN;
+ while(1) {
+
value = yloglab[mid][flab] * pow(10.0, val_exp);
+ if ( AlmostEqual2sComplement(value,pre_value,4) ) break; /* it seems we are not converging */
+
+ pre_value = value;
Y0 = ytr(im, value);
@@ -2487,32 +2522,4 @@
but it seems more stable this way. */
-static int AlmostEqual2sComplement (float A, float B, int maxUlps)
-{
-
- int aInt = *(int*)&A;
- int bInt = *(int*)&B;
- int intDiff;
- /* Make sure maxUlps is non-negative and small enough that the
- default NAN won't compare as equal to anything. */
-
- /* assert(maxUlps > 0 && maxUlps < 4 * 1024 * 1024); */
-
- /* Make aInt lexicographically ordered as a twos-complement int */
-
- if (aInt < 0)
- aInt = 0x80000000l - aInt;
-
- /* Make bInt lexicographically ordered as a twos-complement int */
-
- if (bInt < 0)
- bInt = 0x80000000l - bInt;
-
- intDiff = abs(aInt - bInt);
-
- if (intDiff <= maxUlps)
- return 1;
-
- return 0;
-}
/* draw that picture thing ... */
--- src/rrd_graph.c
+++ src/rrd_graph.c
@@ -1063,6 +1063,7 @@
*/
if (finite(paintval) && im->gdes[ii].gf != GF_TICK ) {
- if (isnan(minval) || paintval < minval)
- minval = paintval;
+ if ((isnan(minval) || paintval < minval ) &&
+ ! (im->logarithmic && paintval <= 0.0))
+ minval = paintval;
if (isnan(maxval) || paintval > maxval)
maxval = paintval;

View File

@ -1,12 +0,0 @@
--- src/rrd_graph.c
+++ src/rrd_graph.c
@@ -1063,6 +1063,7 @@
*/
if (finite(paintval) && im->gdes[ii].gf != GF_TICK ) {
- if (isnan(minval) || paintval < minval)
- minval = paintval;
+ if ((isnan(minval) || paintval < minval ) &&
+ ! (im->logarithmic && paintval <= 0.0))
+ minval = paintval;
if (isnan(maxval) || paintval > maxval)
maxval = paintval;

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Jan 5 14:50:05 CET 2007 - anicka@suse.cz
- fix librrd_th.la
- remove packaged fonts and use system fonts instead
- fix last patch
-------------------------------------------------------------------
Tue Jan 2 15:17:22 CET 2007 - anicka@suse.cz

View File

@ -17,12 +17,12 @@ Group: Productivity/Scientific/Math
Autoreqprov: on
Requires: perl = %{perl_version}
Version: 1.2.15
Release: 33
Release: 35
Source: %{name}-%{version}.tar.bz2
Source1: cgilib-0.5.tar.bz2
Patch: %{name}-%{version}-stderr.diff
Patch1: %{name}-%{version}-ssize.diff
Patch2: %{name}-%{version}-changeset_r887.diff
Patch2: %{name}-%{version}-DoS.diff
URL: http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: A tool for data logging and analysis
@ -64,16 +64,17 @@ aclocal --force
autoconf -f
automake -fca
CFLAGS="$RPM_OPT_FLAGS -fPIC" CXXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="-L`pwd`/lb/lib" CPPFLAGS="-I`pwd`/lb/include" \
./configure \
--mandir=%{_mandir} \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--datadir=%{_datadir} \
--infodir=%{_infodir} \
--sysconfdir=%{_sysconfdir} \
--enable-shared \
./configure \
--mandir=%{_mandir} \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--datadir=%{_datadir} \
--infodir=%{_infodir} \
--sysconfdir=%{_sysconfdir} \
--enable-shared \
--with-tcllib=%{_libdir} \
--with-gnu-ld
--with-gnu-ld \
--with-rrd-default-font=/usr/share/fonts/truetype/DejaVuSansMono.ttf
make
%install
@ -90,6 +91,8 @@ make \
install
# we install this later again
rm -r $RPM_BUILD_ROOT%{_prefix}/lib/perl
# do not install fonts (use system fonts instead)
rm -rf $RPM_BUILD_ROOT%_datadir/rrdtool/fonts
# install correctly perl modules
pushd bindings/perl-piped
perl Makefile.PL
@ -101,9 +104,9 @@ make DESTDIR=$RPM_BUILD_ROOT install_vendor
popd
%perl_process_packlist
#fix build (it would be better to split cgilib)
sed 's/[[:space:]]*-L\/usr\/src\/packages\/BUILD\/%{name}-%{version}\/lb\/lib[[:space:]]*//' $RPM_BUILD_ROOT/%{_libdir}/librrd.la > tmp
sed 's/[[:space:]]*-L\/usr\/src\/packages\/BUILD\/%{name}-%{version}\/lb\/lib[[:space:]]*/ /' $RPM_BUILD_ROOT/%{_libdir}/librrd.la > tmp
mv tmp $RPM_BUILD_ROOT/%{_libdir}/librrd.la
sed 's/[[:space:]]*-L\/usr\/src\/packages\/BUILD\/%{name}-%{version}\/lb\/lib[[:space:]]*//' $RPM_BUILD_ROOT/%{_libdir}/librrd_th.la > tmp
sed 's/[[:space:]]*-L\/usr\/src\/packages\/BUILD\/%{name}-%{version}\/lb\/lib[[:space:]]*/ /' $RPM_BUILD_ROOT/%{_libdir}/librrd_th.la > tmp
mv tmp $RPM_BUILD_ROOT/%{_libdir}/librrd_th.la
# documentation
@ -135,6 +138,10 @@ rm -rf $RPM_BUILD_ROOT
%{py_sitedir}/rrdtoolmodule.so
%changelog -n rrdtool
* Fri Jan 05 2007 - anicka@suse.cz
- fix librrd_th.la
- remove packaged fonts and use system fonts instead
- fix last patch
* Tue Jan 02 2007 - anicka@suse.cz
- fix memory allocation bug when graphing logarithmic data
with upstream patch [#231212]