From patchwork Wed May 13 14:46:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 39233 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 99F1F3851C2A; Wed, 13 May 2020 14:46:20 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 2483E3851C0B for ; Wed, 13 May 2020 14:46:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2483E3851C0B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fw@deneb.enyo.de Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1jYseG-0002dd-5z; Wed, 13 May 2020 14:46:16 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1jYseG-0003VK-3M; Wed, 13 May 2020 16:46:16 +0200 From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH] arm: XFAIL string/tst-memmove-overflow due to bug 25620 Date: Wed, 13 May 2020 16:46:16 +0200 Message-ID: <87imgz6gg7.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andreas Schwab Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Also reduce the amount of output in case of a large-scale mismatch in the copied data. Reviewed-by: Carlos O'Donell --- string/tst-memmove-overflow.c | 23 +++++++++++++++++++++-- sysdeps/arm/Makefile | 5 +++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/string/tst-memmove-overflow.c b/string/tst-memmove-overflow.c index b744679ef4..77d693d0dd 100644 --- a/string/tst-memmove-overflow.c +++ b/string/tst-memmove-overflow.c @@ -57,6 +57,25 @@ expected_value (size_t index) return randomized >> 25; /* Result is in the range [0, 127]. */ } +/* Used to count mismatches up to a limit, to avoid creating a huge + test output file. */ +static unsigned int mismatch_count; + +/* Check ACTUAL == EXPECTED. Use INDEX for error reporting. Exit the + process after too many errors. */ +static inline void +check_one_index (size_t index, unsigned char actual, unsigned char expected) +{ + if (actual != expected) + { + printf ("error: mismatch at index %zu: expected 0x%02x, got 0x%02x\n", + index, actual, expected); + ++mismatch_count; + if (mismatch_count > 200) + FAIL_EXIT1 ("bailing out due to too many errors"); + } +} + static int test_main (void) { @@ -138,13 +157,13 @@ test_main (void) start + allocation_size - sizeof (expected_end) - 1, sizeof (expected_end)); for (size_t i = 0; i < unshared_size - 1; ++i) - TEST_COMPARE (start[i], expected_value (i + 1)); + check_one_index (i, start[i], expected_value (i + 1)); /* The gap between the checked start and end area of the mapping has shared mappings at unspecified boundaries, so do not check the expected values in the middle. */ for (size_t i = allocation_size - unshared_size; i < allocation_size - 1; ++i) - TEST_COMPARE (start[i], expected_value (i + 1)); + check_one_index (i, start[i], expected_value (i + 1)); support_blob_repeat_free (&repeat); } diff --git a/sysdeps/arm/Makefile b/sysdeps/arm/Makefile index ad2042b93a..a0cb7f3c32 100644 --- a/sysdeps/arm/Makefile +++ b/sysdeps/arm/Makefile @@ -68,3 +68,8 @@ ifeq ($(subdir),nptl) libpthread-sysdep_routines += pt-arm-unwind-resume libpthread-shared-only-routines += pt-arm-unwind-resume endif + +ifeq ($(subdir),string) +# This test fails on arm due to bug 25620 and related issues. +test-xfail-tst-memmove-overflow = yes +endif