| Karim BELABAS on Tue, 18 Jun 2002 10:23:45 +0200 (MEST) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: 64bit HPUX binary buggy |
On Wed, 12 Jun 2002, Karim BELABAS wrote:
> On Wed, 12 Jun 2002, Igor Schein wrote:
>> OK, I'm including the complete log of bnfinit(x^2+1) at \g9 on HPUX.
[...]
>
> OK, I guess the problem occurs in minim_alloc (should be entered only once),
> probably in init_dalloc() or in dalloc() [ allocate a double * on the pari
> stack ], presumably the latter.
>
[...]
> double *
> dalloc(size_t n)
> {
> gpmem_t av = avma - n;
> if ((long)av < 0 || avma < bot) err(errpile);
> avma = av; return (double*)avma;
> }
The problem was solved in private email: the ((long)av < 0) test in dalloc
was incorrect [ assumed addresses were not "too large" ]. The function now
reads:
double *
dalloc(size_t n)
{
if (avma - bot < n) err(errpile);
avma -= n; return (double*)avma;
}
which should be foolproof ... assuming the stack grows downward [ looks like a
good idea to encapsulate that as well ]
Karim.
--
Karim Belabas Tel: (+33) (0)1 69 15 57 48
Dép. de Mathematiques, Bat. 425 Fax: (+33) (0)1 69 15 60 19
Université Paris-Sud Email: Karim.Belabas@math.u-psud.fr
F-91405 Orsay (France) http://www.math.u-psud.fr/~belabas
--
PARI/GP Home Page: http://www.parigp-home.de/