summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7831eea)
raw | patch | inline | side by side (parent: 7831eea)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 20 Sep 2008 19:12:39 +0000 (21:12 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 20 Sep 2008 19:12:39 +0000 (21:12 +0200) |
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
madvise(2). Thanks to Jurij Smakov for valuable debugging information.
Closes: #498183
debian/changelog | patch | blob | history | |
debian/patches/bts498183-segfault-madvise | [new file with mode: 0644] | patch | blob |
debian/patches/series | patch | blob | history |
diff --git a/debian/changelog b/debian/changelog
index 8ad64ff90597e713ca995a5d3e547615f9c3e8d4..c808f3ff50bcc02224e88e54ca539c8cb1b4be1a 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
* 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 <sh@tokkee.org> Sat, 20 Sep 2008 20:41:28 +0200
+ -- Sebastian Harl <sh@tokkee.org> 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
--- /dev/null
@@ -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 a900298d1986ff063b94b9c8cf0facde178da40d..385c5ed2145eabf012412d5c1fc29f114d092440 100644 (file)
--- a/debian/patches/series
+++ b/debian/patches/series
no-rpath-for-perl
implicit-decl-fix
bts499350-data-corruption
+bts498183-segfault-madvise