Todd Lipcon has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/9289 )

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
Reviewed-on: http://gerrit.cloudera.org:8080/9289
Reviewed-by: Dan Burkert <d...@cloudera.com>
Tested-by: Todd Lipcon <t...@apache.org>
---
M src/kudu/util/logging.h
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Dan Burkert: Looks good to me, approved
  Todd Lipcon: Verified

--
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: merged
Gerrit-Change-Id: Ib2078b5f49dc3c751b4bb7db893506494c758289
Gerrit-Change-Number: 9289
Gerrit-PatchSet: 2
Gerrit-Owner: Todd Lipcon <t...@apache.org>
Gerrit-Reviewer: Dan Burkert <d...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>

Reply via email to