[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Serious Troubles using GMP-4.1.2
From: |
Codrin Pruteanu |
Subject: |
Serious Troubles using GMP-4.1.2 |
Date: |
Fri, 24 Oct 2003 08:40:28 -0700 (PDT) |
Hi,
I have serious problems with GNU GMP 4.1.2. from Red
Hat 9.0 Shrike distribution. When I try to use
mpz_get_str function with it's default memory
allocation or with my allocation in both cases I got
Segmentation fault.
Example:
--------
mpz_t bignumber;
mpz_init(bignumber);
char *string = new
char[mpz_sizeinbase(bignumber,base)+2];
1. char *result = mpz_get_str (NULL, base, bignumber);
2. char *result = mpz_get_str (string, base,
bignumber);
in both situations I got troubles when <bignumber>
value is high. I traced the program execution with
Valgrind memory debugger and he says:
==10141== Invalid read of size 1
==10141== at 0x40244FF3: __gmpz_set_str (in
/usr/lib/libgmp.so.3.3.2)
Could anyone help me with a solution here, please?
thank you in advance,
ing. Codrin Pruteanu
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
- Serious Troubles using GMP-4.1.2,
Codrin Pruteanu <=