Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1A7CF200BCC for ; Tue, 15 Nov 2016 03:00:32 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 190D3160B06; Tue, 15 Nov 2016 02:00:32 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6A4D0160B18 for ; Tue, 15 Nov 2016 03:00:31 +0100 (CET) Received: (qmail 46509 invoked by uid 500); 15 Nov 2016 02:00:30 -0000 Mailing-List: contact commits-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@impala.incubator.apache.org Delivered-To: mailing list commits@impala.incubator.apache.org Received: (qmail 46500 invoked by uid 99); 15 Nov 2016 02:00:30 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Nov 2016 02:00:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 38778C18B0 for ; Tue, 15 Nov 2016 02:00:30 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.218 X-Spam-Level: X-Spam-Status: No, score=-6.218 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id flQ2LYlBiSEi for ; Tue, 15 Nov 2016 02:00:28 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 54CA95FCA7 for ; Tue, 15 Nov 2016 02:00:27 +0000 (UTC) Received: (qmail 46337 invoked by uid 99); 15 Nov 2016 02:00:26 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Nov 2016 02:00:26 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A7386E1171; Tue, 15 Nov 2016 02:00:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jbapple@apache.org To: commits@impala.incubator.apache.org Date: Tue, 15 Nov 2016 02:00:28 -0000 Message-Id: In-Reply-To: <8cb512a9940c465ab94130f7a4da744c@git.apache.org> References: <8cb512a9940c465ab94130f7a4da744c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/4] incubator-impala git commit: IMPALA-4480: zero_length_region_ must be as aligned as max_align_t archived-at: Tue, 15 Nov 2016 02:00:32 -0000 IMPALA-4480: zero_length_region_ must be as aligned as max_align_t MemPool::TryAllocateAligned returns memory that might be that aligned, and it returns &MemPool::zero_length_region_ when called to allocate a block of size 0. While I'm here, do some things to make diagnosing test failures from terminal output easier. Change-Id: Ia31b27e38897f357478c4eedaab0c787e731b2d4 Reviewed-on: http://gerrit.cloudera.org:8080/5062 Reviewed-by: Dan Hecht Tested-by: Internal Jenkins Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/10a4c5a2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/10a4c5a2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/10a4c5a2 Branch: refs/heads/master Commit: 10a4c5a2e47ec7bf1e563b6a75d1bf2afb47ebd8 Parents: 4258b9f Author: Jim Apple Authored: Sun Nov 13 13:49:28 2016 -0800 Committer: Internal Jenkins Committed: Mon Nov 14 21:25:42 2016 +0000 ---------------------------------------------------------------------- be/src/runtime/mem-pool-test.cc | 5 +++-- be/src/runtime/mem-pool.h | 7 ++++--- bin/run-backend-tests.sh | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/10a4c5a2/be/src/runtime/mem-pool-test.cc ---------------------------------------------------------------------- diff --git a/be/src/runtime/mem-pool-test.cc b/be/src/runtime/mem-pool-test.cc index e6cb3b9..a39a120 100644 --- a/be/src/runtime/mem-pool-test.cc +++ b/be/src/runtime/mem-pool-test.cc @@ -504,8 +504,9 @@ TEST(MemPoolTest, TryAllocateAligned) { for (int i = 0; i < NUM_ALLOCATIONS; ++i) { uint8_t* ptr = pool.TryAllocateAligned(size, alignment); - ASSERT_TRUE(ptr != NULL); - ASSERT_EQ(0, reinterpret_cast(ptr) % alignment); + ASSERT_TRUE(ptr != NULL) << "size=" << size << " alignment=" << alignment; + ASSERT_EQ(0, reinterpret_cast(ptr) % alignment) + << "size=" << size << " alignment=" << alignment; alignment = alignment == alignof(std::max_align_t) ? 1 : alignment * 2; size = (size + 1) % MAX_ALLOCATION_SIZE; } http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/10a4c5a2/be/src/runtime/mem-pool.h ---------------------------------------------------------------------- diff --git a/be/src/runtime/mem-pool.h b/be/src/runtime/mem-pool.h index b0fa694..234fc41 100644 --- a/be/src/runtime/mem-pool.h +++ b/be/src/runtime/mem-pool.h @@ -187,9 +187,10 @@ class MemPool { allocated_bytes(0) {} }; - /// A static field used as non-NULL pointer for zero length allocations. - /// NULL is reserved for allocation failures. - static uint32_t zero_length_region_; + /// A static field used as non-NULL pointer for zero length allocations. NULL is + /// reserved for allocation failures. It must be as aligned as max_align_t for + /// TryAllocateAligned(). + static uint32_t zero_length_region_ alignas(std::max_align_t); /// chunk from which we served the last Allocate() call; /// always points to the last chunk that contains allocated data; http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/10a4c5a2/bin/run-backend-tests.sh ---------------------------------------------------------------------- diff --git a/bin/run-backend-tests.sh b/bin/run-backend-tests.sh index d12950b..758c1bc 100755 --- a/bin/run-backend-tests.sh +++ b/bin/run-backend-tests.sh @@ -35,4 +35,5 @@ fi cd ${IMPALA_BE_DIR} . ${IMPALA_HOME}/bin/set-classpath.sh +export CTEST_OUTPUT_ON_FAILURE=1 make test ARGS="${BE_TEST_ARGS}"