kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpe...@apache.org
Subject [1/3] kudu git commit: [util/stopwatch.h] fixed integer overflow
Date Sun, 14 Aug 2016 04:20:36 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 13dde92b0 -> bcc4bbf1c


[util/stopwatch.h] fixed integer overflow

Fixed integer overflow reported by ASAN on MacOS X.
The error reported by clang version 3.8.0 (branches/release_38 262722)
looked like the following:

  error: signed integer overflow: 1422286400 * 1000 cannot be
      represented in type 'int'

Change-Id: I47af59534869ea836613089f1f872a2b078d4347
Reviewed-on: http://gerrit.cloudera.org:8080/3960
Reviewed-by: Todd Lipcon <todd@apache.org>
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/587f33dd
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/587f33dd
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/587f33dd

Branch: refs/heads/master
Commit: 587f33ddffe4bd07d0702582015d2379f938d446
Parents: 13dde92
Author: Alexey Serbin <aserbin@cloudera.com>
Authored: Fri Aug 12 16:37:47 2016 -0700
Committer: Todd Lipcon <todd@apache.org>
Committed: Sat Aug 13 02:15:52 2016 +0000

----------------------------------------------------------------------
 src/kudu/util/stopwatch.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/587f33dd/src/kudu/util/stopwatch.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/stopwatch.h b/src/kudu/util/stopwatch.h
index d77a7a3..d539895 100644
--- a/src/kudu/util/stopwatch.h
+++ b/src/kudu/util/stopwatch.h
@@ -257,8 +257,8 @@ class Stopwatch {
     CHECK_EQ(0, clock_gettime(CLOCK_MONOTONIC, &wall));
 #endif  // defined(__APPLE__)
     times->wall   = wall.tv_sec * 1000000000L + wall.tv_nsec;
-    times->user   = usage.ru_utime.tv_sec * 1000000000L + usage.ru_utime.tv_usec * 1000;
-    times->system = usage.ru_stime.tv_sec * 1000000000L + usage.ru_stime.tv_usec * 1000;
+    times->user   = usage.ru_utime.tv_sec * 1000000000L + usage.ru_utime.tv_usec * 1000L;
+    times->system = usage.ru_stime.tv_sec * 1000000000L + usage.ru_stime.tv_usec * 1000L;
     times->context_switches = usage.ru_nvcsw + usage.ru_nivcsw;
   }
 


Mime
View raw message