mpz_out_str seg fault with large number = bug? viny at
Thu Aug 4 05:10:01 CEST 2005

>> >  Is there any documentation about the admisible range of those
>> >
>> >Please see
>> >
>> >-- 
>I think he meant for you to read the following from the FAQ:
>Q: I get a Segfault/Bus error in a program that uses GMP to calculate
>numbers with several hundred thousand digits. Why?
>A: GMP allocates most temporaries on the stack, and some machines give user
>programs very little stack space by default. See setrlimit(2) for
>information on how to increase the stack allocation. You can also change
>from the shell (using ulimit or limit depending on the shell). You can also
>configure with --disable-alloca to instead allocate temporaries using
>malloc, but that will make the library run somewhat slower.

Oh, now I get it.

Already corrected the problem and runned fine for (10^7)!, and the mpz_out
also.  I was only a newbie error after all.  =)

Thanks again to all.

More information about the gmp-discuss mailing list