From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by sourceware.org (Postfix) with ESMTPS id 44258385840B for ; Mon, 27 Sep 2021 20:43:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 44258385840B Received: by mail-ed1-x532.google.com with SMTP id dj4so74546257edb.5 for ; Mon, 27 Sep 2021 13:43:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=iaRDoh9fVIvXfAD6+oZuyW0yXrb6XeGtwMVrPSsoY6E=; b=qwiR2rPZKLqxE7dBnwGg0NCHozulPD1CHCk8Gcy/yiN7qWiJyf4DgV43L6mZXqvoYD O6SHWc5N2tLB3sx99tMHsDp3oH+/WzymqVYN2MNIYj+MvT+/2Gg4C650lZ28E6O9lfyi 4pDN1DkxRqGFnYg47qVtORX353Zo7ANGp1TCvGr+nv1jSI4hJm1cTHzyDgjnjsiw0WAY AEZ8HpGL0vYY3wN1GRQcNYxPdAF5nq8saMJuF7XVdkcH3bTloo9TjER53YCnU+NJnsxL inN7ExOGCeFQqd1UnylT3/ZwO2aokS/Ff7PM9JxPdHU2UAiwyBZkjZSjLxCw5rHpdJPK TeeA== X-Gm-Message-State: AOAM5319f/0PSZoUsPQqVOizNNVKf3blu+hpq64dCWP+eKuXRFRUqNe0 j/zGiuJVNjiz+cwLkem8b/bvBy4imu3iQ0G8ZDsh0M4S X-Google-Smtp-Source: ABdhPJwM6qhv/Qlq3uNN7fe2O7GscLMpe4rzCNMsGclJqr+oD3n5BJ+2LSttBTNlWdvjxyEPLCp+flYPIgwcFokAw/8= X-Received: by 2002:a17:906:169a:: with SMTP id s26mr2077856ejd.278.1632775407231; Mon, 27 Sep 2021 13:43:27 -0700 (PDT) MIME-Version: 1.0 References: <20210614234011.2215641-1-shorne@gmail.com> In-Reply-To: <20210614234011.2215641-1-shorne@gmail.com> From: Stafford Horne Date: Tue, 28 Sep 2021 05:43:16 +0900 Message-ID: Subject: Re: [PATCH] resolv: Fix tests by aligning hand crafted queries To: GLIBC patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , X-List-Received-Date: Mon, 27 Sep 2021 20:43:29 -0000 ping On Tue, Jun 15, 2021 at 8:40 AM Stafford Horne wrote: > > When testing OpenRISC I get a bus error in res_send. This is due to the > buf being cast to a (HEADER *) and trying the res_send code trying to read > different bits of the HEADER struct including 16-bit id etc. > > On OpenRISC reads of 16-bits and 32-bits from structures need to be 2 > byte and 4 byte aligned, respectively. > > To fix this we can align the hand crafted queries. > --- > resolv/tst-resolv-binary.c | 2 +- > resolv/tst-resolv-trustad.c | 3 ++- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/resolv/tst-resolv-binary.c b/resolv/tst-resolv-binary.c > index 44895a1baa..f76ae057c4 100644 > --- a/resolv/tst-resolv-binary.c > +++ b/resolv/tst-resolv-binary.c > @@ -52,7 +52,7 @@ do_test (void) > > for (int b = 0; b <= 255; ++b) > { > - unsigned char query[] = > + unsigned char query[] __attribute__ ((aligned)) = > { > b, b, /* Transaction ID. */ > 1, 0, /* Query with RD flag. */ > diff --git a/resolv/tst-resolv-trustad.c b/resolv/tst-resolv-trustad.c > index 74ee5db735..8d6989adb4 100644 > --- a/resolv/tst-resolv-trustad.c > +++ b/resolv/tst-resolv-trustad.c > @@ -93,7 +93,8 @@ do_test (void) > /* By default, the resolver is not trusted, and the AD bit is > cleared. */ > > - static const unsigned char hand_crafted_query[] = > + static const unsigned char hand_crafted_query[] > + __attribute__ ((aligned)) = > { > 10, 11, /* Transaction ID. */ > 1, 0x20, /* Query with RD, AD flags. */ > -- > 2.31.1 >