GNU logs - #25024, boring messages


Message sent to bug-coreutils@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#25024: Bug in Sort
Resent-From: Marcel =?UTF-8?Q?B=C3=B6hme?= <boehme.marcel@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-coreutils@HIDDEN
Resent-Date: Fri, 25 Nov 2016 06:19:02 +0000
Resent-Message-ID: <handler.25024.B.148005470014192 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 25024
X-GNU-PR-Package: coreutils
X-GNU-PR-Keywords: 
To: 25024 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-coreutils@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.148005470014192
          (code B ref -1); Fri, 25 Nov 2016 06:19:02 +0000
Received: (at submit) by debbugs.gnu.org; 25 Nov 2016 06:18:20 +0000
Received: from localhost ([127.0.0.1]:40922 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cA9q0-0003gp-4k
	for submit <at> debbugs.gnu.org; Fri, 25 Nov 2016 01:18:20 -0500
Received: from eggs.gnu.org ([208.118.235.92]:50568)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <boehme.marcel@HIDDEN>) id 1cA9py-0003ga-Cf
 for submit <at> debbugs.gnu.org; Fri, 25 Nov 2016 01:18:18 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <boehme.marcel@HIDDEN>) id 1cA9ps-0006yh-8n
 for submit <at> debbugs.gnu.org; Fri, 25 Nov 2016 01:18:13 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:48351)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <boehme.marcel@HIDDEN>)
 id 1cA9ps-0006yY-5W
 for submit <at> debbugs.gnu.org; Fri, 25 Nov 2016 01:18:12 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41536)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <boehme.marcel@HIDDEN>) id 1cA9pr-0007yy-4k
 for bug-coreutils@HIDDEN; Fri, 25 Nov 2016 01:18:11 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <boehme.marcel@HIDDEN>) id 1cA9pm-0006sJ-6p
 for bug-coreutils@HIDDEN; Fri, 25 Nov 2016 01:18:11 -0500
Received: from mail-pg0-x229.google.com ([2607:f8b0:400e:c05::229]:33539)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <boehme.marcel@HIDDEN>)
 id 1cA9pl-0006qh-Tv
 for bug-coreutils@HIDDEN; Fri, 25 Nov 2016 01:18:06 -0500
Received: by mail-pg0-x229.google.com with SMTP id 3so26332056pgd.0
 for <bug-coreutils@HIDDEN>; Thu, 24 Nov 2016 22:18:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:content-transfer-encoding:subject:message-id:date:to
 :mime-version; bh=mUiMmSeUhanHDhW1JLCG4bYnujLzsfapdXWSyaoGsZE=;
 b=KYgQfnSwi18jnc/7SiWBE0D/gooT1TV/MRPU1Zf6PwRQ4RFyhQgPw0ndCQT1n3Osnh
 KD6YWpQt4GtVJ7eK1SzM9M45GAUY/+IyWSwhp1D02j9VvK57bdFyd9fKT6SDbQYgmWwN
 AMNTvtTl9vwWvrjA9hFMG0bZRdChgGpDLvkIZYT4pEMsjJFTgh/K2k/nCcORq7UjhlZC
 7M/h4/oyxkRmycHCbgoBkiHKyKUJqbbF4y6YQHQYRgGbQ+B2v91CtFEYCD53ZPLIbU6p
 3332uqSGzeNvywCCFdw9TPY4Bqnzz6rl6qFtaFAvYgHwVqrta70aHgjz4IjeOFgzY4dJ
 SoWQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:content-transfer-encoding:subject
 :message-id:date:to:mime-version;
 bh=mUiMmSeUhanHDhW1JLCG4bYnujLzsfapdXWSyaoGsZE=;
 b=Pp0MJEoXvT1FiDR129PXSx+AYEKP/Ux5Oyv0XTMmb7f+AgdfFN2+NGl7d06r26+FXm
 k2I5mgmvh7IHp8kSHkZd3xh7/RGgyBbeciZNSNVLQmjkvkYTiJbH6kDtuwWO10sloAh+
 aJYRIn1ujJFvKepTlvubfg3yHa+Bv9wYnj+Qa+HVzbPba4G7WZtJZq9ivjA9h2YZkUcQ
 P/QNygtrfIwU0TULratPQ4TPY59rq7lcfiif8t7YWAS3s8py6wX1lJSSrnBrWN5Kuc9x
 KIA7j9XOTvNZxnAdvGNkkyl6P4e6pm9ZzrzCIBhd3nxs/lwjMGEpWXvh4l9mcwdVku73
 Fsgw==
