[Fwd: Memory access violation in gmp_printf using gmp 4.1.4 on Athlon64 fedora core 4]

Michael Abshoff Michael.Abshoff at fsmath.mathematik.uni-dortmund.de
Tue Nov 29 00:24:05 CET 2005

> Hi,
> I don't know if this is the appropriate place, but some weeks ago I
> already posted this message to the gmp buglist and got no reply, so I
> don't know if somebody received this message.
> I attached the original error message to this mail.
> In short this happened:
> I recognized a problem in gmp_printf if large integer numbers are
> printed (6 mio digits). Then I created a little test program which
> computes mersenne prime 42 and tries to print it out. While trying to
> print it encounters a memory access violation (Speicherzugriffsfehler in
> my german linux version).
> I used gmp 4.1.4, so it shouldn't be the same bug which is already known
> in 4.1.3.
> I attach the testprogram to this mail, so if you like you can just
> compile it and try to reproduce the error.
> Kind regards
> Jürgen

hey Jürgen,

Q3 from the faq should answer your question:

Q3:  I get a Segfault/Bus error in a program that uses GMP to calculate
numbers with several hundred thousand digits. Why?

A3: 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
it 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.

To make sure check out what "ulimit -a" tells you. If your stack is
limited try setting "ulimit -s unlimited". If this solves your problem
just recompile the gmp with --disable-alloca.



> --
> Juergen Bullinger <juergen.bullinger at gmx.net>
> _______________________________________________
> gmp-discuss mailing list
> gmp-discuss at swox.com
> https://gmplib.org/mailman/listinfo/gmp-discuss

More information about the gmp-discuss mailing list