From bf7f8abed26b9927cca70db4648a0ffa85800716 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sat, 20 Sep 2008 21:12:39 +0200 Subject: [PATCH] Added bts498183-segfault-madvise. This fixes a segfault on sparc caused by a wrong argument passed to madvise(2). Thanks to Jurij Smakov for valuable debugging information. Closes: #498183 --- debian/changelog | 5 ++++- debian/patches/bts498183-segfault-madvise | 27 +++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 debian/patches/bts498183-segfault-madvise diff --git a/debian/changelog b/debian/changelog index 8ad64ff..c808f3f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,11 @@ rrdtool (1.3.1-4) unstable; urgency=low * debian/patches: - Added upstream patch bts499350-data-corruption to fix data corruption when updating multiple values in one go (Closes: #499350). + - Added bts498183-segfault-madvise to fix a segfault on sparc caused by a + wrong argument passed to madvise(2) - thanks to Jurij Smakov for + valuable debugging information (Closes: #498183). - -- Sebastian Harl Sat, 20 Sep 2008 20:41:28 +0200 + -- Sebastian Harl Sat, 20 Sep 2008 21:03:05 +0200 rrdtool (1.3.1-3) unstable; urgency=low diff --git a/debian/patches/bts498183-segfault-madvise b/debian/patches/bts498183-segfault-madvise new file mode 100644 index 0000000..8d381ef --- /dev/null +++ b/debian/patches/bts498183-segfault-madvise @@ -0,0 +1,27 @@ +diff a/src/rrd_open.c b/src/rrd_open.c +--- a/src/rrd_open.c ++++ b/src/rrd_open.c +@@ -363,14 +363,19 @@ void rrd_dontneed( + rrd->rra_def[i].row_cnt * rrd->stat_head->ds_cnt * + sizeof(rrd_value_t); + } ++ ++ if (dontneed_start < rrd_file->file_len) { + #ifdef USE_MADVISE +- madvise(rrd_file->file_start + dontneed_start, +- rrd_file->file_len - dontneed_start, MADV_DONTNEED); ++ madvise(rrd_file->file_start + dontneed_start, ++ rrd_file->file_len - dontneed_start, MADV_DONTNEED); + #endif + #ifdef HAVE_POSIX_FADVISE +- posix_fadvise(rrd_file->fd, dontneed_start, +- rrd_file->file_len - dontneed_start, POSIX_FADV_DONTNEED); ++ posix_fadvise(rrd_file->fd, dontneed_start, ++ rrd_file->file_len - dontneed_start, ++ POSIX_FADV_DONTNEED); + #endif ++ } ++ + #if defined DEBUG && DEBUG > 1 + mincore_print(rrd_file, "after"); + #endif diff --git a/debian/patches/series b/debian/patches/series index a900298..385c5ed 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,3 +5,4 @@ no-rpath-for-ruby no-rpath-for-perl implicit-decl-fix bts499350-data-corruption +bts498183-segfault-madvise -- 2.30.2