X-Gm-Message-State: AKaTC01wcdAuuWj1bSfToLXkDolmAMBnbrH37MLj4fvcttKcETbTnsfXWNcbrBCm72QVKg==
X-Received: by 10.84.150.101 with SMTP id g92mr13844274plg.39.1480054684586;
 Thu, 24 Nov 2016 22:18:04 -0800 (PST)
Received: from r-114-103-25-172.comp.nus.edu.sg
 (nusnet-220-75.dynip.nus.edu.sg. [137.132.220.75])
 by smtp.gmail.com with ESMTPSA id y15sm46570297pgc.43.2016.11.24.22.18.03
 for <bug-coreutils@HIDDEN>
 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
 Thu, 24 Nov 2016 22:18:03 -0800 (PST)
From: Marcel =?UTF-8?Q?B=C3=B6hme?= <boehme.marcel@HIDDEN>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Message-Id: <E83B1AA6-4990-4C0F-BDB8-80D3E00313C8@HIDDEN>
Date: Fri, 25 Nov 2016 14:18:01 +0800
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
X-Mailer: Apple Mail (2.3124)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

Dear all,

The following execution is flagged by UBSAN as undefined behaviour:

$ echo 0 > a; printf "%0.s0" {1..58} >> a
$ ./sort -R a

UBSAN says:
../lib/md5.c:371:7: runtime error: load of misaligned address =
0x7ffdfd45a10d for type 'const uint32_t', which requires 4 byte =
alignment=20

So, the root cause might actually be in GNULIB. The bug was found with =
AFLFast, a fork of AFL.

Best regards,
- Marcel=




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Marcel =?UTF-8?Q?B=C3=B6hme?= <boehme.marcel@HIDDEN>
Subject: bug#25024: Acknowledgement (Bug in Sort)
Message-ID: <handler.25024.B.148005470014192.ack <at> debbugs.gnu.org>
References: <E83B1AA6-4990-4C0F-BDB8-80D3E00313C8@HIDDEN>
X-Gnu-PR-Message: ack 25024
X-Gnu-PR-Package: coreutils
Reply-To: 25024 <at> debbugs.gnu.org
Date: Fri, 25 Nov 2016 06:19:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-coreutils@HIDDEN

If you wish to submit further information on this problem, please
send it to 25024 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
25024: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D25024
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-coreutils@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#25024: Bug in Sort
Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady <P@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-coreutils@HIDDEN
Resent-Date: Fri, 25 Nov 2016 13:07:01 +0000
Resent-Message-ID: <handler.25024.B25024.148007921132548 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 25024
X-GNU-PR-Package: coreutils
X-GNU-PR-Keywords: 
To: Marcel =?UTF-8?Q?B=C3=B6hme?= <boehme.marcel@HIDDEN>, 25024 <at> debbugs.gnu.org
Received: via spool by 25024-submit <at> debbugs.gnu.org id=B25024.148007921132548
          (code B ref 25024); Fri, 25 Nov 2016 13:07:01 +0000
Received: (at 25024) by debbugs.gnu.org; 25 Nov 2016 13:06:51 +0000
Received: from localhost ([127.0.0.1]:41228 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cAGDL-0008Su-81
	for submit <at> debbugs.gnu.org; Fri, 25 Nov 2016 08:06:51 -0500
Received: from mail.magicbluesmoke.com ([82.195.144.49]:58976)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <P@HIDDEN>) id 1cAGDJ-0008Si-Nx
 for 25024 <at> debbugs.gnu.org; Fri, 25 Nov 2016 08:06:50 -0500
Received: from [192.168.1.80] (unknown [109.77.120.105])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 3EDF99493;
 Fri, 25 Nov 2016 13:06:48 +0000 (GMT)
