This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.17-286-g7da6d9e
- From: siddhesh at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 26 Feb 2013 08:55:57 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.17-286-g7da6d9e
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 7da6d9ed266105e0ebefd01a4b6bf08bf56257c3 (commit)
from b7688c42e7cca0c24889f3a8f9b685783661fb24 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7da6d9ed266105e0ebefd01a4b6bf08bf56257c3
commit 7da6d9ed266105e0ebefd01a4b6bf08bf56257c3
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Tue Feb 26 14:24:40 2013 +0530
Fix FPE in memusagestat when malloc utilization is zero
[BZ #15160]
Draw graphs for heap and stack only if MAXSIZE_HEAP and MAXSIZE_STACK
are non-zero.
diff --git a/ChangeLog b/ChangeLog
index cbf4083..ab829a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-02-26 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ [BZ #15160]
+ * malloc/memusagestat.c (main): Draw graphs for heap and stack
+ only if MAXSIZE_HEAP and MAXSIZE_STACK are non-zero.
+
2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
* posix/regex_internal.h [__GNUC__ < 3 + (__GNUC_MINOR__ < 1]:
diff --git a/NEWS b/NEWS
index 783f957..a4c5638 100644
--- a/NEWS
+++ b/NEWS
@@ -11,7 +11,7 @@ Version 2.18
11561, 13951, 14142, 14200, 14317, 14327, 14496, 14920, 14964, 14981,
14982, 14985, 14994, 14996, 15003, 15006, 15020, 15023, 15036, 15054,
- 15062, 15078.
+ 15062, 15078, 15160.
* Add support for calling C++11 thread_local object destructors on thread
and program exit. This needs compiler support for offloading C++11
diff --git a/malloc/memusagestat.c b/malloc/memusagestat.c
index f561e0d..7bbd009 100644
--- a/malloc/memusagestat.c
+++ b/malloc/memusagestat.c
@@ -319,17 +319,26 @@ main (int argc, char *argv[])
for (line = 1; line <= 3; ++line)
{
- cnt = ((ysize - 40) * (maxsize_heap / 4 * line / heap_scale)) /
- (maxsize_heap / heap_scale);
- gdImageDashedLine (im_out, 40, ysize - 20 - cnt, xsize - 40,
- ysize - 20 - cnt, red);
- snprintf (buf, sizeof (buf), heap_format, maxsize_heap / 4 * line /
- heap_scale);
- gdImageString (im_out, gdFontSmall, 39 - strlen (buf) * 6,
- ysize - 26 - cnt, (unsigned char *) buf, red);
-
- cnt2 = ((ysize - 40) * (maxsize_stack / 4 * line / stack_scale)) /
- (maxsize_stack / stack_scale);
+ if (maxsize_heap > 0)
+ {
+ cnt = (((ysize - 40) * (maxsize_heap / 4 * line / heap_scale))
+ / (maxsize_heap / heap_scale));
+ gdImageDashedLine (im_out, 40, ysize - 20 - cnt, xsize - 40,
+ ysize - 20 - cnt, red);
+ snprintf (buf, sizeof (buf), heap_format,
+ maxsize_heap / 4 * line / heap_scale);
+ gdImageString (im_out, gdFontSmall, 39 - strlen (buf) * 6,
+ ysize - 26 - cnt, (unsigned char *) buf, red);
+ }
+ else
+ cnt = 0;
+
+ if (maxsize_stack > 0)
+ cnt2 = (((ysize - 40) * (maxsize_stack / 4 * line / stack_scale))
+ / (maxsize_stack / stack_scale));
+ else
+ cnt2 = 0;
+
if (cnt != cnt2)
gdImageDashedLine (im_out, 40, ysize - 20 - cnt2, xsize - 40,
ysize - 20 - cnt2, green);
@@ -372,7 +381,7 @@ main (int argc, char *argv[])
ysize - 14, yellow);
previously = now;
- if (also_total)
+ if (also_total && maxsize_heap > 0)
{
size_t new3;
@@ -386,21 +395,27 @@ main (int argc, char *argv[])
last_total = new3;
}
- // assert (entry.heap <= maxsize_heap);
- new[0] = (ysize - 20) - ((((unsigned long long int) (ysize - 40))
- * entry.heap) / maxsize_heap);
- gdImageLine (im_out, 40 + ((xsize - 80) * (cnt - 1)) / total,
- last_heap, 40 + ((xsize - 80) * cnt) / total, new[0],
- red);
- last_heap = new[0];
-
- // assert (entry.stack <= maxsize_stack);
- new[1] = (ysize - 20) - ((((unsigned long long int) (ysize - 40))
- * entry.stack) / maxsize_stack);
- gdImageLine (im_out, 40 + ((xsize - 80) * (cnt - 1)) / total,
- last_stack, 40 + ((xsize - 80) * cnt) / total, new[1],
- green);
- last_stack = new[1];
+ if (maxsize_heap > 0)
+ {
+ new[0] = ((ysize - 20)
+ - ((((unsigned long long int) (ysize - 40))
+ * entry.heap) / maxsize_heap));
+ gdImageLine (im_out, 40 + ((xsize - 80) * (cnt - 1)) / total,
+ last_heap, 40 + ((xsize - 80) * cnt) / total,
+ new[0], red);
+ last_heap = new[0];
+ }
+
+ if (maxsize_stack > 0)
+ {
+ new[1] = ((ysize - 20)
+ - ((((unsigned long long int) (ysize - 40))
+ * entry.stack) / maxsize_stack));
+ gdImageLine (im_out, 40 + ((xsize - 80) * (cnt - 1)) / total,
+ last_stack, 40 + ((xsize - 80) * cnt) / total,
+ new[1], green);
+ last_stack = new[1];
+ }
}
cnt = 0;
@@ -448,7 +463,7 @@ main (int argc, char *argv[])
next_tick += MAX (1, total / 20);
}
- if (also_total)
+ if (also_total && maxsize_heap > 0)
{
size_t new3;
@@ -459,16 +474,24 @@ main (int argc, char *argv[])
last_total = new3;
}
- new[0] = (ysize - 20) - ((((unsigned long long int) (ysize - 40))
- * entry.heap) / maxsize_heap);
- gdImageLine (im_out, last_xpos, last_heap, xpos, new[0], red);
- last_heap = new[0];
+ if (maxsize_heap > 0)
+ {
+ new[0] = ((ysize - 20)
+ - ((((unsigned long long int) (ysize - 40))
+ * entry.heap) / maxsize_heap));
+ gdImageLine (im_out, last_xpos, last_heap, xpos, new[0], red);
+ last_heap = new[0];
+ }
- // assert (entry.stack <= maxsize_stack);
- new[1] = (ysize - 20) - ((((unsigned long long int) (ysize - 40))
- * entry.stack) / maxsize_stack);
- gdImageLine (im_out, last_xpos, last_stack, xpos, new[1], green);
- last_stack = new[1];
+ if (maxsize_stack > 0)
+ {
+ new[1] = ((ysize - 20)
+ - ((((unsigned long long int) (ysize - 40))
+ * entry.stack) / maxsize_stack));
+ gdImageLine (im_out, last_xpos, last_stack, xpos, new[1],
+ green);
+ last_stack = new[1];
+ }
last_xpos = xpos;
}
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 +++
NEWS | 2 +-
malloc/memusagestat.c | 97 ++++++++++++++++++++++++++++++-------------------
3 files changed, 67 insertions(+), 38 deletions(-)
hooks/post-receive
--
GNU C Library master sources