You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/03/12 00:30:01 UTC

[jira] [Commented] (IMPALA-8288) Setting EXEC_TIME_LIMIT_S to very high value triggers DCHECK in pretty printer

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

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

Commit 288abf10f6142ae6cb02329604805a9a1dcc804f in impala's branch refs/heads/master from Andrew Sherman
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=288abf1 ]

IMPALA-8288: avoid overflow causing DCHECK in PrettyPrint.

When PrettyPrinter prints a time measured in seconds, it multiplies the
time by 1000, and prints that value as milliseconds. Because
PrettyPrinter is implemented using templates, the type of the value
depends on the type of the value parameter. For typical values of
seconds the type is an int32_t. When this is multiplied by 1000 it can
therefore overflow, which triggers a DHECK failure in DEBUG builds.

Fix this by instead multiplying the value parameter by the existing
constant 'THOUSAND' which is declared as a int64_t. This produces a
result which is also a int64_t, and which does not overflow so easily.

TESTING:

Add more test cases to pretty-printer-test.cc including cases that
previously caused overflows. Expand the coverage to include cases
printing NanoSeocnds, MillisSeconds and MicroSeconds. These cases are
not supposed to show that PrettyPrinter always behaves consistently, but
to help maintainers avoid regressions when changing PrettyPrinter.

Ran all end-to-end tests.

Change-Id: I00d9769cf34e2ccd796ec1cf88797c8f8250f718
Reviewed-on: http://gerrit.cloudera.org:8080/12702
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> Setting EXEC_TIME_LIMIT_S to very high value triggers DCHECK in pretty printer
> ------------------------------------------------------------------------------
>
>                 Key: IMPALA-8288
>                 URL: https://issues.apache.org/jira/browse/IMPALA-8288
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 3.2.0
>            Reporter: Tim Armstrong
>            Assignee: Andrew Sherman
>            Priority: Critical
>              Labels: crash, newbie, ramp-up
>
> You can see from the below backtrace that the value was 2147483647, which overflows to -1000 when multiplied by 1000. In a RELEASE build this would just result in a negative number being printed.
> {noformat}
> (gdb) bt
> #0  0x00007fa99b79d428 in raise () from /lib/x86_64-linux-gnu/libc.so.6
> #1  0x00007fa99b79f02a in abort () from /lib/x86_64-linux-gnu/libc.so.6
> #2  0x00000000047fe424 in google::DumpStackTraceAndExit() ()
> #3  0x00000000047f4e7d in google::LogMessage::Fail() ()
> #4  0x00000000047f6722 in google::LogMessage::SendToLog() ()
> #5  0x00000000047f4857 in google::LogMessage::Flush() ()
> #6  0x00000000047f7e1e in google::LogMessageFatal::~LogMessageFatal() ()
> #7  0x0000000001f7cae8 in impala::PrettyPrinter::PrintTimeMs<int> (value=-1000, ss=0x7fa8f28563d0) at be/src/util/pretty-printer.h:271
> #8  0x0000000001f7aee1 in impala::PrettyPrinter::Print<int> (value=2147483647, unit=impala::TUnit::TIME_S, verbose=false) at be/src/util/pretty-printer.h:110
> #9  0x0000000002068bf7 in impala::ImpalaServer::SetQueryInflight (this=0xcf84000, session_state=..., request_state=...) at be/src/service/impala-server.cc:1108
> #10 0x00000000020f119c in impala::ImpalaServer::ExecuteStatement (this=0xcf84000, return_val=..., request=...) at be/src/service/impala-hs2-server.cc:477
> #11 0x0000000002600972 in apache::hive::service::cli::thrift::TCLIServiceProcessor::process_ExecuteStatement (this=0xd0dcbe0, seqid=0, iprot=0x15d10640, oprot=0x15d10440, callContext=0xb596cf80)
>     at be/generated-sources/gen-cpp/TCLIService.cpp:5115
> #12 0x00000000025ff070 in apache::hive::service::cli::thrift::TCLIServiceProcessor::dispatchCall (this=0xd0dcbe0, iprot=0x15d10640, oprot=0x15d10440, fname=..., seqid=0, callContext=0xb596cf80)
>     at be/generated-sources/gen-cpp/TCLIService.cpp:4926
> #13 0x00000000025c4b35 in impala::ImpalaHiveServer2ServiceProcessor::dispatchCall (this=0xd0dcbe0, iprot=0x15d10640, oprot=0x15d10440, fname=..., seqid=0, callContext=0xb596cf80)
>     at be/generated-sources/gen-cpp/ImpalaHiveServer2Service.cpp:505
> #14 0x0000000001a0d29c in apache::thrift::TDispatchProcessor::process (this=0xd0dcbe0, in=..., out=..., connectionContext=0xb596cf80)
>     at /opt/Impala-Toolchain/thrift-0.9.3-p5/include/thrift/TDispatchProcessor.h:121
> #15 0x0000000001e5ffb7 in apache::thrift::server::TAcceptQueueServer::Task::run (this=0x80546c40) at be/src/rpc/TAcceptQueueServer.cpp:
> {noformat}
> {noformat}
> F0306 09:40:56.856586 70607 pretty-printer.h:271] Check failed: value >= static_cast<T>(0) (-1000 vs. 0) 
> {noformat}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org