Files
impala/testdata/workloads/functional-query/queries/QueryTest
Zoltan Borok-Nagy a0e6b6b618 IMPALA-11105: Impala crashes in PhjBuilder::Close() when Prepare() fails
In PhjBuilder::Close() we invoke
'ht_ctx_->StatsCountersAdd(ht_stats_profile_.get())' when 'ht_ctx_' is
not null. But in Prepare we create 'ht_ctx_' first, then after a couple
operations which might fail we create 'ht_stats_profile_'. This means if
an operation fails in Prepare(), between the creation of 'ht_ctx_' and
'ht_stast_profile_', then later we'll get a SEGFAULT in Close().

This patch restructures the code in PhjBuilder::Prepare(), so at first
it creates the counters and profile, then it creates 'ht_ctx_',
similarly to what we do in grouping-aggregator.cc. It also modifies
HashTableCtx::StatsCountersAdd(), so in release mode it is a no-op
if 'profile' is null.

Testing:
 * added a debug action that fails PhjBuilder::Prepare() after the
   creation of 'ht_ctx_'

Change-Id: Id41b0c45d9693cb3433e02737048cb9f50ba59c1
Reviewed-on: http://gerrit.cloudera.org:8080/18195
Reviewed-by: Joe McDonnell <joemcdonnell@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
2022-02-04 17:55:47 +00:00
..
2021-07-06 18:35:30 +00:00
2021-02-15 22:25:41 +00:00