References: <E83B1AA6-4990-4C0F-BDB8-80D3E00313C8@HIDDEN>
From: =?UTF-8?Q?P=C3=A1draig?= Brady <P@HIDDEN>
Message-ID: <d466f717-b1de-4c3a-51f5-965f5f09a011@HIDDEN>
Date: Fri, 25 Nov 2016 13:06:47 +0000
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.2.0
MIME-Version: 1.0
In-Reply-To: <E83B1AA6-4990-4C0F-BDB8-80D3E00313C8@HIDDEN>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

On 25/11/16 06:18, Marcel Böhme wrote:
> Dear all,
> 
> The following execution is flagged by UBSAN as undefined behaviour:
> 
> $ echo 0 > a; printf "%0.s0" {1..58} >> a
> $ ./sort -R a
> 
> UBSAN says:
> ../lib/md5.c:371:7: runtime error: load of misaligned address 0x7ffdfd45a10d for type 'const uint32_t', which requires 4 byte alignment 
> 
> So, the root cause might actually be in GNULIB. The bug was found with AFLFast, a fork of AFL.

There is some support at least for catering
for architectures where unaligned access is significant.
So for UBSAN we should probably build with
_STRING_ARCH_unaligned defined globally
to avoid warning for the cases we already handle.

cheers,
Pádraig




Message sent to bug-coreutils@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#25024: Bug in Sort
Resent-From: Paul Eggert <eggert@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-coreutils@HIDDEN
Resent-Date: Fri, 25 Nov 2016 18:51:02 +0000
Resent-Message-ID: <handler.25024.B25024.14800998157082 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 25024
X-GNU-PR-Package: coreutils
X-GNU-PR-Keywords: 
To: =?UTF-8?Q?P=C3=A1draig?= Brady <P@HIDDEN>, Marcel =?UTF-8?Q?B=C3=B6hme?= <boehme.marcel@HIDDEN>, 25024 <at> debbugs.gnu.org
Received: via spool by 25024-submit <at> debbugs.gnu.org id=B25024.14800998157082
          (code B ref 25024); Fri, 25 Nov 2016 18:51:02 +0000
Received: (at 25024) by debbugs.gnu.org; 25 Nov 2016 18:50:15 +0000
Received: from localhost ([127.0.0.1]:41744 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cALZf-0001qA-7z
	for submit <at> debbugs.gnu.org; Fri, 25 Nov 2016 13:50:15 -0500
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:50038)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1cALZd-0001pw-UF
 for 25024 <at> debbugs.gnu.org; Fri, 25 Nov 2016 13:50:14 -0500
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id DECE01600DD;
 Fri, 25 Nov 2016 10:50:07 -0800 (PST)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id H2Ggbhx090zR; Fri, 25 Nov 2016 10:50:07 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 26C851600DE;
 Fri, 25 Nov 2016 10:50:07 -0800 (PST)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id 0KE3y6nS7_v0; Fri, 25 Nov 2016 10:50:07 -0800 (PST)
Received: from [192.168.1.9] (unknown [47.153.178.162])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 091531600DD;
 Fri, 25 Nov 2016 10:50:07 -0800 (PST)
References: <E83B1AA6-4990-4C0F-BDB8-80D3E00313C8@HIDDEN>
 <d466f717-b1de-4c3a-51f5-965f5f09a011@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <8ec078cd-ebaa-68fd-7486-2165f4635cf3@HIDDEN>
Date: Fri, 25 Nov 2016 10:50:06 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.4.0
MIME-Version: 1.0
In-Reply-To: <d466f717-b1de-4c3a-51f5-965f5f09a011@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -3.0 (---)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.0 (---)

P=C3=A1draig Brady wrote:
> for UBSAN we should probably build with
> _STRING_ARCH_unaligned defined globally
> to avoid warning for the cases we already handle.

Yes. Translating this for non-experts: the problem here is a bug in the=20
bug-finding procedure, not a bug in GNU coreutils or in Gnulib.

Recent glibc (since 2016-02-18) does not define _STRING_ARCH_unaligned, w=
hich=20
means that this code in gnulib md5.c etc. is no longer exercised on recen=
t=20
platforms. So in some sense the originally-reported bug is already fixed =
(via an=20
unexpected glibc change), though this does mean Gnulib md5 etc. is now sl=
ower on=20
x86-64 etc., which is a performance bug on newer platforms. If we fix the=
=20
performance bug I suppose we'll start getting false alarms from UBSAN aga=
in.




