Karim Belabas on Sat, 26 Aug 2023 15:54:19 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: bug in simplify_shallow
|
- To: Charles Greathouse <crgreathouse@gmail.com>, "Ruud H.G. van Tol" <rvtol@isolution.nl>, pari-dev@pari.math.u-bordeaux.fr
- Subject: Re: bug in simplify_shallow
- From: Karim Belabas <Karim.Belabas@u-bordeaux.fr>
- Date: Sat, 26 Aug 2023 15:49:35 +0200
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1693057767; c=relaxed/relaxed; bh=s/W1ZUmol7Lz8jg0q+tol0otuNLFuT8YmKLRPt1zSFk=; h=Date:From:To:Subject:Message-ID:Mail-Followup-To:References: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; b=CtsO1et7I9KjicJtwSr8mL4qjqvmAK58DmJN/+w0FyepHXcjb2zzIRkscbwuh3dO6MeulmgIQFArEy0wvUxFsVN+WsvpUQcHDq7Ux2EMjcIQsLNHsDCoVH+GzWt5+gO/d6fFstguGptGWXoR5ojuaTaP4R9TdGNUJKAXL4wavW40gFSNL6Nf3Rx+O7T7mwZYooh5a3O0iyh/JtuAMXuVioasulmFu1/IRtSeHVBYU3DmKc/tCbspOLHXPOMtAr51QZHFmeN+CdzesqioR2ILniI8QM6J3RmyLpB81G1Dce6/zyecnbjQzw39dlaN4ohmZcGxU/6hmhiqRc7HoKn0bLOqLrtLMnPEnv7hNdLFutRto4kbsxCiK9CiBShZRUmjgWPtHeRVRhUcYqozj+wgE6rsIvFDIOgerJQZcqMeb1u3Giofg4FgqjHPlaom/dtiC3XHQBM9+DwVTPnNngGucItHcITNZVuTpivOx//ehRdwjgUbBs01yRiM4HOrzfHjFIHbhGPm/ljwF30Ne871fiNnAZfZRay1alBSP7V6ClX9hXKuubk4jHoNkHdSkTEXZgBBNuf+zlObk97VxWScvtZD3QVU2cM3ZSDt3s4hcpFzzUDaITCUd/H0MfvPlHXWHX4D0Uhvb2ZWCg/KrsLf+sxnYUDafww+PrKhNrbHOJ8=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1693057767; cv=none; b=xY72fZiYzUmt1Rel2VN0PTSlt8r9lkUqOIQdSbmswGZLhm8QCowBYLcE88FzV5JvGWJxiytgiUGXIQigRpMWmNM6yC3MV246NA8gQXwGE3CJyJL8WO3Z+JTg7AcJVRMGMzQOCpMhJQ7xnQ5LcB4M3p/xbboJOOEk8S/W/AWEILsy7yCbBeCu2Qdhwl1UMSWX9KXiFOIQAQyvRUe6Ug1rtqPqmALPeDQhJNCsvIjcu4fiumtouZiZR6AZhHuR/uK3+MdkdV5rWwNmq4701Xa9ZIJY3lkempxxcr+cMMSOZu7H4GK9mcsrgggB2zy37fVeabIsVteYx0E6197+nM1zTzEVSN+kDU0wElpBzwU65KY9EOAdoEGGkMoLhJI/HlqvEKS7pjresKCcKSo74Nb4bUYMhuBMsmaCY+4oSGFZPUMvcl7W1ukqC9SDP1tWWbBg2Q5THGZBRm3tGnd1R2Ah8kjC166Ppynzv8z/BN16d97Tj/0CTIcFg5JS5cHmKAE+o/RiGl8huq+BqObH3EoSsulNHodew7B8ZS4v7E0/CZkXdez74oAvYW1XcrNETpw4eGQ2rMUIwJQB531K//ctsDa5Muy8IBQsUkMovzDJbMyhygqo1Q0lY9CcpZwGQzJM30tbt0X+i7JOJNm9XeIDVAp4W8hI4AwtrX9m2eJihcc=
- Authentication-results: smail; arc=none
- Delivery-date: Sat, 26 Aug 2023 15:54:19 +0200
- In-reply-to: <ZOoCXdx+VmSoRmML@math.u-bordeaux.fr>
- Mail-followup-to: Charles Greathouse <crgreathouse@gmail.com>, "Ruud H.G. van Tol" <rvtol@isolution.nl>, pari-dev@pari.math.u-bordeaux.fr
- References: <1e144fa5-864d-450e-a109-1fac8300bf88@isolution.nl> <CANXmBjzx4t330CnCzz4TzMfPFVVYg+-T7iskqECzh_+_2G2ABw@mail.gmail.com> <ZOoCXdx+VmSoRmML@math.u-bordeaux.fr>
* Karim Belabas [2023-08-26 15:47]:
> You'll see it with valgrind.
Meaning: you'll see that we are reading freed memory. Which may or
may not trigger the reported 'bug in simplify_shallow'
(it doesn't trigger for me either). But it's undoubtedly a bug.
Cheers,
K.B.
> From the GP code, I can guess what's happening: the lexical variable L
> will be destroyed (gunclone) when we leave the user function scope. But
> that user function still returns the return value of listput() which is
> the element stored in the list. The latter is a 'clone' (as all list
> entries), so supposedly safe. The lexical variable destructor breaks
> that asumption.
>
> I don't think the reference count machinery currently in place can
> deal with this. Adding a gcopy somewhere should be enough (but slow down
> all 'listput' operations...). Don't have time to delve in the C code
> right now to confirm this; I'll have a look later if Bill doesn't beat
> me to it :-)
>
> Cheers,
>
> K.B.
>
>
> * Charles Greathouse [2023-08-26 15:36]:
> > I don’t see it on version 2.16.1, df828f1c94.
> >
> > On Sat, Aug 26, 2023 at 9:04 AM Ruud H.G. van Tol <rvtol@isolution.nl>
> > wrote:
> >
> > >
> > > ? version()
> > > % [2, 15, 4]
> > >
> > > ? my(L=List()); listput(L,1);
> > > *** bug in simplify_shallow, type unknown, please report.
> > >
> > > -- Ruud
> > >
> > >
> > >
>
> K.B.
> --
> Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
> Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
> http://www.math.u-bordeaux.fr/~kbelabas/
K.B.
--
Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/