invalid read in mpn_copyi?

Emmanuel Thomé emmanuel.thome at gmail.com
Tue Jan 21 21:54:46 UTC 2014


Suppressions make it possible to silence some errors by matching on
some fragment of the stack trace.

Example (from alex's example program in the thread pointed to by marc):

quiche /tmp $ cat gmp-copyid.supp
{
        partialloads_copyd
        Memcheck:Addr8
        fun:__gmpn_copyd
}
{
        partialloads_copyi
        Memcheck:Addr8
        fun:__gmpn_copyi
}
quiche /tmp $ valgrind --suppressions=gmp-copyid.supp ./test_mpmod
(no longer complains).

See also http://valgrind.org/docs/manual/mc-manual.html#mc-manual.suppfiles

I don't know if we are to regard this as too coarse or not. Certainly
if some non-sse implementation of copy[id] gets passed a pointer in
the middle of nowhere, preventing it from complaining is a bad idea.
So in such cases, the suppression file above would be coarser than
partial-loads.

E.

On Tue, Jan 21, 2014 at 10:48 PM, Niels Möller <nisse at lysator.liu.se> wrote:
> David Harvey <d.harvey at unsw.edu.au> writes:
>
>> I can see why this might be considered a non-bug, and perhaps it's even intentional for performance reasons, but it seemed dodgy enough to me to report it.
>
> If the warnings disappear with --partial-loads-ok=yes to valgrind, the
> reads are most likely intentional.
>
> It would be nice to be able to tell valgrind on a per object file (or
> per function or even per instruction) if the code is expected to do such
> "partial loads". Is that possible?
>
> Regards,
> /Niels
>
> --
> Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
> Internet email is subject to wholesale government surveillance.
> _______________________________________________
> gmp-bugs mailing list
> gmp-bugs at gmplib.org
> https://gmplib.org/mailman/listinfo/gmp-bugs


More information about the gmp-bugs mailing list