Message sent to bug-coreutils@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#25024: Bug in Sort
Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady <P@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-coreutils@HIDDEN
Resent-Date: Fri, 25 Nov 2016 22:26:02 +0000
Resent-Message-ID: <handler.25024.B25024.148011273126908 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 25024
X-GNU-PR-Package: coreutils
X-GNU-PR-Keywords: 
To: Paul Eggert <eggert@HIDDEN>, Marcel =?UTF-8?Q?B=C3=B6hme?= <boehme.marcel@HIDDEN>, 25024 <at> debbugs.gnu.org
Received: via spool by 25024-submit <at> debbugs.gnu.org id=B25024.148011273126908
          (code B ref 25024); Fri, 25 Nov 2016 22:26:02 +0000
Received: (at 25024) by debbugs.gnu.org; 25 Nov 2016 22:25:31 +0000
Received: from localhost ([127.0.0.1]:41846 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cAOvy-0006zw-Q8
	for submit <at> debbugs.gnu.org; Fri, 25 Nov 2016 17:25:31 -0500
Received: from mail.magicbluesmoke.com ([82.195.144.49]:32804)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <P@HIDDEN>) id 1cAOvw-0006zm-T7
 for 25024 <at> debbugs.gnu.org; Fri, 25 Nov 2016 17:25:29 -0500
Received: from [192.168.1.80] (unknown [109.77.120.105])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 18EE79493;
 Fri, 25 Nov 2016 22:25:27 +0000 (GMT)
References: <E83B1AA6-4990-4C0F-BDB8-80D3E00313C8@HIDDEN>
 <d466f717-b1de-4c3a-51f5-965f5f09a011@HIDDEN>
 <8ec078cd-ebaa-68fd-7486-2165f4635cf3@HIDDEN>
From: =?UTF-8?Q?P=C3=A1draig?= Brady <P@HIDDEN>
Message-ID: <05ce2dff-1299-9da1-9fb8-2b3c544060a7@HIDDEN>
Date: Fri, 25 Nov 2016 22:25:26 +0000
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.2.0
MIME-Version: 1.0
In-Reply-To: <8ec078cd-ebaa-68fd-7486-2165f4635cf3@HIDDEN>
Content-Type: multipart/mixed; boundary="------------0794AFD012B2A0C6722AD10E"
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

This is a multi-part message in MIME format.
--------------0794AFD012B2A0C6722AD10E
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

On 25/11/16 18:50, Paul Eggert wrote:
> Pádraig Brady wrote:
>> for UBSAN we should probably build with
>> _STRING_ARCH_unaligned defined globally
>> to avoid warning for the cases we already handle.
> 
> Yes. Translating this for non-experts: the problem here is a bug in the 
> bug-finding procedure, not a bug in GNU coreutils or in Gnulib.

Sorry I was a bit terse. coreutils/gnulib should currently be compiled with
  -D_STRING_ARCH_unaligned=0 -D_STRING_INLINE_unaligned=0
when using UBSAN, to use only alignment portable code.
Methods for avoiding false UBSAN warnings automatically are discussed below...

> Recent glibc (since 2016-02-18) does not define _STRING_ARCH_unaligned, which 
> means that this code in gnulib md5.c etc. is no longer exercised on recent 
> platforms.

Oh interesting. I see details in:
https://sourceware.org/bugzilla/show_bug.cgi?id=19462
There it suggests that _STRING_ARCH_unaligned is now internal
to glibc and _STRING_INLINE_unaligned is the newer stable equivalent.
Attached patch to do this for coreutils is attached.

> So in some sense the originally-reported bug is already fixed (via an 
> unexpected glibc change), though this does mean Gnulib md5 etc. is now slower on 
> x86-64 etc., which is a performance bug on newer platforms. If we fix the 
> performance bug I suppose we'll start getting false alarms from UBSAN again.

We can explicitly avoid the UBSAN warnings with something like:
http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.23-80-g5760532
which might be acceptable given the few places it matters.
That's a bit of a big hammer though, defining away all of UBSAN for those routines.

