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 #40 received at 1237@pari.math.u-bordeaux.fr (full text, mbox, reply):

Received: (at 1237) by pari.math.u-bordeaux.fr; 19 Sep 2011 17:32:05 +0000
From jtaylor.debian@googlemail.com Mon Sep 19 19:32:05 2011
Received: from mail-fx0-f45.google.com ([209.85.161.45])
	by pari.math.u-bordeaux1.fr with esmtp (Exim 4.69)
	(envelope-from <jtaylor.debian@googlemail.com>)
	id 1R5hhN-0000oT-9N
	for 1237@pari.math.u-bordeaux.fr; Mon, 19 Sep 2011 19:32:05 +0200
Received: by fxh13 with SMTP id 13so6253296fxh.32
        for <1237@pari.math.u-bordeaux.fr>; Mon, 19 Sep 2011 10:32:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=googlemail.com; s=gamma;
        h=message-id:date:from:user-agent:mime-version:to:cc:subject
         :references:in-reply-to:x-enigmail-version:content-type;
        bh=Nky7UcbAVcdeVxp1ueRbIiB3HoKV+FUSrHQsnMvHGNk=;
        b=FStUHvEzIHb0w3P88KhuCfULl7scbci8JQFnsm+0XHCsdlfNHcis37/RIiw66pA+eN
         ftfmqZRu3DO/eC2UbNiSB1of5MqgCv5IxAg5FANkBrEF6L/YUhBehxLT5aMbMomv9m/X
         kL2c+M1helI5/FbHwY0iWU5JiUl3Zvnp5R3ZY=
Received: by 10.223.19.6 with SMTP id y6mr5459505faa.147.1316453519936;
        Mon, 19 Sep 2011 10:31:59 -0700 (PDT)
Received: from [192.168.0.12] (p5498A657.dip.t-dialin.net. [84.152.166.87])
        by mx.google.com with ESMTPS id o16sm22370955fag.21.2011.09.19.10.31.50
        (version=SSLv3 cipher=OTHER);
        Mon, 19 Sep 2011 10:31:51 -0700 (PDT)
Message-ID: <4E777C7D.1010101@googlemail.com>
Date: Mon, 19 Sep 2011 19:31:41 +0200
From: Julian Taylor <jtaylor.debian@googlemail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110914 Thunderbird/7.0
MIME-Version: 1.0
To: Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
CC: Julian Taylor <jtaylor.debian@googlemail.com>, 
 1237@pari.math.u-bordeaux.fr
Subject: Re: Bug#1237: undefined behaviour in pari_init_parser
References: <4E5E52C5.4050702@googlemail.com> <20110901202245.GH17070@yellowpig> <4E5FF27B.5080600@googlemail.com> <20110902165738.GM17070@yellowpig> <20110913144151.GE6199@yellowpig> <4E76503A.9070006@googlemail.com> <20110918214754.GM18359@yellowpig>
In-Reply-To: <20110918214754.GM18359@yellowpig>
X-Enigmail-Version: 1.4a1pre
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enigD18D65F52947024A829750E7"
[Message part 1 (text/plain, inline)]
On 09/18/2011 11:47 PM, Bill Allombert wrote:
> 
> Can you check with the debugger whether it is not a different instance of the same
> issue ? The function pari_init_parser has a similar issue.
> 
> Cheers,
> Bill.

gdb backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x001e5e8e in pari_realloc (size=960, pointer=<optimized out>) at ../src/headers/pariinl.h:842
842	  if (!tmp) pari_err(memer);
(gdb) bt
#0  0x001e5e8e in pari_realloc (size=960, pointer=<optimized out>) at ../src/headers/pariinl.h:842
#1  stack_alloc (nb=40, s=<optimized out>) at ../src/headers/pariinl.h:580
#2  pari_init_parser () at ../src/language/parsec.h:44
#3  0x001d61b4 in pari_init_blocks () at ../src/language/init.c:126
#4  pari_thread_init () at ../src/language/init.c:682
#5  pari_init_opts (parisize=<optimized out>, maxprime=<optimized out>, init_opts=<optimized out>)
    at ../src/language/init.c:750
#6  0x0002b602 in main (argc=1, argv=0x408003ac) at ../src/gp/gp.c:1984

(gdb) frame 2
(gdb) p s_node
$4 = {
  offset = 61380, 
  n = 40, 
  alloc = 40, 
  size = 24
}

this is actually the issue I originally had. I may have never encountered
the issue you fixed with the patch.
Can this function be fixed in the same way?

[signature.asc (application/pgp-signature, attachment)]

Send a report that this bug log contains spam.


Bill Allombert <allomber@math.u-bordeaux.fr>. Last modified: Sat Aug 26 17:15:03 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.