From patchwork Tue Jul 21 21:39:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 498346 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 578A91402D4 for ; Wed, 22 Jul 2015 07:39:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=iecbjsox; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:to:subject:from:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=F1Y XS+Us1D+EjpdbUiJm9OPaAlapCRM2tbcA3cNuyo54t2Acjr0QMoL3MDSW0Ki7Yln weP0K7ZUJQPBO8EFl7hR1qDcKxvpEmChcuCo4NJVcpTUTgDgtDtqPixlGBdWQVlU cqwXr2k/bfWva4gnirsJJdz1O8fmFH3ki5CLHrrg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:to:subject:from:mime-version :content-type:content-transfer-encoding; s=default; bh=s29CNEPUt S5j1J2kmgN8TN/Z9+Q=; b=iecbjsoxsAaadb37j9MpfntX066PGlnAkPdjG0vIs H7/iDRV6Ttq4BfeCkgoFOCeXaeMOsCq2/NLMEaDaF80wdf/ozLa7UcWtxFVM4PNo GZY+Ym+k/aNiWE0ACM2GhrTmEs2vNu6PiKWyRZtv5SA4bdeDXH2W0eMSVevxlebg Yc= Received: (qmail 78245 invoked by alias); 21 Jul 2015 21:39:09 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 78236 invoked by uid 89); 21 Jul 2015 21:39:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: shards.monkeyblade.net Date: Tue, 21 Jul 2015 14:39:04 -0700 (PDT) Message-Id: <20150721.143904.2006742147973414532.davem@davemloft.net> To: libc-alpha@sourceware.org Subject: [PATCH] Fix test-wcsncmp BUS errors. From: David Miller Mime-Version: 1.0 As currently coded, the strncmp tests dereference unaligned pointers when setting up the test patterns. This results in SIGBUS errors on Sparc, for example. Force the alignment arguments to be aligned properly for the character type being tested. Ok to commit? 2015-07-21 David S. Miller * string/test-strncmp.c (do_test_limit): Align align1 and align2 to CHARBYTES. (do_test): Likewise. diff --git a/string/test-strncmp.c b/string/test-strncmp.c index fb57a9b..277eb2c 100644 --- a/string/test-strncmp.c +++ b/string/test-strncmp.c @@ -156,6 +156,9 @@ do_test_limit (size_t align1, size_t align2, size_t len, size_t n, int max_char, size_t i, align_n; CHAR *s1, *s2; + align1 &= ~(CHARBYTES - 1); + align2 &= ~(CHARBYTES - 1); + if (n == 0) { s1 = (CHAR *) (buf1 + page_size); @@ -204,6 +207,9 @@ do_test (size_t align1, size_t align2, size_t len, size_t n, int max_char, size_t i; CHAR *s1, *s2; + align1 &= ~(CHARBYTES - 1); + align2 &= ~(CHARBYTES - 1); + if (n == 0) return;