Alternatively we might define the non-portable faster path away,
if we could detect we where compiling in UBSAN mode.
That's easy enough for -fsanitize=address, though it doesn't
look like there is currently a way to detect -fsanitize=undefined?
http://stackoverflow.com/q/39371798/4421

Another approach would be to support ../configure --with-asan --with-ubsan
which would define things appropriately.

cheers,
Pádraig.

--------------0794AFD012B2A0C6722AD10E
Content-Type: text/x-patch;
 name="coreutils-unaligned.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="coreutils-unaligned.patch"

=46rom 952bd8666c7ed887d49b049a7585b56c1e93f323 Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?P=3DC3=3DA1draig=3D20Brady?=3D <P@HIDDEN>
Date: Fri, 25 Nov 2016 22:10:20 +0000
Subject: [PATCH] shred,sort: ensure faster unaligned access to rand modul=
e

glibc has changed the public define
from _STRING_ARCH_unaligned to _STRING_INLINE_unaligned as per
https://sourceware.org/bugzilla/show_bug.cgi?id=3D19462

* gl/lib/rand-isaac.c: Cater for both defines.
* gl/lib/randread.c: Likewise.
* src/system.h: Update commented out code.
---
 gl/lib/rand-isaac.c | 2 +-
 gl/lib/randread.c   | 2 +-
 src/system.h        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gl/lib/rand-isaac.c b/gl/lib/rand-isaac.c
index 5ad9cae..349bf0e 100644
--- a/gl/lib/rand-isaac.c
+++ b/gl/lib/rand-isaac.c
@@ -40,7 +40,7 @@
 /* If the platform supports unaligned access,
    then don't have -fsanitize=3Dundefined warn about it.  */
 #undef ATTRIBUTE_NO_WARN_SANITIZE_UNDEFINED
-#if !_STRING_ARCH_unaligned \
+#if !(_STRING_ARCH_unaligned || _STRING_INLINE_unaligned) \
     || __GNUC__ < 4 || (__GNUC__ =3D=3D 4 && __GNUC_MINOR__ < 9)
 # define ATTRIBUTE_NO_WARN_SANITIZE_UNDEFINED /* empty */
 #else
diff --git a/gl/lib/randread.c b/gl/lib/randread.c
index ff85d56..2d211a0 100644
--- a/gl/lib/randread.c
+++ b/gl/lib/randread.c
@@ -60,7 +60,7 @@
 # define MIN(a, b) ((a) < (b) ? (a) : (b))
 #endif
=20
-#if _STRING_ARCH_unaligned
+#if _STRING_ARCH_unaligned || _STRING_INLINE_unaligned
 # define ALIGNED_POINTER(ptr, type) true
 #else
 # define ALIGNED_POINTER(ptr, type) ((size_t) (ptr) % alignof (type) =3D=
=3D 0)
diff --git a/src/system.h b/src/system.h
index e82dce4..3fa0740 100644
--- a/src/system.h
+++ b/src/system.h
@@ -515,7 +515,7 @@ is_nul (void const *buf, size_t length)
    to avoid -fsanitize=3Dundefined warnings.
    Considering coreutils is mainly concerned with relatively
    large buffers, we'll just use the defined behavior.  */
-#if 0 && _STRING_ARCH_unaligned
+#if 0 && (_STRING_ARCH_unaligned || _STRING_INLINE_unaligned)
   unsigned long word;
 #else
   unsigned char word;
--=20
2.5.5


--------------0794AFD012B2A0C6722AD10E--




Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 28 Oct 2018 07:28:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 28 03:28:31 2018
Received: from localhost ([127.0.0.1]:46441 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gGfUt-0003xo-Kc
	for submit <at> debbugs.gnu.org; Sun, 28 Oct 2018 03:28:31 -0400
Received: from mail-it1-f170.google.com ([209.85.166.170]:37152)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <assafgordon@HIDDEN>) id 1gGfUs-0003xa-4A
 for control <at> debbugs.gnu.org; Sun, 28 Oct 2018 03:28:30 -0400
