GNU bug report logs - #25024
build: adjust for ASAN/UBSAN

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Severity: wishlist; Reported by: Marcel Böhme <boehme.marcel@HIDDEN>; dated Fri, 25 Nov 2016 06:19:02 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Changed bug title to 'build: adjust for ASAN/UBSAN' from 'Bug in Sort' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 25024) by debbugs.gnu.org; 25 Nov 2016 22:25:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 25 17:25:31 2016
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)
Subject: Re: bug#25024: Bug in Sort
To: Paul Eggert <eggert@HIDDEN>, =?UTF-8?Q?Marcel_B=c3=b6hme?=
 <boehme.marcel@HIDDEN>, 25024 <at> debbugs.gnu.org
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-Debbugs-Envelope-To: 25024
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--




Information forwarded to bug-coreutils@HIDDEN:
bug#25024; Package coreutils. Full text available.

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


Received: (at 25024) by debbugs.gnu.org; 25 Nov 2016 18:50:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 25 13:50:15 2016
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)
Subject: Re: bug#25024: Bug in Sort
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@HIDDEN>,
 =?UTF-8?Q?Marcel_B=c3=b6hme?= <boehme.marcel@HIDDEN>,
 25024 <at> debbugs.gnu.org
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-Debbugs-Envelope-To: 25024
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.




Information forwarded to bug-coreutils@HIDDEN:
bug#25024; Package coreutils. Full text available.

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


Received: (at 25024) by debbugs.gnu.org; 25 Nov 2016 13:06:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 25 08:06:51 2016
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)
Subject: Re: bug#25024: Bug in Sort
To: =?UTF-8?Q?Marcel_B=c3=b6hme?= <boehme.marcel@HIDDEN>,
 25024 <at> debbugs.gnu.org
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-Debbugs-Envelope-To: 25024
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




Information forwarded to bug-coreutils@HIDDEN:
bug#25024; Package coreutils. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 25 Nov 2016 06:18:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 25 01:18:20 2016
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: =?utf-8?Q?Marcel_B=C3=B6hme?= <boehme.marcel@HIDDEN>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Subject: Bug in Sort
Message-Id: <E83B1AA6-4990-4C0F-BDB8-80D3E00313C8@HIDDEN>
Date: Fri, 25 Nov 2016 14:18:01 +0800
To: bug-coreutils@HIDDEN
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-Debbugs-Envelope-To: submit
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=




Acknowledgement sent to Marcel Böhme <boehme.marcel@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#25024; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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