PARI/GP Bug report logs - #1237
undefined behaviour in pari_init_parser

Package: pari; Maintainer for pari is Aurel Page <aurel.page@normalesup.org>; Source for pari is src:pari.

Reported by: Julian Taylor <jtaylor.debian@googlemail.com>

Date: Wed, 31 Aug 2011 15:33:08 UTC

Severity: normal

Done: Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 1237@pari.math.u-bordeaux.fr (full text, mbox, reply):

Received: (at 1237) by pari.math.u-bordeaux.fr; 2 Sep 2011 16:57:44 +0000
From Bill.Allombert@math.u-bordeaux1.fr Fri Sep 02 18:57:44 2011
Received: from smtp5-g21.free.fr ([212.27.42.5])
	by pari.math.u-bordeaux1.fr with esmtp (Exim 4.69)
	(envelope-from <Bill.Allombert@math.u-bordeaux1.fr>)
	id 1QzX3o-0004lZ-DO
	for 1237@pari.math.u-bordeaux.fr; Fri, 02 Sep 2011 18:57:44 +0200
Received: from yellowpig (unknown [82.239.212.167])
	by smtp5-g21.free.fr (Postfix) with ESMTP id D316BD48049;
	Fri,  2 Sep 2011 18:57:39 +0200 (CEST)
Received: from bill by yellowpig with local (Exim 4.72)
	(envelope-from <Bill.Allombert@math.u-bordeaux1.fr>)
	id 1QzX3i-0004Vg-K1; Fri, 02 Sep 2011 18:57:38 +0200
Date: Fri, 2 Sep 2011 18:57:38 +0200
From: Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
To: Julian Taylor <jtaylor.debian@googlemail.com>
Cc: 1237@pari.math.u-bordeaux.fr
Subject: Re: Bug#1237: undefined behaviour in pari_init_parser
Message-ID: <20110902165738.GM17070@yellowpig>
References: <4E5E52C5.4050702@googlemail.com>
 <20110901202245.GH17070@yellowpig>
 <4E5FF27B.5080600@googlemail.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="JgQwtEuHJzHdouWu"
Content-Disposition: inline
In-Reply-To: <4E5FF27B.5080600@googlemail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
[Message part 1 (text/plain, inline)]
On Thu, Sep 01, 2011 at 11:00:43PM +0200, Julian Taylor wrote:
> On 09/01/2011 10:22 PM, Bill Allombert wrote:
> >
> >Hello Julian,
> >
> >Undefined according to what rule ? The code is only requiring the adress space to be flat
> >which is true on all supported platforms.
> >
> 
> https://www.securecoding.cert.org/confluence/display/seccode/CC.+Undefined+Behavior#CC.UndefinedBehavior-ub45

Rule ARR36-C is quite excessive: for example it disallows taking the difference
of pointers inside the same malloc'ed block. PARI stack management has always
required this functionality.

> Although it is possible that it is a compiler bug causing this
> issue, this behavior should be fixed somehow too.

Well, you can try the attached patch which work around the compiler issue without
breaking the ABI (tested on sparc).

Cheers,
Bill.
[patch (text/plain, attachment)]

Send a report that this bug log contains spam.


Bill Allombert <allomber@math.u-bordeaux.fr>. Last modified: Sat Aug 26 17:15:18 2023; Machine Name: pari

PARI/GP Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.