Received: by mail-it1-f170.google.com with SMTP id e74-v6so6160727ita.2
 for <control <at> debbugs.gnu.org>; Sun, 28 Oct 2018 00:28:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=to:from:message-id:date:user-agent:mime-version:content-language
 :content-transfer-encoding;
 bh=7RIO0ZgTFrF+gTmsWqOeZsaGL5MnT83OhcTu7MWwda0=;
 b=tzaStuNLm4XE5Mx56HODTi2ZM6ad5TcXT8wlimhLpXJyrM7Gyfk3SIiDIoUpqvYJEq
 S3JX8TGi1Tj9U+9t4qJo4UYTYekFszZQqu9zf9LOpMTW9tCe568DiuHSHSDqphlOQuy+
 5AwCiLmMc7f4UMY8xezi8ror17Y6O4DT8qWxUbky2gWJuvIdstL2WnpwseEKUnlOQjFn
 6cFHklqW8VDgM+1rWhsFFgs8ztmL+R0CN3IKzlasqZMGtherJStUeHVbX5hEnXWqej7K
 ijOdVXx5QUtVp2gzADnt8z16cHTnV+W/9IzGGHpIEuEiiGU6rXmbWztknoWssabaQTys
 zjzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:to:from:message-id:date:user-agent:mime-version
 :content-language:content-transfer-encoding;
 bh=7RIO0ZgTFrF+gTmsWqOeZsaGL5MnT83OhcTu7MWwda0=;
 b=BPG4NgM6DDKQAfB3DIGxT+rBPacZAo2kuMNbWFQlWGT3pX55r/OL/kKSdDEU09lxY5
 qdTrEvfANbrIp5I8q5AgI0U03/PP9MTcKBfzySojYp+QrVOFTzLf32Q0ID2uEFaYi0bc
 6wbNcKhfXnBQGQx9/qLxPd5tnSHKx3igUWXMGuvWAKMY1yJQCzPEAf+hb8cGEnzi5Ic/
 g0yk9MVuYgz6UzJv/BsJov/VRW9wIyb+hfkjSdF+k5G+vDnaFTHLsEt4u63Yq5MWc1Kh
 ENV1RmW37AHq0BJljoTFLkgAsCL4uef7OZDSraThS2vmr1rKW7+ytj5dM2oKLXqeHWuN
 fGqg==
X-Gm-Message-State: AGRZ1gJ5Ndb3h0yQg82VIwbVCiSta57FJlDmaAyy2AZsB7zjZK+vU4CA
 bWoBFInCAoKB4udj6kQDgTKHNjXJ2mQ=
