[ 
https://issues.apache.org/jira/browse/IMPALA-8264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16781947#comment-16781947
 ] 

ASF subversion and git services commented on IMPALA-8264:
---------------------------------------------------------

Commit 74dba7a52da6dc99d450e3a7d789ceac3197bdfb in impala's branch 
refs/heads/master from Lars Volker
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=74dba7a ]

IMPALA-8264: Fix overflow in SystemStateInfo::ComputeCpuRatios

We pass '0' as the initial value to std::accumulate(), which causes it
to use int32_t for its internal state, which then overflows when values
read from /proc/stat get too large. The fix is to initialize it with
'0L' to make it use int64_t.

Change-Id: I46dfb7264e85a3da492e383caaa6853d8ef95f35
Reviewed-on: http://gerrit.cloudera.org:8080/12638
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> system-state-info.cc:102] Check failed: total_tics > 0 (-4294962910 vs. 0)
> --------------------------------------------------------------------------
>
>                 Key: IMPALA-8264
>                 URL: https://issues.apache.org/jira/browse/IMPALA-8264
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 3.2.0
>            Reporter: Michael Ho
>            Assignee: Lars Volker
>            Priority: Critical
>
> When running 64-streams concurrent TPC-DS in debug builds at commit 
> 681b256627e5e569778d4996bbdf530e30c528eb in a 140 node cluster, hit the 
> following DCHECK after close to 14 hours of running.
> {noformat}
> F0228 00:42:35.132514 139036 system-state-info.cc:102] Check failed: 
> total_tics > 0 (-4294962910 vs. 0)
> {noformat}
> {noformat}
> void SystemStateInfo::ComputeCpuRatios() {
>   const CpuValues& cur = cpu_values_[cur_val_idx_];
>   const CpuValues& old = cpu_values_[1 - cur_val_idx_];
>   // Sum up all counters
>   int64_t cur_sum = accumulate(cur.begin(), cur.end(), 0);
>   int64_t old_sum = accumulate(old.begin(), old.end(), 0);
>   int64_t total_tics = cur_sum - old_sum;
>   // If less than 1/USER_HZ time has time has passed for any of the counters, 
> the ratio is
>   // zero (to avoid dividing by zero).
>   if (total_tics == 0) {
>     memset(&cpu_ratios_, 0, sizeof(cpu_ratios_));
>     return;
>   }
>   DCHECK_GT(total_tics, 0); <<----
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to