You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Tim Armstrong (JIRA)" <ji...@apache.org> on 2017/09/12 15:33:00 UTC

[jira] [Resolved] (IMPALA-5912) Impala gets SIGABRT while running expression tests

     [ https://issues.apache.org/jira/browse/IMPALA-5912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Armstrong resolved IMPALA-5912.
-----------------------------------
       Resolution: Fixed
    Fix Version/s: Impala 2.11.0

 

IMPALA-5912: fix crash in trunc(..., "WW") in release build

The bug is with the pattern below:

  const date& d = TruncMonth(orig_date).date();

The problem is that 'd' is a reference into the temporary returned from
TruncMonth. But the temporary is only guaranteed to live until the
expression has been evaluated. Thus if the compiler re-uses the register
or stack slot holding the temporary, 'd' may end up pointing to a bogus
value, causing a crash or incorrect results.

The fix is to simply create a local date value with the required date,
which avoids use of references to expression temporary and makes the
logic more obviously correct.

Also remove other uses of references to temporary that were correct but
unnecessary given that the function returned a value and C++11
return value optimisation should kick in.

Testing:
Ran expr-test to completion with a release build. Before this fix it
reliably crashed for me.

Change-Id: Ic5017518188f5025daa5040ca1943581a0675726
Reviewed-on: http://gerrit.cloudera.org:8080/8015
Reviewed-by: Thomas Tauber-Marshall <tm...@cloudera.com>
Reviewed-by: Dan Hecht <dh...@cloudera.com>
Tested-by: Impala Public Jenkins

> Impala gets SIGABRT while running expression tests
> --------------------------------------------------
>
>                 Key: IMPALA-5912
>                 URL: https://issues.apache.org/jira/browse/IMPALA-5912
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 2.11.0
>            Reporter: Tim Wood
>            Assignee: Tim Armstrong
>            Priority: Blocker
>             Fix For: Impala 2.11.0
>
>         Attachments: backtraces.txt
>
>
> Master build log:
> ...
> [ RUN      ] ExprTest.TimestampFunctions
> terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::gregorian::bad_year> >'
>   what():  Year is out of valid range: 1400..9999
> Wrote minidump to /data/jenkins/workspace/impala-umbrella-build-and-test/repos/Impala/logs/be_tests/minidumps/expr-test/a69b3367-2d13-4eb2-9b7106b1-91f5c055.dmp
> Wrote minidump to /data/jenkins/workspace/impala-umbrella-build-and-test/repos/Impala/logs/be_tests/minidumps/expr-test/a69b3367-2d13-4eb2-9b7106b1-91f5c055.dmp
> ...



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)