X-Google-Smtp-Source: AJdET5fIRIwcP2WQLO+jT2mpyvUS+k6Y76Wel7MTHkjJ7EhrH972X9tg6sQKkvzhnGfA5R/GK0K9qA==
X-Received: by 2002:a24:b8c5:: with SMTP id
 m188-v6mr7374490ite.27.1540711704083; 
 Sun, 28 Oct 2018 00:28:24 -0700 (PDT)
Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38])
 by smtp.googlemail.com with ESMTPSA id
 e78-v6sm5460664itc.4.2018.10.28.00.28.22
 for <control <at> debbugs.gnu.org>
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 28 Oct 2018 00:28:23 -0700 (PDT)
To: control <at> debbugs.gnu.org
From: Assaf Gordon <assafgordon@HIDDEN>
Message-ID: <ec15c5bf-ba81-62c9-89ec-13192b636c2b@HIDDEN>
Date: Sun, 28 Oct 2018 01:28:21 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 2.0 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  retitle 25024 build: adjust for ASAN/UBSAN severity 25024
 wishlist [...] 
 Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
 (assafgordon[at]gmail.com)
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.85.166.170 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
 trust [209.85.166.170 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 1.8 MISSING_SUBJECT        Missing Subject: header
 0.2 NO_SUBJECT             Extra score for no subject
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

retitle 25024 build: adjust for ASAN/UBSAN
severity 25024 wishlist




Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 28 Oct 2018 07:28:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 28 03:28:31 2018
Received: from localhost ([127.0.0.1]:46441 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gGfUt-0003xo-Kc
	for submit <at> debbugs.gnu.org; Sun, 28 Oct 2018 03:28:31 -0400
Received: from mail-it1-f170.google.com ([209.85.166.170]:37152)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <assafgordon@HIDDEN>) id 1gGfUs-0003xa-4A
 for control <at> debbugs.gnu.org; Sun, 28 Oct 2018 03:28:30 -0400
Received: by mail-it1-f170.google.com with SMTP id e74-v6so6160727ita.2
 for <control <at> debbugs.gnu.org>; Sun, 28 Oct 2018 00:28:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=to:from:message-id:date:user-agent:mime-version:content-language
 :content-transfer-encoding;
 bh=7RIO0ZgTFrF+gTmsWqOeZsaGL5MnT83OhcTu7MWwda0=;
 b=tzaStuNLm4XE5Mx56HODTi2ZM6ad5TcXT8wlimhLpXJyrM7Gyfk3SIiDIoUpqvYJEq
 S3JX8TGi1Tj9U+9t4qJo4UYTYekFszZQqu9zf9LOpMTW9tCe568DiuHSHSDqphlOQuy+
 5AwCiLmMc7f4UMY8xezi8ror17Y6O4DT8qWxUbky2gWJuvIdstL2WnpwseEKUnlOQjFn
 6cFHklqW8VDgM+1rWhsFFgs8ztmL+R0CN3IKzlasqZMGtherJStUeHVbX5hEnXWqej7K
 ijOdVXx5QUtVp2gzADnt8z16cHTnV+W/9IzGGHpIEuEiiGU6rXmbWztknoWssabaQTys
 zjzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:to:from:message-id:date:user-agent:mime-version
 :content-language:content-transfer-encoding;
 bh=7RIO0ZgTFrF+gTmsWqOeZsaGL5MnT83OhcTu7MWwda0=;
 b=BPG4NgM6DDKQAfB3DIGxT+rBPacZAo2kuMNbWFQlWGT3pX55r/OL/kKSdDEU09lxY5
 qdTrEvfANbrIp5I8q5AgI0U03/PP9MTcKBfzySojYp+QrVOFTzLf32Q0ID2uEFaYi0bc
 6wbNcKhfXnBQGQx9/qLxPd5tnSHKx3igUWXMGuvWAKMY1yJQCzPEAf+hb8cGEnzi5Ic/
 g0yk9MVuYgz6UzJv/BsJov/VRW9wIyb+hfkjSdF+k5G+vDnaFTHLsEt4u63Yq5MWc1Kh
 ENV1RmW37AHq0BJljoTFLkgAsCL4uef7OZDSraThS2vmr1rKW7+ytj5dM2oKLXqeHWuN
 fGqg==
X-Gm-Message-State: AGRZ1gJ5Ndb3h0yQg82VIwbVCiSta57FJlDmaAyy2AZsB7zjZK+vU4CA
 bWoBFInCAoKB4udj6kQDgTKHNjXJ2mQ=
X-Google-Smtp-Source: AJdET5fIRIwcP2WQLO+jT2mpyvUS+k6Y76Wel7MTHkjJ7EhrH972X9tg6sQKkvzhnGfA5R/GK0K9qA==
X-Received: by 2002:a24:b8c5:: with SMTP id
 m188-v6mr7374490ite.27.1540711704083; 
 Sun, 28 Oct 2018 00:28:24 -0700 (PDT)
Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38])
 by smtp.googlemail.com with ESMTPSA id
 e78-v6sm5460664itc.4.2018.10.28.00.28.22
 for <control <at> debbugs.gnu.org>
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 28 Oct 2018 00:28:23 -0700 (PDT)
To: control <at> debbugs.gnu.org
From: Assaf Gordon <assafgordon@HIDDEN>
Message-ID: <ec15c5bf-ba81-62c9-89ec-13192b636c2b@HIDDEN>
Date: Sun, 28 Oct 2018 01:28:21 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 2.0 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  retitle 25024 build: adjust for ASAN/UBSAN severity 25024
 wishlist [...] 
 Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
 (assafgordon[at]gmail.com)
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.85.166.170 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
 trust [209.85.166.170 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 1.8 MISSING_SUBJECT        Missing Subject: header
 0.2 NO_SUBJECT             Extra score for no subject
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

retitle 25024 build: adjust for ASAN/UBSAN
severity 25024 wishlist





Last modified: Sun, 28 Oct 2018 07:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.