Hello Dan Burkert,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/9289

to review the following change.


Change subject: logging: fix UBSAN unsigned int overflow in LogThrottler
......................................................................

logging: fix UBSAN unsigned int overflow in LogThrottler

Fixes the following UBSAN error:

  src/kudu/util/logging.h:333:12: runtime error: unsigned integer
  overflow: 563980051 - 563991872 cannot be represented in type 'unsigned
  long'

This was happening because we used an unsigned int64 when subtracing
timestamps, and because this function is intentionally racy, it was
possible to underflow and end up negative.

No real functional issue fixed here since the worst that would happen
was an extra (non-throttled) log message when the race triggered.

Change-Id: Ib2078b5f49dc3c751b4bb7db893506494c758289
---
M src/kudu/util/logging.h
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/89/9289/1
--
To view, visit http://gerrit.cloudera.org:8080/9289
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2078b5f49dc3c751b4bb7db893506494c758289
Gerrit-Change-Number: 9289
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <t...@apache.org>
Gerrit-Reviewer: Dan Burkert <d...@cloudera.com>

Reply via email to