Invalid read in mpz_powm_ui

Emmanuel Thomé emmanuel.thome at gmail.com
Thu Dec 6 16:33:24 CET 2012


On Thu, Dec 6, 2012 at 3:03 PM, Torbjorn Granlund <tg at gmplib.org> wrote:
> I understand that it is hard to keep up with the relentless addition of
> instructions in the x86 world.  The umaal is not new, however.

valgrind has always lagged behind a bit on some not-so-common instructions.

Having asm instructions in addmul_1 not supported by valgrind is
something which annoys gmp users, because it makes it impossible to
test their code under valgrind (a suggestion to use a plain C gmp is
valid, though).

My experience is that the valgrind developers are doing a very good
job at supporting a fair share of the instructions which show up, but
they can't always be exhaustive. If we, as users of gmp for instance,
are impacted by some missing instructions, a nice thing to do is to
provide the fix by ourselves. Especially if a single instruction is
concerned (for a whole range of instruction encodings, it's a
different issue). For example, I recall having helped in to get rclq
supported on amd64, long ago. That was specifically for using gmp
(Pierrick's asm patches, by then). Same for pclmulqdq, more recently
(not gmp-related).

Best,

E.


More information about the gmp-bugs mailing list